diff --git a/.config/sway/config b/.config/sway/config index 47adbc8..7d359a5 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -9,9 +9,6 @@ include ~/.config/sway/config.d/* # output eDP-1 scale 1.5 # output * scale 1.25 -# enable automatic display arrangements -exec kanshi - # notification daemon exec mako @@ -149,3 +146,9 @@ client.focused_inactive #000000 #000000 #c6d0f5 #ea999c #232634 client.unfocused #000000 #000000 #c6d0f5 #ea999c #232634 floating_modifier $mod + +exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target" +exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target + +# enable automatic display arrangements +exec_always "systemctl --user restart kanshi.service" diff --git a/.config/systemd/user/kanshi.service b/.config/systemd/user/kanshi.service new file mode 100644 index 0000000..468344e --- /dev/null +++ b/.config/systemd/user/kanshi.service @@ -0,0 +1,10 @@ +[Unit] +Description=Start kanshi display service +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=/usr/bin/kanshi + +[Install] +WantedBy=sway-session.target diff --git a/.config/systemd/user/sway-session.target b/.config/systemd/user/sway-session.target new file mode 100644 index 0000000..30151b3 --- /dev/null +++ b/.config/systemd/user/sway-session.target @@ -0,0 +1,6 @@ +[Unit] +Description=sway compositor session +Documentation=man:systemd.special(7) +BindsTo=graphical-session.target +Wants=graphical-session-pre.target +After=graphical-session-pre.target diff --git a/.config/systemd/user/sway-session.target.wants/kanshi.service b/.config/systemd/user/sway-session.target.wants/kanshi.service new file mode 120000 index 0000000..4eb87d6 --- /dev/null +++ b/.config/systemd/user/sway-session.target.wants/kanshi.service @@ -0,0 +1 @@ +/home/lennartalff/.config/systemd/user/kanshi.service \ No newline at end of file