yavdr-ansible/roles/yavdr-desktop/templates/openbox/autostart.j2

32 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-06-21 10:14:35 +02:00
#!/bin/bash
# forward environment variables to an environment file and the systemd user session
env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env
systemctl --user import-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS
2017-12-20 13:31:36 +01:00
feh --bg-center "/usr/share/yavdr/images/yavdr_logo.png"
enabled_services=(
"tmux.service" "detect-second-display.service"
"openbox-second.service" "osd2web.service"
2017-07-30 23:09:58 +02:00
"yavdr-frontend.service" "pulseaudio.socket"
2017-12-20 11:00:15 +01:00
"pulseaudio.service" "wm-exit.service" "irexec.service")
2017-06-21 10:14:35 +02:00
disabled_services=()
# enable configured services for the user session
for service in "${enabled_services[@]}"; do
systemctl --user enable "$service"
done
# disable unwanted services for the user session
for service in "${disabled_services[@]}"; do
systemctl --user disable "$service"
done
if which dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR
fi
# start systemd units for the yavdr user session
systemctl --user isolate yavdr-desktop.target
udiskie &