From 118cd7f67638d7ed70dac0788d58e0b0b3d25e5d Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 10 Mar 2024 04:38:53 +0100 Subject: [PATCH] Migrate swaylock to hyprlock --- home/.config/hypr/hyprlock.conf | 159 ++++++++++++++++++ home/.config/swaylock/config | 31 ---- .../systemd-lock-handler-hyprlock.service | 15 ++ .../systemd-lock-handler-swaylock.service | 19 --- install_gui.sh | 3 +- 5 files changed, 175 insertions(+), 52 deletions(-) create mode 100644 home/.config/hypr/hyprlock.conf delete mode 100644 home/.config/swaylock/config create mode 100644 home/.config/systemd/user/systemd-lock-handler-hyprlock.service delete mode 100644 home/.config/systemd/user/systemd-lock-handler-swaylock.service diff --git a/home/.config/hypr/hyprlock.conf b/home/.config/hypr/hyprlock.conf new file mode 100644 index 0000000..3c509bf --- /dev/null +++ b/home/.config/hypr/hyprlock.conf @@ -0,0 +1,159 @@ +# ###################### +# ### GENERAL CONFIG ### +# ###################### + +general { + disable_loading_bar = false + hide_cursor = true + grace = 3 +} + +background { + path = ~/Pictures/Wallpapers/Categories/Extra/origami.png + blur_passes = 3 + blur_size = 6 + contrast = 0.7 + brightness = 0.7 +} + +# ####################### +# ### PASSWORD CIRCLE ### +# ####################### + +# Use a swaylock-like circle, lighting up random segments as you type +input-field { + size = 300, 250 + outline_thickness = 30 + outer_color = rgba(129, 162, 190, 85) + inner_color = rgb(29, 31, 33) + font_color = rgb(100, 100, 100) + + hide_input = true + fade_on_empty = false + placeholder_text = # Leave the text empty + + position = 0, 0 + halign = center + valign = center +} + +# Show time (inside of the circle) +label { + text = cmd[update:200] date +'%H:%M:%S' + color = rgba(129, 162, 190, 1.0) + font_size = 35 + font_family = Noto Sans + + position = 0, 0 + halign = center + valign = center +} + +# Show date (inside of the circle, below time) +label { + text = cmd[update:1000] date +'%a, %x' + color = rgba(129, 162, 190, 1.0) + font_size = 20 + font_family = Noto Sans + + position = 0, -50 + halign = center + valign = center +} + +# Keyboard layout +label { + text = cmd[update:200] hyprctl devices -j | jq -r '.keyboards[] | select(.name == "at-translated-set-2-keyboard") | .active_keymap' + color = rgba(129, 162, 190, 1.0) + font_size = 10 + font_family = Noto Sans + + position = 0, -90 + halign = center + valign = center +} + +# #################### +# ### OTHER LABELS ### +# #################### + +# Splash text +label { + text = Session Locked + #color = rgba(129, 162, 190, 1.0) + color = rgba(255, 255, 255, 1.0) + font_size = 40 + font_family = GohuFont uni11 Nerd Font + #font_family = ProFont IIX Nerd Font + + shadow_passes = 1 + shadow_size = 5 + shadow_boost = 1.8 + + position = 0, 220 + halign = center + valign = center +} + +# Device uptime +label { + text = cmd[update:1000] echo " $(uptime -p | sed -e 's/^up //' -e 's/ years\?,\?/y/' -e 's/ months\?,\?/m/' -e 's/ weeks\?,\?/w/' -e 's/ days\?,\?/d/' -e 's/ hours\?,\?/h/' -e 's/ minutes\?.\?/m/' -e 's/ seconds\?,\?/s/' | cut -d' ' -f-2)" + color = rgba(129, 162, 190, 1.0) + font_size = 11 + font_family = Noto Sans + + position = -80, -20 + halign = right + valign = top +} + +# Battery percentage +label { + text = cmd[update:1000] echo " $(cat /sys/class/power_supply/BAT0/capacity)%" + color = rgba(129, 162, 190, 1.0) + font_size = 11 + font_family = Noto Sans + + shadow_passes = 1 + shadow_size = 5 + shadow_boost = 1.8 + + position = -20, -20 + halign = right + valign = top +} + +# User account +label { + text = cmd[update:10000000] echo " $USER" + color = rgba(129, 162, 190, 1.0) + font_size = 11 + font_family = Noto Sans + + shadow_passes = 1 + shadow_size = 5 + shadow_boost = 1.8 + + position = 20, -20 + halign = left + valign = top +} + +# Recovery email (lost device) +label { + text = recovery@itsdrike.com + #color = rgba(0, 0, 0, 1.0) + color = rgba(129, 162, 190, 1.0) + font_size = 11 + font_family = Noto Sans + + shadow_passes = 1 + shadow_size = 5 + shadow_boost = 1.8 + + position = 20, 12 + halign = left + valign = bottom +} + +# vi: ft=hyprlang diff --git a/home/.config/swaylock/config b/home/.config/swaylock/config deleted file mode 100644 index 1f68e36..0000000 --- a/home/.config/swaylock/config +++ /dev/null @@ -1,31 +0,0 @@ -ignore-empty-password -clock - -color=1d1f21 -indicator-idle-visible -indicator-radius=150 -indicator-thickness=30 - -inside-color=1d1f21 -inside-clear-color=1d1f21 -inside-ver-color=1d1f21 -inside-wrong-color=1d1f21 - -key-hl-color=7aa6daaa -bs-hl-color=d54e53aa - -separator-color=55555555 - -line-color=1d1f21 -line-uses-ring - -text-color=81a2be -text-clear-color=b5bd68 -text-caps-lock-color=f0c674 -text-ver-color=81a2be -text-wrong-color=cc6666 - -ring-color=81a2be55 -ring-ver-color=81a2be -ring-clear-color=b5bd6811 -ring-wrong-color=cc6666 diff --git a/home/.config/systemd/user/systemd-lock-handler-hyprlock.service b/home/.config/systemd/user/systemd-lock-handler-hyprlock.service new file mode 100644 index 0000000..9cf81e7 --- /dev/null +++ b/home/.config/systemd/user/systemd-lock-handler-hyprlock.service @@ -0,0 +1,15 @@ +[Unit] +Description=Run hyprlock 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] +ExecStart=/usr/bin/stdbuf -oL /usr/bin/hyprlock +Restart=on-failure + +[Install] +WantedBy=lock.target 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/install_gui.sh b/install_gui.sh index d088357..b14209d 100755 --- a/install_gui.sh +++ b/install_gui.sh @@ -46,7 +46,6 @@ cp -ra home/.config/eww ~/.config cp home/.config/chromium-flags.conf ~/.config cp -ra home/.config/swappy ~/.config cp -ra home/.config/swayidle ~/.config -cp -ra home/.config/swaylock ~/.config cp -ra home/.config/wofi ~/.config # Sync mirrors and update before other installations @@ -124,7 +123,7 @@ sudo ln -s /usr/local/src/eww/target/release/eww /usr/local/bin popd # Lockscreen -yay -S --noconfirm --needed swaylock-effects-git hypridle-git systemd-lock-handler +yay -S --noconfirm --needed hyprlock-git hypridle-git systemd-lock-handler # To test the lockscreen, you can run loginctl lock-session, while in a graphical session # Generate db for -git packages