diff --git a/rc.lua b/rc.lua index 0a83dff..d135aa5 100644 --- a/rc.lua +++ b/rc.lua @@ -62,14 +62,26 @@ end -- {{{ Autostart windowless processes --- This function will run once every time Awesome is started -local function run_once(cmd_arr) - for _, cmd in ipairs(cmd_arr) do - awful.spawn.with_shell(string.format("pgrep -fx '%s' > /dev/null || (%s)", cmd, cmd)) - end +-- This function will only be executed once on startup +local function run_once(cmd) + awful.spawn.easy_async_with_shell(string.format("pgrep -fx '%s'", cmd), function(stdout) + 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 -run_once { "compton" } -- comma-separated entries +run_once "compton --vsync opengl-swc --backend glx" -- This function implements the XDG autostart specification --[ @@ -617,7 +629,7 @@ clientkeys = mytable.join( awful.client.floating.toggle, { description = "toggle floating", group = "client" } ), - awful.key({ modkey, "Control" }, "Return", function(c) + awful.key({ modkey, "Shift" }, "Return", function(c) c:swap(awful.client.getmaster()) end, { description = "move to master", group = "client" }), awful.key({ modkey }, "o", function(c) @@ -757,7 +769,7 @@ awful.rules.rules = { "veromix", "xtightvncviewer", "Clash for Windows", - "eudic" + "eudic", }, -- Note that the name property shown in xprop might be set slightly after creation of the client diff --git a/themes/multicolor/theme.lua b/themes/multicolor/theme.lua index b5782d2..8b6359c 100644 --- a/themes/multicolor/theme.lua +++ b/themes/multicolor/theme.lua @@ -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) -- 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 s.mywibox:setup { @@ -225,8 +225,8 @@ function theme.at_screen_connect(s) onlock = function() awful.spawn.with_shell "slock" end, - onpoweroff = function() - awful.spawn.with_shell "shoutdown -h now" + onsuspend = function() + awful.spawn.with_shell "slock systemctl suspend" end, }, },