From 49991faf6e01c315936c4d08153ca12695e300ba Mon Sep 17 00:00:00 2001 From: John Mertz Date: Mon, 21 Nov 2022 18:45:57 -0500 Subject: [PATCH] Change swayidle to a systemd service --- sway/autostart | 4 +--- sway/systemd/swayidle.service | 13 +++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 sway/systemd/swayidle.service diff --git a/sway/autostart b/sway/autostart index 2bd133972..c42567d57 100644 --- a/sway/autostart +++ b/sway/autostart @@ -1,4 +1,5 @@ # vim: ft=sh +#TODO: Convert to systemd services, where reasonable ################################################################################ # Background utilities @@ -7,9 +8,6 @@ # Window transparency exec ${HOME}/scripts/sway/window-transparency.py -# Custom SwayIdle script -exec swayidle -w timeout 500 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' & -#exec ${HOME}/scripts/sway/idle.sh start & # SSH Add - Should be started by profile instead # exec eval `ssh-agent -a ${SSH_AUTH_SOCK}` diff --git a/sway/systemd/swayidle.service b/sway/systemd/swayidle.service new file mode 100644 index 000000000..81e34e45a --- /dev/null +++ b/sway/systemd/swayidle.service @@ -0,0 +1,13 @@ +[Unit] +Description=Swayidle to trigger idle actions +Documentation=man:swayidle(1) +PartOf=graphical-session.target +After=sway.service + +[Service] +Type=simple +ExecStart=/var/home/jpm/scripts/sway/idle.sh start +ExecStop=/var/home/jpm/scripts/sway/idle.sh stop + +[Install] +WantedBy=graphical-session.target