kitchenos/rootfs/usr/libexec/sway-systemd

24 lines
469 B
Bash
Executable File

#!/bin/sh
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP="${XDG_SESSION_DESKTOP:-sway}"
export XDG_SESSION_TYPE=wayland
systemctl --user import-environment \
SWAYSOCK \
XDG_CURRENT_DESKTOP \
XDG_SESSION_DESKTOP \
XDG_SESSION_TYPE \
WAYLAND_DISPLAY
systemctl --user reset-failed
systemctl --user start sway-session.target
shutdown() {
systemctl --user stop sway-session.target
}
trap shutdown INT TERM
swaymsg -t subscribe '["shutdown"]'
shutdown