diff options
author | Patrick Spek <p.spek@tyil.nl> | 2024-02-06 11:17:16 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2024-02-06 11:17:16 +0100 |
commit | ace4c02ee83822eaddac7d3c52467a6e9c246e12 (patch) | |
tree | 0b20cc4d9bb589aa70223b0ee816e79786f25e26 | |
parent | 584932f2fa75042aedb3d1544961cc0fde5a5961 (diff) |
Leverage systemd for startup units
-rw-r--r-- | .config/awesome/rc.lua | 19 | ||||
-rwxr-xr-x | .local/bin/x | 4 | ||||
-rw-r--r-- | .local/etc/x/xinitrc | 20 |
3 files changed, 11 insertions, 32 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 1a7c4fd..4d07024 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -46,22 +46,9 @@ do end -- }}} --- {{{ Background services -function run_once(cmd) - findme = cmd - firstspace = cmd:find(" ") - - if firstspace then - findme = cmd:sub(0, firstspace - 1) - end - - awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")") -end - -run_once("xcompmgr") -run_once("chwp") -run_once("redshift -l 51.50:4.59 -t 6500:2500") --- }}} +-- Start the desktop.target to autostart applications through systemd +awful.util.spawn_with_shell("systemctl --user start desktop.target") +awful.util.spawn_with_shell("systemctl --user start desktop-x11.target") -- {{{ Variable definitions beautiful.init(awful.util.getdir("config") .. "/theme.lua") diff --git a/.local/bin/x b/.local/bin/x index 94f10ae..a47b1bc 100755 --- a/.local/bin/x +++ b/.local/bin/x @@ -26,4 +26,6 @@ then fi # start the X session -exec startx +startx +systemctl --user stop desktop-x11.target +systemctl --user stop desktop.target diff --git a/.local/etc/x/xinitrc b/.local/etc/x/xinitrc index 4d17b98..ccb21f3 100644 --- a/.local/etc/x/xinitrc +++ b/.local/etc/x/xinitrc @@ -1,14 +1,5 @@ #!/bin/sh -# start dbus if necessary -[ -f "/etc/X11/xinit/xinitrc.d/80-dbus" ] && source /etc/X11/xinit/xinitrc.d/80-dbus - -# start polkit auth agent -eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg) -export GNOME_KEYRING_PID -export GNOME_KEYRING_SOCKET -export SSH_AUTH_SOCK - # set the default mousepointer xsetroot -cursor_name left_ptr @@ -27,7 +18,6 @@ fi # xkbmap options setxkbmap \ -layout us \ - \ -option compose:menu \ -option caps:escape @@ -37,8 +27,8 @@ xmodmap -e "keycode 108 = ISO_Level3_Shift" # Export variables for a better X11 experience export WINIT_X11_SCALE_FACTOR=1 -# Autostart desired applications -while read -r application -do - $application & -done < "$HOME/.local/etc/x/autostart" +# Import X11 environment for systemd +systemctl --user import-environment \ + DISPLAY \ + WINIT_X11_SCALE_FACTOR \ + XAUTHORITY |