1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2026-03-23 05:55:12 +00:00

add suspense lock

This commit is contained in:
Crescent617 2023-12-17 11:47:03 +08:00
parent ed1801db77
commit e199213ff1
2 changed files with 23 additions and 11 deletions

26
rc.lua
View file

@ -62,14 +62,26 @@ end
-- {{{ Autostart windowless processes -- {{{ Autostart windowless processes
-- This function will run once every time Awesome is started -- This function will only be executed once on startup
local function run_once(cmd_arr) local function run_once(cmd)
for _, cmd in ipairs(cmd_arr) do awful.spawn.easy_async_with_shell(string.format("pgrep -fx '%s'", cmd), function(stdout)
awful.spawn.with_shell(string.format("pgrep -fx '%s' > /dev/null || (%s)", cmd, cmd)) stdout = string.gsub(stdout, "%s+", "")
if stdout == "" then
naughty.notify {
title = "AwesomeWM Autostart",
text = "Starting: " .. cmd,
}
awful.spawn.with_shell(cmd)
else
naughty.notify {
title = "AwesomeWM Autostart",
text = "Already running: " .. cmd,
}
end end
end)
end end
run_once { "compton" } -- comma-separated entries run_once "compton --vsync opengl-swc --backend glx"
-- This function implements the XDG autostart specification -- This function implements the XDG autostart specification
--[ --[
@ -617,7 +629,7 @@ clientkeys = mytable.join(
awful.client.floating.toggle, awful.client.floating.toggle,
{ description = "toggle floating", group = "client" } { description = "toggle floating", group = "client" }
), ),
awful.key({ modkey, "Control" }, "Return", function(c) awful.key({ modkey, "Shift" }, "Return", function(c)
c:swap(awful.client.getmaster()) c:swap(awful.client.getmaster())
end, { description = "move to master", group = "client" }), end, { description = "move to master", group = "client" }),
awful.key({ modkey }, "o", function(c) awful.key({ modkey }, "o", function(c)
@ -757,7 +769,7 @@ awful.rules.rules = {
"veromix", "veromix",
"xtightvncviewer", "xtightvncviewer",
"Clash for Windows", "Clash for Windows",
"eudic" "eudic",
}, },
-- Note that the name property shown in xprop might be set slightly after creation of the client -- Note that the name property shown in xprop might be set slightly after creation of the client

View file

@ -202,7 +202,7 @@ function theme.at_screen_connect(s)
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons) s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
-- Create the wibox -- Create the wibox
s.mywibox = awful.wibar { position = "bottom", screen = s, height = dpi(22), bg = theme.bg_normal, fg = theme.fg_normal } s.mywibox = awful.wibar { position = "top", screen = s, height = dpi(22), bg = theme.bg_normal, fg = theme.fg_normal }
-- Add widgets to the wibox -- Add widgets to the wibox
s.mywibox:setup { s.mywibox:setup {
@ -225,8 +225,8 @@ function theme.at_screen_connect(s)
onlock = function() onlock = function()
awful.spawn.with_shell "slock" awful.spawn.with_shell "slock"
end, end,
onpoweroff = function() onsuspend = function()
awful.spawn.with_shell "shoutdown -h now" awful.spawn.with_shell "slock systemctl suspend"
end, end,
}, },
}, },