Make hyprlock default and add battery level
This commit is contained in:
@ -7,6 +7,7 @@ background {
|
|||||||
monitor =
|
monitor =
|
||||||
|
|
||||||
{% if hostname == "sputnik" %}
|
{% if hostname == "sputnik" %}
|
||||||
|
# make background transparent, used in combination with screenlock-video
|
||||||
color = rgba(00000000)
|
color = rgba(00000000)
|
||||||
{% else %}
|
{% else %}
|
||||||
path = ~/.config/wallpapers/6000x3376/akira.jpg
|
path = ~/.config/wallpapers/6000x3376/akira.jpg
|
||||||
@ -49,6 +50,7 @@ input-field {
|
|||||||
shadow_boost = 1.2
|
shadow_boost = 1.2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ferris image in the center
|
||||||
image {
|
image {
|
||||||
monitor =
|
monitor =
|
||||||
path = ~/.config/wallpapers/ferris-stamp.png
|
path = ~/.config/wallpapers/ferris-stamp.png
|
||||||
@ -64,6 +66,7 @@ image {
|
|||||||
shadow_boost = 1.2
|
shadow_boost = 1.2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# clock
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = <b>$TIME</b>
|
text = <b>$TIME</b>
|
||||||
@ -82,16 +85,36 @@ label {
|
|||||||
shadow_boost = 1.3
|
shadow_boost = 1.3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# battery
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = <b>$LAYOUT</b>
|
text = cmd[update:5000] wmutils battery
|
||||||
|
text_align = left
|
||||||
|
color = rgba(200, 200, 200, 1.0)
|
||||||
|
font_size = 20
|
||||||
|
font_family = Noto Sans
|
||||||
|
rotate = 0 # degrees, counter-clockwise
|
||||||
|
|
||||||
|
position = 24, -20
|
||||||
|
halign = left
|
||||||
|
valign = top
|
||||||
|
|
||||||
|
shadow_passes = 2
|
||||||
|
shadow_size = 1
|
||||||
|
shadow_boost = 1.1
|
||||||
|
}
|
||||||
|
|
||||||
|
# keyboard layout
|
||||||
|
label {
|
||||||
|
monitor =
|
||||||
|
text = $LAYOUT
|
||||||
text_align = right
|
text_align = right
|
||||||
color = rgba(200, 200, 200, 1.0)
|
color = rgba(200, 200, 200, 1.0)
|
||||||
font_size = 20
|
font_size = 20
|
||||||
font_family = Noto Sans
|
font_family = Noto Sans
|
||||||
rotate = 0 # degrees, counter-clockwise
|
rotate = 0 # degrees, counter-clockwise
|
||||||
|
|
||||||
position = -12, -12
|
position = -24, -20
|
||||||
halign = right
|
halign = right
|
||||||
valign = top
|
valign = top
|
||||||
|
|
||||||
@ -100,6 +123,7 @@ label {
|
|||||||
shadow_boost = 1.1
|
shadow_boost = 1.1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# greeting text
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = GREET_ $user
|
text = GREET_ $user
|
||||||
@ -118,6 +142,7 @@ label {
|
|||||||
shadow_boost = 1.3
|
shadow_boost = 1.3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# number of login attempts
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = $ATTEMPTS[0]x $FAIL
|
text = $ATTEMPTS[0]x $FAIL
|
||||||
|
|||||||
@ -267,7 +267,7 @@ binds {
|
|||||||
|
|
||||||
Mod+Return { spawn "alacritty"; }
|
Mod+Return { spawn "alacritty"; }
|
||||||
Mod+D { spawn "fuzzel"; }
|
Mod+D { spawn "fuzzel"; }
|
||||||
Mod+Plus { spawn "/home/hulthe/.local/bin/screenlock"; }
|
Mod+Plus { spawn "loginctl lock-session"; }
|
||||||
|
|
||||||
// You can also use a shell:
|
// You can also use a shell:
|
||||||
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
{% if hostname == "sputnik" %}
|
{% if hostname == "sputnik" %}
|
||||||
lock '$HOME/.local/bin/screenlock-video'
|
lock '$HOME/.local/bin/screenlock-video'
|
||||||
{% elif hostname == "buran" %}
|
|
||||||
lock 'hyprlock'
|
|
||||||
{% else %}
|
{% else %}
|
||||||
lock '$HOME/.local/bin/screenlock'
|
lock '$HOME/.local/bin/screenlock'
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
#!/usr/bin/fish
|
#!/usr/bin/fish
|
||||||
|
|
||||||
# configured for wayland
|
# configured for wayland
|
||||||
set LOCKPROG swaylock
|
set LOCKPROG hyprlock
|
||||||
set OPTIONAL_CMDS rg sed grim lockscreen-blur jq
|
|
||||||
set CONFIG "$HOME/.config/sway/swaylock.config"
|
|
||||||
set DEFAULT_ARGS --daemonize --ignore-empty-password --show-failed-attempts --color 302f3b --config $CONFIG
|
|
||||||
set BLUR_FACTOR 40
|
|
||||||
|
|
||||||
# check if lock program is running
|
# check if lock program is running
|
||||||
if ps -e | grep " $LOCKPROG\$"
|
if ps -e | grep " $LOCKPROG\$"
|
||||||
@ -13,38 +9,4 @@ if ps -e | grep " $LOCKPROG\$"
|
|||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# check if we have programs required to take a screenshot and do cool stuff with it
|
$LOCKPROG $argv
|
||||||
for cmd in $OPTIONAL_CMDS
|
|
||||||
if not command -v $cmd &>/dev/null
|
|
||||||
echo "$cmd could not be found, falling back to basic mode."
|
|
||||||
$LOCKPROG $DEFAULT_ARGS
|
|
||||||
exit 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# get a list of outputs/monitors
|
|
||||||
switch $XDG_CURRENT_DESKTOP
|
|
||||||
case Hyprland
|
|
||||||
set outputs (hyprctl monitors | rg Monitor | sed 's/Monitor //' | sed 's/ (ID.*$//')
|
|
||||||
case sway
|
|
||||||
set outputs (swaymsg -t get_outputs -r | rg "name" | sed 's/^.*"name": "//' | sed 's/",$//')
|
|
||||||
case niri
|
|
||||||
set outputs (niri msg --json outputs | jq -r 'keys | join("\n")')
|
|
||||||
case '*'
|
|
||||||
echo "unsupported compositor, falling back to basic mode."
|
|
||||||
$LOCKPROG $DEFAULT_ARGS
|
|
||||||
exit 0
|
|
||||||
end
|
|
||||||
|
|
||||||
# take one screenshot of each output
|
|
||||||
for output in $outputs
|
|
||||||
set img "/tmp/lock-$output.png"
|
|
||||||
grim -o $output -t ppm - | lockscreen-blur -o $img -b $BLUR_FACTOR --stamp ~/.config/wallpapers/ferris-stamp.png &
|
|
||||||
set -a images --image
|
|
||||||
set -a images "$output:$img"
|
|
||||||
end
|
|
||||||
|
|
||||||
# wait for all screenshot jobs to complete
|
|
||||||
wait
|
|
||||||
|
|
||||||
$LOCKPROG $DEFAULT_ARGS $images
|
|
||||||
|
|||||||
Reference in New Issue
Block a user