From 41a75bc864d915b904c9577e729c145ffe889305 Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 25 Mar 2023 23:50:15 -0500 Subject: remove awesome-scratch as dependency (now using bling) --- awesome/rc.lua | 188 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 160 insertions(+), 28 deletions(-) (limited to 'awesome/rc.lua') diff --git a/awesome/rc.lua b/awesome/rc.lua index 002d609..bbdcfce 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -2,8 +2,6 @@ -- found (e.g. lgi). If LuaRocks is not installed, do nothing. pcall(require, "luarocks.loader") -local scratch = require("awesome-scratch.scratch") - -- Standard awesome library local gears = require("gears") local awful = require("awful") @@ -123,22 +121,32 @@ function crcparse(substr) until not line end -function terminal_sp_cmd (spc, cmd) +function terminal_sp_cmd (spc, cmd, geo) if terminal == "st" then cflag = "-c" gflag = "-g" xflag = "-e" - geo = "160x45" elseif terminal == "alacritty" then cflag = "--class" gflag = false xflag = "-e" end + if cflag and spc then + cl = " " .. cflag .. " " .. spc + else + cl = "" + end if gflag then - return terminal .. " " .. cflag .. " " .. spc .. " " .. gflag .. " " .. geo .. " " .. xflag .. " " .. cmd + gl = " " .. gflag .. " " .. geo + else + gl = "" + end + if xflag and cmd then + xl = " " .. xflag .. " " .. cmd else - return terminal .. " " .. cflag .. " " .. spc .. " " .. " " .. xflag .. " " .. cmd + xl = "" end + return terminal .. cl .. gl .. xl end -- }}} @@ -162,6 +170,141 @@ end -- }}} +--{{{ bling scratchpad definitions +--{{{ sphtop +local sphtop = bling.module.scratchpad { + command = terminal_sp_cmd("sphtop", "htop", nil), + rule = { class = "sphtop" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spterm +local spterm = bling.module.scratchpad { + command = terminal_sp_cmd("spterm", nil, nil), + rule = { class = "spterm" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ sppmxr +local sppmxr = bling.module.scratchpad { + command = terminal_sp_cmd("sppmxr", "pulsemixer", nil), + rule = { class = "sppmxr" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spblue +local spblue = bling.module.scratchpad { + command = terminal_sp_cmd("spblue", "bluetoothctl", nil), + rule = { class = "spblue" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spncmp +local spncmp = bling.module.scratchpad { + command = terminal_sp_cmd("spncmp", "ncmpcpp", nil), + rule = { class = "spncmp" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spmutt +local spmutt = bling.module.scratchpad { + command = terminal_sp_cmd("spmutt", "neomutt", nil), + rule = { class = "spmutt" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spprof +local spprof = bling.module.scratchpad { + command = terminal_sp_cmd("spprof", "profanity", nil), + rule = { class = "spprof" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ spirss +local spirss = bling.module.scratchpad { + command = terminal_sp_cmd("spirss", "irssi", nil), + rule = { class = "spirss" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ sptodo +local sptodo = bling.module.scratchpad { + command = terminal_sp_cmd("sptodo", "todo", nil), + rule = { class = "sptodo" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ sptrem +local sptrem = bling.module.scratchpad { + command = terminal_sp_cmd("sptrem", "tremc", nil), + rule = { class = "sptrem" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--{{{ qpwgraph +local qpwgraph = bling.module.scratchpad { + command = "qpwgraph", + rule = { class = "qpwgraph" }, + sticky = true, + autoclose = true, + floating = true, + geometry = { x = 575, y = 275, height = 530, width = 770 }, + reapply = true, + dont_focus_before_close = false +} +--}}} +--}}} + -- {{{ Menu -- Create a launcher widget and a main menu myawesomemenu = { @@ -419,47 +562,47 @@ end) globalkeys = gears.table.join( -- scratchpads awful.key({ modkey, "Control" }, "z", function () - scratch.toggle(terminal_sp_cmd("sphtop","htop"), { class = "sphtop" }) + sphtop:toggle() end, {description = "Toggle htop scratchpad"}), awful.key({ modkey, "Control" }, "x", function () - scratch.toggle(terminal_sp_cmd("spterm","zsh"), { class = "spterm" }) + spterm:toggle() end, {description = "Toggle term scratchpad"}), awful.key({ modkey, "Control" }, "c", function () - scratch.toggle(terminal_sp_cmd("sppmxr","pulsemixer"), { class = "sppmxr" }) + sppmxr:toggle() end, {description = "Toggle pulsemixer scratchpad"}), awful.key({ modkey, "Control" }, "v", function () - scratch.toggle(terminal_sp_cmd("spblue","bluetoothctl"), { class = "spblue" }) + spblue:toggle() end, {description = "Toggle bluetoothctl scratchpad"}), awful.key({ modkey, "Control" }, "b", function () - scratch.toggle(terminal_sp_cmd("spncmp","ncmpcpp"), { class = "spncmp" }) + spncmp:toggle() end, {description = "Toggle ncmpcpp scratchpad"}), awful.key({ modkey, "Control" }, "a", function () - scratch.toggle(terminal_sp_cmd("spmutt","neomutt"), { class = "spmutt" }) + spmutt:toggle() end, {description = "Toggle neomutt scratchpad"}), awful.key({ modkey, "Control" }, "s", function () - scratch.toggle(terminal_sp_cmd("spprof","profanity"), { class = "spprof" }) + spprof:toggle() end, {description = "Toggle profanity scratchpad"}), awful.key({ modkey, "Control" }, "d", function () - scratch.toggle(terminal_sp_cmd("spircc","irssi"), { class = "sptrem" }) + spirss:toggle() end, {description = "Toggle irssi scratchpad"}), awful.key({ modkey, "Control" }, "f", function () - scratch.toggle(terminal_sp_cmd("sptodo","todo"), { class = "sptrem" }) + sptodo:toggle() end, {description = "Toggle todo.txt scratchpad"}), awful.key({ modkey, "Control" }, "g", function () - scratch.toggle(terminal_sp_cmd("sptrem","tremc"), { class = "sptrem" }) + sptrem:toggle() end, {description = "Toggle tremc scratchpad"}), awful.key({ modkey, "Control" }, "q", function () - scratch.toggle("qpwgraph", { class = "qpwgraph" }) + qpwgraph:toggle() end, {description = "Toggle qpwgraph scratchpad"}), awful.key({ modkey, }, "a", function () @@ -757,17 +900,6 @@ awful.rules.rules = { { rule_any = { class = { - "sphtop", - "spterm", - "sppmxr", - "spblue", - "spncmp", - "spmutt", - "spprof", - "spircc", - "sptodo", - "sptrem", - "qpwgraph", "QjackCtl", "gcr-prompter" } -- cgit v1.2.3