diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf index 2dfe024..48f05d2 100644 --- a/home/.config/hypr/hypridle.conf +++ b/home/.config/hypr/hypridle.conf @@ -1,9 +1,9 @@ -#lock-cmd = swaylock -fF --image /home/itsdrike/Pictures/Wallpapers/Categories/Extra/CommieGNULinux.png --indicator-x-position 300 --indicator-y-position 300 general { - lock_cmd = swaylock -fF # dbus/sysd lock command (loginctl lock-session) + #lock_cmd = swaylock -fF # handled by systemd-lock-handler unlock-cmd = killall -s SIGUSR1 swaylock # same as above, but unlock + before_sleep_cmd = loginctl lock-session && sleep 2 ignore_dbus_inhibit = false } diff --git a/home/.config/systemd/user/hypridle.service b/home/.config/systemd/user/hypridle.service index 28b84f4..f4721b5 100644 --- a/home/.config/systemd/user/hypridle.service +++ b/home/.config/systemd/user/hypridle.service @@ -1,6 +1,6 @@ [Unit] Description="Idle management daemon" -PartOf=graphica-session.target +PartOf=graphical-session.target [Service] ExecStart=/usr/bin/stdbuf -oL /usr/bin/hypridle diff --git a/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-swaylock.service b/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-swaylock.service new file mode 120000 index 0000000..587607f --- /dev/null +++ b/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-swaylock.service @@ -0,0 +1 @@ +/home/itsdrike/.config/systemd/user/systemd-lock-handler-swaylock.service \ No newline at end of file diff --git a/home/.config/systemd/user/systemd-lock-handler-swaylock.service b/home/.config/systemd/user/systemd-lock-handler-swaylock.service new file mode 100644 index 0000000..7707395 --- /dev/null +++ b/home/.config/systemd/user/systemd-lock-handler-swaylock.service @@ -0,0 +1,19 @@ +[Unit] +Description=Run Swaylock screenlocker on lock dbus event (using systemd-lock-handler) +# if swaylock exists cleanly, unlock this session +OnSuccess=unlock.target +# When lock.target is stopped, stop this too +PartOf=lock.target +# Delay lock.target until this service is ready +After=lock.target + +[Service] +# systemd will consider this service started when swaylock forks +# which swaylock will only do after it has locked the screen +Type=forking +ExecStart=/usr/bin/swaylock -fF +#ExecStart=/usr/bin/swaylock -fF --image /home/itsdrike/Pictures/Wallpapers/Categories/Extra/CommieGNULinux.png --indicator-x-position 300 --indicator-y-position 300 +Restart=on-failure + +[Install] +WantedBy=lock.target diff --git a/home/.config/systemd/user/wayland-session.target b/home/.config/systemd/user/wayland-session.target index fe07af1..e7b42ca 100644 --- a/home/.config/systemd/user/wayland-session.target +++ b/home/.config/systemd/user/wayland-session.target @@ -3,3 +3,4 @@ Description=Waylnad compositor loaded and ready BindsTo=wm-ready.target Wants=xdg-desktop-portal.service Wants=xdg-desktop-portal-hyprland.service +Wants=systemd-lock-handler.service