hypr: use shell for lock screen
This commit is contained in:
parent
d297795a8f
commit
f291845c44
15 changed files with 5 additions and 451 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,6 +1,5 @@
|
|||
/hypr/hyprland/overrides.conf
|
||||
/hypr/scheme/current.conf
|
||||
/hypr/hyprlock.conf
|
||||
|
||||
/spicetify/config-xpui.ini
|
||||
/spicetify/Themes/caelestia/color.ini
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
general {
|
||||
lock_cmd = pidof hyprlock || hyprlock
|
||||
lock_cmd = caelestia shell lock lock
|
||||
before_sleep_cmd = loginctl lock-session
|
||||
after_sleep_cmd = hyprctl dispatch dpms on
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,15 +26,11 @@ exec-once = mpris-proxy
|
|||
# Resize and move picture in picture windows
|
||||
exec-once = caelestia pip -d
|
||||
|
||||
# Regenerate hyprlock config on monitor changes
|
||||
exec = ~/.config/hypr/scripts/gen-hyprlock.fish
|
||||
exec-once = ~/.config/hypr/scripts/monitor-hyprlock.fish
|
||||
|
||||
# Reload hyprland when config changes (to regenerate everything)
|
||||
exec-once = ~/.config/hypr/scripts/monitor-config.fish
|
||||
|
||||
# Start shell
|
||||
exec-once = caelestia shell
|
||||
exec-once = caelestia shell -d
|
||||
|
||||
# Idle daemon
|
||||
exec-once = hypridle
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ bind = Ctrl+Alt, Delete, global, caelestia:session
|
|||
bind = Ctrl+Alt, C, global, caelestia:clearNotifs
|
||||
bind = Super, K, global, caelestia:showall
|
||||
|
||||
bind = Super, L, global, caelestia:lock
|
||||
|
||||
bindl = , XF86MonBrightnessUp, global, caelestia:brightnessUp
|
||||
bindl = , XF86MonBrightnessDown, global, caelestia:brightnessDown
|
||||
|
||||
|
|
@ -163,8 +165,7 @@ bindl = Super+Shift, M, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
|||
bindle = , XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 10%+
|
||||
bindle = , XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-
|
||||
|
||||
# Lock and sleep
|
||||
bind = Super, L, exec, loginctl lock-session
|
||||
# Sleep
|
||||
bind = Super+Shift, L, exec, systemctl suspend-then-hibernate
|
||||
|
||||
# Clipboard and emoji picker
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
for battery in /sys/class/power_supply/*BAT*
|
||||
if test -f "$battery/uevent"
|
||||
set has_battery
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if set -q has_battery
|
||||
if test "$(cat /sys/class/power_supply/*/status | head -1)" = "Charging"
|
||||
echo -n "(+) "
|
||||
end
|
||||
echo "$(cat /sys/class/power_supply/*/capacity | head -1)% remaining"
|
||||
else
|
||||
exit 1
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
set -l src (dirname (status filename))
|
||||
|
||||
set -q XDG_CONFIG_HOME && set -l config $XDG_CONFIG_HOME/caelestia || set -l config $HOME/.config/caelestia
|
||||
|
||||
cp $src/templates/hyprlock/base.conf $src/../hyprlock.conf
|
||||
|
||||
test -f $config/hypr.json && set -l style (jq -r '.hyprlock.style' $config/hypr.json)
|
||||
test -f "$src/templates/hyprlock/$style/main.conf" || set -l style round
|
||||
|
||||
cat $src/templates/hyprlock/$style/main.conf >> $src/../hyprlock.conf
|
||||
|
||||
if test -f $src/templates/hyprlock/$style/per-monitor.conf
|
||||
for monitor in (hyprctl monitors -j | jq -r '.[] | "\(.name) \(.width) \(.height)"')
|
||||
set -l monitor (string split ' ' $monitor)
|
||||
set -l name $monitor[1]
|
||||
set -l width $monitor[2]
|
||||
set -l height $monitor[3]
|
||||
|
||||
set -l tmp (mktemp)
|
||||
cp $src/templates/hyprlock/$style/per-monitor.conf $tmp
|
||||
sed -n 's/.*{{ \(.*\) }}.*/\1/p' $src/templates/hyprlock/$style/per-monitor.conf | while read expr
|
||||
sed -i "s|{{ $expr }}|$(echo "echo $expr" | .)|g" $tmp
|
||||
end
|
||||
cat $tmp >> $src/../hyprlock.conf
|
||||
end
|
||||
end
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
set -l src (dirname (status filename))
|
||||
|
||||
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read line
|
||||
switch $line
|
||||
case 'monitor*'
|
||||
$src/gen-hyprlock.fish
|
||||
end
|
||||
end
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
source = ~/.config/hypr/scheme/current.conf
|
||||
|
||||
$scripts = ~/.config/hypr/scripts
|
||||
$media_cmd = caelestia shell mpris getActive
|
||||
|
||||
animation {
|
||||
bezier = linear, 1, 1, 0, 0
|
||||
animation = fadeIn, 1, 5, linear
|
||||
animation = fadeOut, 1, 3, linear
|
||||
animation = inputField, 1, 2, linear
|
||||
animation = inputFieldColors, 1, 3, linear
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
$font_family_clock = Speculum
|
||||
$font_family_extras = Departure Mono
|
||||
|
||||
$cpu_temps = cat /sys/class/thermal/thermal_zone*/temp
|
||||
$get_cpu_temp = fish -c 'math -s 1 \( ($cpu_temps | string join +) \) / ($cpu_temps | wc -l) / 1000'
|
||||
$get_cpu_load = top -bn1 | grep 'Cpu(s)' | sed 's/.*, *\([0-9.]*\)%* id.*/\1/' | awk '{print 100 - $1}'
|
||||
|
||||
$has_media = playerctl status &> /dev/null
|
||||
$print_media = printf '%s: %s\nBy: %s' "$(test "$($media_cmd isPlaying)" = true && echo 'Playing' || echo 'Paused')" "$($media_cmd trackTitle)" "$($media_cmd trackArtist)"
|
||||
$get_media = $has_media && $print_media || printf 'No media playing\nTry playing something!'
|
||||
|
||||
background {
|
||||
color = rgb($crust)
|
||||
path = $HOME/.local/state/caelestia/wallpaper/current
|
||||
blur_passes = 3
|
||||
blur_size = 3
|
||||
noise = 0.05
|
||||
contrast = 1
|
||||
brightness = 0.8
|
||||
vibrancy = 0.2
|
||||
vibrancy_darkness = 0.2
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 320, 60
|
||||
outline_thickness = 0
|
||||
dots_size = 0.225
|
||||
dots_spacing = 0.5
|
||||
dots_text_format = *
|
||||
inner_color = rgba($tertiary45)
|
||||
font_color = rgb($text)
|
||||
check_color = rgb($sky)
|
||||
fail_color = rgb($error)
|
||||
fade_on_empty = false
|
||||
placeholder_text =
|
||||
fail_text = !!!
|
||||
swap_font_color = true
|
||||
rounding = 0
|
||||
font_family = JetBrains Mono NF Bold
|
||||
font_size = 30
|
||||
|
||||
position = 0, -120
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Clock
|
||||
monitor =
|
||||
text = cmd[update:1000] date +'%H//%M//%S'
|
||||
color = rgb($primary)
|
||||
font_size = 110
|
||||
font_family = $font_family_clock
|
||||
|
||||
shadow_passes = 2
|
||||
shadow_size = 2
|
||||
shadow_color = rgb(a0a0a0)
|
||||
|
||||
position = 0, 70
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Date
|
||||
monitor =
|
||||
text = cmd[update:5000] date +'%D'
|
||||
color = rgba($secondarybf)
|
||||
font_size = 60
|
||||
font_family = $font_family_clock
|
||||
|
||||
shadow_passes = 2
|
||||
shadow_size = 2
|
||||
shadow_color = rgb(a0a0a0)
|
||||
|
||||
position = 355, -35
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
# MONITOR {{ $name }}
|
||||
label { # CPU info
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:5000] printf '%s°C :CPU Temp\n%s%% :CPU Load' "$($get_cpu_temp)" "$($get_cpu_load)"
|
||||
color = rgb($tertiary)
|
||||
font_size = 14
|
||||
font_family = $font_family_extras
|
||||
text_align = right
|
||||
|
||||
shadow_passes = 2
|
||||
shadow_size = 2
|
||||
shadow_color = rgb(a0a0a0)
|
||||
|
||||
position = -{{ (math $width / 2 + 175) }}, -120
|
||||
halign = right
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Media playing
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:1000] $get_media
|
||||
color = rgb($tertiary)
|
||||
font_size = 14
|
||||
font_family = $font_family_extras
|
||||
text_align = left
|
||||
|
||||
shadow_passes = 2
|
||||
shadow_size = 2
|
||||
shadow_color = rgb(a0a0a0)
|
||||
|
||||
position = {{ (math $width / 2 + 175) }}, -120
|
||||
halign = left
|
||||
valign = center
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
$font_family = JetBrainsMonoNF
|
||||
$truncate_cmd = playerctl status &> /dev/null && $scripts/truncate.fish $font_family
|
||||
|
||||
background {
|
||||
color = rgb($crust)
|
||||
path = $HOME/.local/state/caelestia/wallpaper/current
|
||||
blur_passes = 3
|
||||
blur_size = 2
|
||||
noise = 0.0117
|
||||
contrast = 0.8916
|
||||
brightness = 0.8172
|
||||
vibrancy = 0.1696
|
||||
vibrancy_darkness = 0.0
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 320, 60
|
||||
outline_thickness = 0
|
||||
dots_size = 0.225
|
||||
dots_spacing = 0.2
|
||||
inner_color = rgba($base66)
|
||||
font_color = rgb($text)
|
||||
check_color = rgb($sky)
|
||||
fail_color = rgb($error)
|
||||
fade_on_empty = false
|
||||
placeholder_text = <i> Logged in as </i><span foreground="##$primary">$USER</span>
|
||||
fail_text = <i>$FAIL ($ATTEMPTS)</i>
|
||||
swap_font_color = true
|
||||
|
||||
position = 0, 300
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
shape { # Player background
|
||||
monitor =
|
||||
size = 400, 110
|
||||
color = rgba($base66)
|
||||
rounding = 20
|
||||
|
||||
position = 0, 100
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
shape { # Player fallback cover art
|
||||
monitor =
|
||||
size = 90, 90
|
||||
color = rgba($surface266)
|
||||
rounding = 5
|
||||
|
||||
position = -140, 110
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Player fallback cover art icon
|
||||
monitor =
|
||||
text =
|
||||
color = rgb($subtext0)
|
||||
font_size = 40
|
||||
font_family = $font_family
|
||||
|
||||
position = -135, 120
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
image { # Player cover art
|
||||
monitor =
|
||||
size = 84
|
||||
border_size = 3
|
||||
border_color = rgb($text)
|
||||
rounding = 5
|
||||
reload_time = 1
|
||||
reload_cmd = $media_cmd trackArtUrl
|
||||
|
||||
position = -140, 110
|
||||
halign = center
|
||||
valign = bottom
|
||||
zindex = 1
|
||||
}
|
||||
|
||||
label { # Clock
|
||||
monitor =
|
||||
text = $TIME
|
||||
color = rgb($primary)
|
||||
font_size = 200
|
||||
font_family = $font_family ExtraBold
|
||||
|
||||
position = 0, 300
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Date
|
||||
monitor =
|
||||
text = cmd[update:5000] date +'%B %d %Y'
|
||||
color = rgb($secondary)
|
||||
font_size = 40
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = 0, 50
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Day
|
||||
monitor =
|
||||
text = cmd[update:5000] date +'%A'
|
||||
color = rgb($secondary)
|
||||
font_size = 40
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = 500, 180
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label { # Uptime
|
||||
monitor =
|
||||
text = cmd[update:60000] uptime -p
|
||||
color = rgb($primary)
|
||||
font_size = 20
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = -20, 20
|
||||
halign = right
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Battery
|
||||
monitor =
|
||||
text = cmd[update:5000] $scripts/battery.fish
|
||||
color = rgb($primary)
|
||||
font_size = 20
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = 20, 20
|
||||
halign = left
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Weather if no battery
|
||||
monitor =
|
||||
text = cmd[update:90000] $scripts/battery.fish > /dev/null || $scripts/weather.fish
|
||||
color = rgb($primary)
|
||||
font_size = 20
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = 20, 20
|
||||
halign = left
|
||||
valign = bottom
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
# MONITOR {{ $name }}
|
||||
label { # Player identity
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:1000] $truncate_cmd 12 150 "$($media_cmd identity)"
|
||||
color = rgb($subtext0)
|
||||
font_size = 12
|
||||
font_family = $font_family
|
||||
|
||||
position = {{ (math $width / 2 - 80) }}, 170
|
||||
halign = left
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Player track title
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:1000] $truncate_cmd-Bold 14 150 "$($media_cmd trackTitle)" || echo 'No media playing'
|
||||
color = rgb($text)
|
||||
font_size = 14
|
||||
font_family = $font_family Bold
|
||||
|
||||
position = {{ (math $width / 2 - 80) }}, 142
|
||||
halign = left
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Player track artist
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:1000] $truncate_cmd 12 100 "$($media_cmd trackArtist)"
|
||||
color = rgb($text)
|
||||
font_size = 12
|
||||
font_family = $font_family
|
||||
|
||||
position = {{ (math $width / 2 - 80) }}, 120
|
||||
halign = left
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
label { # Player track time
|
||||
monitor = {{ $name }}
|
||||
text = cmd[update:1000] $scripts/track-time.fish
|
||||
color = rgb($subtext0)
|
||||
font_size = 12
|
||||
font_family = $font_family
|
||||
|
||||
position = {{ (math 180 - $width / 2) }}, 110
|
||||
halign = right
|
||||
valign = bottom
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
function fmt-time -a secs
|
||||
printf "%d:%02d" (math -s 0 $secs / 60 % 60) (math -s 0 $secs % 60)
|
||||
end
|
||||
|
||||
set -l position (caelestia shell mpris getActive position)
|
||||
set -l length (caelestia shell mpris getActive length)
|
||||
|
||||
test $position != 'No media' -a $position != 'No active player' && echo "$(fmt-time $position)/$(fmt-time $length)"
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
function get-width -a font size string
|
||||
magick -font $font -font Noto-Sans-CJK-JP -font Noto-Sans-CJK-SC -font Noto-Sans-CJK-TC -font Noto-Sans-CJK-KR -font Noto-Sans-CJK-HK -font Noto-Sans-CJK-TC \
|
||||
-pointsize $size label:$string -format '%w' info:
|
||||
end
|
||||
|
||||
set -l font $argv[1]
|
||||
set -l size $argv[2]
|
||||
set -l max_width $argv[3]
|
||||
set -l string $argv[4]
|
||||
set -l dot_width (get-width $font $size '...')
|
||||
|
||||
if test (get-width $font $size $string) -gt $max_width
|
||||
# Cut in half until less than max width
|
||||
set -l st 0
|
||||
set -l ed (string length $string)
|
||||
while ! set -q done
|
||||
set -l idx (math -s 0 $st + \( $ed - $st \) / 2)
|
||||
set -l width (math (get-width $font $size (string sub -e $idx $string)) + $dot_width)
|
||||
if test $width -gt $max_width
|
||||
set ed $idx
|
||||
else
|
||||
if test (math abs $st - $ed) -le 1
|
||||
set done
|
||||
set string (string sub -e $idx $string)
|
||||
else
|
||||
set st $idx
|
||||
end
|
||||
end
|
||||
end
|
||||
echo "$(string trim -r $string)..."
|
||||
else
|
||||
echo $string
|
||||
end
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/fish
|
||||
|
||||
set -q XDG_CACHE_HOME && set -l cache $XDG_CACHE_HOME || set -l cache $HOME/.cache
|
||||
set -l cache $cache/caelestia/weather.json
|
||||
|
||||
if test -f $cache
|
||||
jq -r '.current | "\(.condition.text) • \(.temp_c)°C | UV \(.uv) • \(.wind_kph) kph"' $cache
|
||||
exit
|
||||
end
|
||||
|
||||
set -l format '\(.weatherDesc[0].value) • \(.temp_C)°C | UV \(.uvIndex) • \(.windspeedKmph) kph'
|
||||
set -l city (curl ipinfo.io | jq -r '.city')
|
||||
curl "wttr.in/$city?format=j1" | jq -er '.current_condition[0] | "'$format'"'
|
||||
Loading…
Add table
Add a link
Reference in a new issue