summaryrefslogtreecommitdiffstats
path: root/.config/awesome/rc.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/awesome/rc.lua')
-rw-r--r--.config/awesome/rc.lua27
1 files changed, 20 insertions, 7 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index 21f79e8..a7cd86c 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -22,9 +22,6 @@ vicious.contrib = require("vicious.contrib")
lain = require("lain")
lain.helpers = require("lain.helpers")
--- Load run_once function
-require("functions.run_once")
-
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
@@ -111,6 +108,22 @@ local function client_menu_toggle_fn()
end
end
end
+
+local function run_once(cmd_name,cmd_args,process_name)
+ if not cmd_name then
+ do return nil end
+ end
+
+ if not process_name then
+ process_name = cmd_name
+ end
+
+ if not cmd_args then
+ awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. process_name .. "' || (" .. cmd_name .. ")")
+ else
+ awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. process_name .. "' || (" .. cmd_name .. " " .. cmd_args .. ")")
+ end
+end
-- }}}
-- {{{ Menu
@@ -867,8 +880,8 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n
-- {{{ Startup Apps
run_once("redshift")
run_once("xbindkeys")
--- run_once("parcellite", "parcellite --no-icon")
-run_once("nitrogen", "nitrogen --restore")
-run_once("xautolock", "xautolock -time 20 -locker 'i3lock -denc 000000' -killtime 60 -killer 'systemctl suspend' -detectsleep")
-run_once("pulseaudio", "pulseaudio --daemonize")
+-- run_once("parcellite", "--no-icon")
+run_once("nitrogen","--restore")
+run_once("xautolock", "-time 20 -locker 'i3lock -denc 000000' -killtime 60 -killer 'systemctl suspend' -detectsleep")
+run_once("pulseaudio", "--daemonize")
-- }}}