diff options
author | zachir <zachir@librem.one> | 2023-04-25 16:54:01 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-04-25 16:54:01 -0500 |
commit | 50a2a246ac8e1e84ecc3fc7c09d17cf50b31ca61 (patch) | |
tree | 40dba3e89f62975a5e82f9aeb0dc481d294377a1 /awesome/rc.lua | |
parent | 20e54d48936d0e22a7335eede76bb4e79c55ce1a (diff) | |
parent | beeb0a5338711b05fd4a9615e95af791c29cc35e (diff) |
Merge branch 'master' of zachir.xyz:zachir/dotfiles
Diffstat (limited to 'awesome/rc.lua')
-rw-r--r-- | awesome/rc.lua | 188 |
1 files changed, 160 insertions, 28 deletions
diff --git a/awesome/rc.lua b/awesome/rc.lua index 634a650..7ae5a5e 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", "Tk", "gcr-prompter" |