update: autostart

This commit is contained in:
rxyhn 2022-03-06 23:50:26 +07:00
parent 2975984d23
commit 929742f132
4 changed files with 19 additions and 15 deletions

View file

@ -1,14 +0,0 @@
#!/usr/bin/env bash
function run {
if ! pgrep -f $1 ;
then
$@&
fi
}
# compositor
run picom --experimental-backends --config $HOME/.config/picom/picom.conf
# auth
run /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

View file

@ -0,0 +1,18 @@
local awful = require("awful")
local gears = require("gears")
local function run_once(cmd)
local findme = cmd
local firstspace = cmd:find(' ')
if firstspace then findme = cmd:sub(0, firstspace - 1) end
awful.spawn.with_shell(string.format(
'pgrep -u $USER -x %s > /dev/null || (%s)',
findme, cmd), false)
end
-- picom
run_once("picom --experimental-backends --config " ..
gears.filesystem.get_configuration_dir() .. "theme/picom.conf")
return autostart

View file

@ -36,7 +36,7 @@ screen_width = awful.screen.focused().geometry.width
screen_height = awful.screen.focused().geometry.height
-- Autostart
awful.spawn.with_shell("~/.config/awesome/configuration/autorun.sh")
local autostart = require("configuration.autostart")
-- Import Configuration
require("configuration")