Replace Sway lock/idle by Hypr lock/idle & use loginctl for lock.
This commit is contained in:
parent
b8206869a7
commit
44fcdd5663
7 changed files with 75 additions and 89 deletions
17
.config/hypr/hypridle.conf
Normal file
17
.config/hypr/hypridle.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
general {
|
||||
lock_cmd = hyprlock
|
||||
before_sleep_cmd = hyprlock
|
||||
}
|
||||
|
||||
# Lock after 5min
|
||||
listener {
|
||||
timeout = 300
|
||||
on-timeout = hyprlock
|
||||
}
|
||||
|
||||
# Turn of screen after 6min
|
||||
listener {
|
||||
timeout = 360
|
||||
on-timeout = hyprctl dispatch dpms off
|
||||
on-resume = hyprctl dispatch dpms on
|
||||
}
|
|
@ -5,7 +5,7 @@ bind = $mainMod_SHIFT, E, exec, wlogout -b 4 -T 400 -B 400 -p layer-shell
|
|||
binde = $mainMod_SHIFT, Space, togglefloating,
|
||||
binde = $mainMod, P, pseudo,
|
||||
binde = $mainMod_SHIFT, V, togglesplit,
|
||||
bind = $mainMod, L, exec, $HOME/.scripts/swaylock.sh
|
||||
bind = $mainMod, L, exec, loginctl lock-session
|
||||
bind = $mainMod, F, fullscreen
|
||||
|
||||
bind = $mainMod_SHIFT, N, exec, $HOME/.scripts/waybar-dnd-toggle.sh; pkill -SIGRTMIN+2 waybar
|
||||
|
|
|
@ -12,6 +12,9 @@ exec-once = element-desktop --hidden
|
|||
# Gnome keyring (for Mailspring)
|
||||
exec-once = gnome-keyring
|
||||
|
||||
# Hypridle
|
||||
exec-once = hypridle
|
||||
|
||||
# Mailspring
|
||||
exec-once = mailspring --background --password-store="gnome-libsecret"
|
||||
|
||||
|
@ -24,9 +27,6 @@ exec-once = artix-pipewire-launcher restart
|
|||
# Polkit
|
||||
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
|
||||
# Swayidle
|
||||
exec-once = $HOME/.scripts/swayidle.sh
|
||||
|
||||
# Swayosd
|
||||
exec-once = swayosd-server
|
||||
|
||||
|
|
51
.config/hypr/hyprlock.conf
Normal file
51
.config/hypr/hyprlock.conf
Normal file
|
@ -0,0 +1,51 @@
|
|||
source = hyprland.d/colors.conf
|
||||
|
||||
background {
|
||||
monitor =
|
||||
path = screenshot
|
||||
|
||||
blur_passes = 1
|
||||
blur_size = 2
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 300, 42
|
||||
outline_thickness = $border_size
|
||||
dots_center = false
|
||||
outer_color = $accent1
|
||||
inner_color = $background1
|
||||
font_color = $foreground
|
||||
fade_on_empty = false
|
||||
placeholder_text =
|
||||
hide_input = false
|
||||
rounding = -1
|
||||
|
||||
position = 0, -50
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:0] echo "<span>$(date '+%A%e %b %Y')</span>"
|
||||
color = $foreground
|
||||
font_size = 25
|
||||
font_family = $font
|
||||
|
||||
position = 0, 50
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<span>$(date '+%H:%M:%S')</span>"
|
||||
color = $foreground
|
||||
font_size = 25
|
||||
font_family = $font
|
||||
|
||||
position = 0, 0
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"label" : "lock",
|
||||
"action" : "~/.config/hypr/swaylock",
|
||||
"action" : "loginctl lock-session",
|
||||
"text" : "Lock",
|
||||
"keybind" : "l"
|
||||
}
|
||||
|
@ -12,13 +12,13 @@
|
|||
}
|
||||
{
|
||||
"label" : "shutdown",
|
||||
"action" : "sudo poweroff",
|
||||
"action" : "loginctl poweroff",
|
||||
"text" : "Shutdown",
|
||||
"keybind" : "s"
|
||||
}
|
||||
{
|
||||
"label" : "reboot",
|
||||
"action" : "sudo reboot",
|
||||
"action" : "loginctl reboot",
|
||||
"text" : "Reboot",
|
||||
"keybind" : "r"
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Edit /etc/elogind/logind.conf and change these lines:
|
||||
# HandleLidSwitch=suspend -> HandleLidSwitch=lock
|
||||
# HandleLidSwitchExternalPower=suspend -> HandleLidSwitchExternalPower=lock
|
||||
|
||||
swayidle -w \
|
||||
timeout 300 "$HOME/.scripts/swaylock.sh" \
|
||||
timeout 360 'hyprctl dispatch dpms off' \
|
||||
resume 'hyprctl dispatch dpms on' \
|
||||
before-sleep "$HOME/.scripts/swaylock.sh" \
|
||||
lock "$HOME/.scripts/swaylock.sh"
|
|
@ -1,70 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
source "$HOME/.cache/colors.sh"
|
||||
|
||||
options=(
|
||||
--daemonize
|
||||
--font Hack
|
||||
--indicator-caps-lock
|
||||
--indicator-radius 100
|
||||
--indicator-thickness 7
|
||||
--text-color "$foreground"
|
||||
--text-caps-lock-color "$foreground"
|
||||
--text-ver-color "$foreground"
|
||||
--text-wrong-color "$foreground"
|
||||
--text-clear-color "$disabled"
|
||||
--ring-color "$accent1"
|
||||
--ring-caps-lock-color "$accent2"
|
||||
--ring-ver-color "$good"
|
||||
--ring-wrong-color "$bad"
|
||||
--ring-clear-color "$disabled"
|
||||
--key-hl-color "$foreground"
|
||||
--bs-hl-color "$disabled"
|
||||
--caps-lock-key-hl-color "$foreground"
|
||||
--caps-lock-bs-hl-color "$disabled2"
|
||||
--separator-color 00000000
|
||||
--line-color 00000000
|
||||
--line-caps-lock-color 00000000
|
||||
--line-ver-color 00000000
|
||||
--line-wrong-color 00000000
|
||||
--line-clear-color 00000000
|
||||
--inside-color 00000000
|
||||
--inside-caps-lock-color 00000000
|
||||
--inside-ver-color 00000000
|
||||
--inside-wrong-color 00000000
|
||||
--inside-clear-color 00000000
|
||||
--separator-color 00000000
|
||||
)
|
||||
|
||||
if swaylock --help 2>&1 | grep -qe '--screenshots'; then
|
||||
options+=(
|
||||
--disable-caps-lock-text
|
||||
--indicator
|
||||
--clock
|
||||
--screenshots
|
||||
--effect-blur 7x5
|
||||
--effect-vignette 0.5:0.5
|
||||
--grace 0
|
||||
--fade-in 0.2
|
||||
)
|
||||
else
|
||||
options+=(
|
||||
--show-failed-attempts
|
||||
--indicator-idle-visible
|
||||
)
|
||||
if grep -q 1 "$HOME/.cache/weeb-mode"; then
|
||||
options+=(--image "$HOME/.cache/wallpaper-blurred.jpg")
|
||||
else
|
||||
options+=(--image "$HOME/.cache/wallpaper-hypr-blurred.jpg")
|
||||
fi
|
||||
fi
|
||||
|
||||
if swaylock -v | grep -q fprintd; then
|
||||
options+=(
|
||||
--fingerprint
|
||||
)
|
||||
fi
|
||||
|
||||
swaylock "${options[@]}"
|
||||
|
||||
$HOME/.scripts/set-wallpaper.sh -r
|
Loading…
Reference in a new issue