summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-03-25 23:50:15 -0500
committerzachir <zachir@librem.one>2023-03-25 23:50:15 -0500
commit41a75bc864d915b904c9577e729c145ffe889305 (patch)
tree9f73840f07e9fc1c57744f2e3730170fbf0374d8
parent13c72b220f16127d3bbbfecfa6c7510534605f90 (diff)
remove awesome-scratch as dependency (now using bling)
-rw-r--r--.gitmodules3
m---------awesome/awesome-scratch0
-rw-r--r--awesome/rc.lua188
3 files changed, 160 insertions, 31 deletions
diff --git a/.gitmodules b/.gitmodules
index 80e6b9d..b51913f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -10,9 +10,6 @@
[submodule "awesome/awesome-wm-widgets"]
path = awesome/awesome-wm-widgets
url = https://git.zachir.xyz/awesome-wm-widgets.git
-[submodule "awesome/awesome-scratch"]
- path = awesome/awesome-scratch
- url = https://github.com/notnew/awesome-scratch
[submodule "awesome/bling"]
path = awesome/bling
url = https://github.com/BlingCorp/bling.git
diff --git a/awesome/awesome-scratch b/awesome/awesome-scratch
deleted file mode 160000
-Subproject 172c0b47228a4cb83e298273d217c03f8eed741
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"
}