From f0c44fe73bd2b1d609858b9654eb064f6a6bdd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 20 Aug 2018 18:45:35 +0200 Subject: [PATCH] Use systemd user unit for long-running stuff --- autostart/20_dunst.sh | 2 +- autostart/20_screen.sh | 2 +- autostart/40_wallpaper.sh | 2 +- autostart/50_network.sh | 2 +- autostart/50_pasystray.sh | 2 +- autostart/50_redshift.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autostart/20_dunst.sh b/autostart/20_dunst.sh index dd4b8d7..2f35e4b 100755 --- a/autostart/20_dunst.sh +++ b/autostart/20_dunst.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -dunst -config ~/.config/dunstrc & +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} dunst -config ~/.config/dunstrc & diff --git a/autostart/20_screen.sh b/autostart/20_screen.sh index f0d935e..ab3b815 100755 --- a/autostart/20_screen.sh +++ b/autostart/20_screen.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash printf '%s\n' "start compton" -compton --backend xrender --vsync opengl & +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} compton --backend xrender --vsync opengl & printf '%s\n' "disable screen blanking" xset -dpms & diff --git a/autostart/40_wallpaper.sh b/autostart/40_wallpaper.sh index 515cb7d..e564273 100755 --- a/autostart/40_wallpaper.sh +++ b/autostart/40_wallpaper.sh @@ -3,4 +3,4 @@ wallpaper="$LIBDIR/wallpaper/current" printf '%s' "setting wallpaper" -feh --bg-scale "${wallpaper}" +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} feh --bg-scale "${wallpaper}" diff --git a/autostart/50_network.sh b/autostart/50_network.sh index f4c8873..0843221 100755 --- a/autostart/50_network.sh +++ b/autostart/50_network.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash printf '%s' "starting network tray application" -nm-applet & +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} nm-applet diff --git a/autostart/50_pasystray.sh b/autostart/50_pasystray.sh index 0a641c3..4bbecac 100755 --- a/autostart/50_pasystray.sh +++ b/autostart/50_pasystray.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash printf '%s' "starting pasystray" -pasystray & +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} pasystray diff --git a/autostart/50_redshift.sh b/autostart/50_redshift.sh index 9b79650..9774d23 100755 --- a/autostart/50_redshift.sh +++ b/autostart/50_redshift.sh @@ -5,5 +5,5 @@ redshift_lat_long="49.5:11" redshift_colortemp="6000:3300" printf '%s' "starting redshift-gtk" -redshift-gtk -b 1 -l "$redshift_lat_long" -t "$redshift_colortemp" & +systemd-run --remain-after-exit --user --setenv=DISPLAY=${DISPLAY} redshift-gtk -b 1 -l "$redshift_lat_long" -t "$redshift_colortemp" printf '%s' $! > "$RUNDIR"/redshift.${XDG_SESSION_ID}.pid