diff --git a/home/.config/hypr/hypridle.conf b/home/.config/hypr/hypridle.conf new file mode 100644 index 0000000..43e18f4 --- /dev/null +++ b/home/.config/hypr/hypridle.conf @@ -0,0 +1,37 @@ +#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) + unlock-cmd = killall -s SIGUSR1 swaylock # same as above, but unlock + before_sleep_cmd = loginctl lock-session && sleep 2 + ignore_dbus_inhibit = false +} + +# Warn about going idle (5 mins) +listener { + timeout = 300 + on-timeout = notify-send "HyprIdle" "Going idle in 10 seconds..." +} + +# Lock the session & disable dunst notifications +listener { + timeout = 310 + on-timeout = loginctl lock-session && dunstctl set-paused true + on-resume = dunstctl set-paused false +} + +# Turn off the screen after another 30s +listener { + timeout = 340 + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on +} + +# Enter suspend/sleep state (10 mins) +# On low battery, or after HibernateDelaySec (/etc/systemd/sleep.conf), the system +# will enter full hibernation +listener { + timeout = 600, + on-timeout = systemctl suspend-then-hibernate +} diff --git a/home/.config/swayidle/config b/home/.config/swayidle/config deleted file mode 100644 index ab5ecc7..0000000 --- a/home/.config/swayidle/config +++ /dev/null @@ -1,2 +0,0 @@ -timeout 300 "hyprctl dispatch dpms off && dunstctl set-paused true" resume "hyprctl dispatch dpms on && dunstctl set-paused false" -timeout 310 "loginctl lock-session" diff --git a/home/.config/systemd/user/swayidle.service b/home/.config/systemd/user/hypridle.service similarity index 66% rename from home/.config/systemd/user/swayidle.service rename to home/.config/systemd/user/hypridle.service index 04bfcc1..f46759a 100644 --- a/home/.config/systemd/user/swayidle.service +++ b/home/.config/systemd/user/hypridle.service @@ -1,9 +1,9 @@ [Unit] Description="Idle management daemon" -PartOf=graphical-session.target +PartOf=graphica-session.target [Service] -ExecStart=/usr/bin/swayidle +ExecStart=/usr/bin/hypridle Restart=on-failure [Install] 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 deleted file mode 120000 index 587607f..0000000 --- a/home/.config/systemd/user/lock.target.wants/systemd-lock-handler-swaylock.service +++ /dev/null @@ -1 +0,0 @@ -/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 deleted file mode 100644 index 7707395..0000000 --- a/home/.config/systemd/user/systemd-lock-handler-swaylock.service +++ /dev/null @@ -1,19 +0,0 @@ -[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 e7b42ca..fe07af1 100644 --- a/home/.config/systemd/user/wayland-session.target +++ b/home/.config/systemd/user/wayland-session.target @@ -3,4 +3,3 @@ 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 diff --git a/home/.config/systemd/user/wayland-session.target.wants/hypridle.service b/home/.config/systemd/user/wayland-session.target.wants/hypridle.service new file mode 120000 index 0000000..0646888 --- /dev/null +++ b/home/.config/systemd/user/wayland-session.target.wants/hypridle.service @@ -0,0 +1 @@ +/home/itsdrike/.config/systemd/user/hypridle.service \ No newline at end of file diff --git a/home/.config/systemd/user/wayland-session.target.wants/swayidle.service b/home/.config/systemd/user/wayland-session.target.wants/swayidle.service deleted file mode 120000 index ae3a698..0000000 --- a/home/.config/systemd/user/wayland-session.target.wants/swayidle.service +++ /dev/null @@ -1 +0,0 @@ -/home/itsdrike/.config/systemd/user/swayidle.service \ No newline at end of file diff --git a/install_gui.sh b/install_gui.sh index 0144e6f..1db2997 100755 --- a/install_gui.sh +++ b/install_gui.sh @@ -81,7 +81,7 @@ yay -S --noconfirm --needed \ # Wayland Utilities yay -S --noconfirm --needed \ - grim slurp wofi swappy-git swayidle swaybg wf-recorder wlogout hyprpicker-git clipman + grim slurp wofi swappy-git swaybg wf-recorder wlogout hyprpicker-git clipman # Applications yay -S --noconfirm --needed \ @@ -129,11 +129,7 @@ sudo ln -s /usr/local/src/eww/target/release/eww /usr/local/bin popd # Lockscreen -yay -S --noconfirm --needed swaylock-effects-git systemd-lock-handler -systemctl --user enable systemd-lock-handler.service -# You'll need the systemd-lock-handler-swaylock.service from my dotfiles (in home/.config/systemd/user) -# this is copied above by default, but if you're editing the script, be aware of it -systemctl enable --user systemd-lock-handler-swaylock.service +yay -S --noconfirm --needed swaylock-effects-git hypridle-git # To test the lockscreen, you can run loginctl lock-session, while in a graphical session # Generate db for -git packages diff --git a/root/etc/systemd/sleep.conf b/root/etc/systemd/sleep.conf new file mode 100644 index 0000000..08470f6 --- /dev/null +++ b/root/etc/systemd/sleep.conf @@ -0,0 +1,27 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file (or a copy of it placed in +# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in +# the /etc/systemd/sleep.conf.d/ directory. The latter is generally +# recommended. Defaults can be restored by simply deleting the main +# configuration file and all drop-ins located in /etc/. +# +# Use 'systemd-analyze cat-config systemd/sleep.conf' to display the full config. +# +# See systemd-sleep.conf(5) for details. + +[Sleep] +#AllowSuspend=yes +#AllowHibernation=yes +#AllowSuspendThenHibernate=yes +#AllowHybridSleep=yes +#SuspendState=mem standby freeze +#HibernateMode=platform shutdown +HibernateDelaySec=10800 +#SuspendEstimationSec=60min