Add hyprlock and hypridle

This commit is contained in:
Stephan Raabe
2024-02-23 13:47:01 +01:00
parent f6564b4b75
commit 42d3c5d8f9
12 changed files with 76 additions and 105 deletions

View File

@@ -14,8 +14,9 @@ exec-once = dunst
# Load GTK settings
exec-once = ~/dotfiles/hypr/scripts/gtk.sh
# Load swayidle and define the lock screen time
exec-once = ~/dotfiles/hypr/scripts/lockscreentime.sh
# Using hypridle to start hyprlock
exec-once = hypridle
# exec-once = swayidle -w timeout 600 'swaylock -f' timeout 660 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep 'swaylock -f'
# Load network manager applet
# START NM APPLET

13
hypr/hypridle.conf Normal file
View File

@@ -0,0 +1,13 @@
general {
lock_cmd = notify-send "lock!" # dbus/sysd lock command (loginctl lock-session)
unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = notify-send "Zzz" # command ran before sleep
after_sleep_cmd = notify-send "Awake!" # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 600 # in seconds
on-timeout = hyprlock # command to run when timeout has passed
# on-resume = notify-send "Welcome back to your desktop!" # command to run when activity is detected after timeout has fired.
}

44
hypr/hyprlock.conf Normal file
View File

@@ -0,0 +1,44 @@
background {
monitor =
path = $HOME/dotfiles/.settings/lockscreen.png # only png supported for now
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 4 # 0 disables blurring
blur_size = 2
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
input-field {
monitor =
size = 200, 50
outline_thickness = 1
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgb(000000)
inner_color = rgb(200, 200, 200)
font_color = rgb(10, 10, 10)
fade_on_empty = true
placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
hide_input = false
position = 0, -20
halign = center
valign = center
}
label {
monitor =
text = Enter your password to unlock
color = rgba(200, 200, 200, 1.0)
font_size = 25
font_family = Noto Sans
position = 0, 200
halign = center
valign = center
}

View File

@@ -1,21 +0,0 @@
#/bin/bash
# ___ _ _ _ _
# |_ _|__| | | ___| |_(_)_ __ ___ ___
# | |/ _` | |/ _ \ __| | '_ ` _ \ / _ \
# | | (_| | | __/ |_| | | | | | | __/
# |___\__,_|_|\___|\__|_|_| |_| |_|\___|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# START SWAYIDLE
# exit
# END SWAYIDLE
source ~/dotfiles/.settings/swayidle.sh
if [ -f "/usr/bin/swayidle" ]; then
echo "swayidle is installed."
swayidle -w timeout $timeswaylock 'swaylock -f' timeout $timeoff 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep 'swaylock -f'
else
echo "swayidle not installed."
fi;