services: Add desktop environment programs as user services

Added a runit-managed kanshi, swaybg, waybar, wl-paste and wlsunset
service.
This commit is contained in:
Marty Oehme 2025-02-24 16:59:02 +01:00
parent e08f88db9c
commit a3f30cf228
Signed by: Marty
GPG key ID: 4E535BC19C61886E
11 changed files with 87 additions and 27 deletions

3
services/sv/kanshi/log/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec vlogger -t kanshi -p daemon

6
services/sv/kanshi/run Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
exec 2>&1
exec chpst -e "$TURNSTILE_ENV_DIR" kanshi

3
services/sv/swaybg/log/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec vlogger -t swaybg -p daemon

6
services/sv/swaybg/run Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
exec 2>&1
exec chpst -e "$TURNSTILE_ENV_DIR" swaybg -o "LG Electronics W2442 0x000574E1" -i "$HOME/pictures/wall_l.jpg" -o "LG Electronics W2442 0x000574FD" -i "$HOME/pictures/wall_r.jpg"

3
services/sv/waybar/log/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec vlogger -t waybar -p daemon

6
services/sv/waybar/run Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
exec 2>&1
exec chpst -e "$TURNSTILE_ENV_DIR" waybar

3
services/sv/wl-paste/log/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec vlogger -t wl-paste -p daemon

8
services/sv/wl-paste/run Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
echo "Service wl-paste starting..."
exec 2>&1
exec chpst -e "$TURNSTILE_ENV_DIR" wl-paste -t text --watch clipman store

3
services/sv/wlsunset/log/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
exec vlogger -t wlsunset -p daemon

16
services/sv/wlsunset/run Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
[ -r ./conf ] && . ./conf
TIME_OPTS='-S \"09:00\" -s \"21:00\" -d \"3600\"'
if command -v curl >/dev/null 2>&1; then
loc=$(curl -s ipinfo.io | grep -e '"loc": ' | sed -e 's/^.*"loc": "\(.*\)",$/\1/')
if [ -n "$loc" ]; then
lat="$(echo "$loc" | cut -d, -f1)"
long="$(echo "$loc" | cut -d, -f2)"
TIME_OPTS="-l \"$lat\" -L \"$long\""
fi
fi
exec 2>&1
exec chpst -e "$TURNSTILE_ENV_DIR" wlsunset $TIME_OPTS "$@"