feat: Update hypr config
This commit is contained in:
@@ -150,6 +150,7 @@ misc {
|
|||||||
disable_splash_rendering = 1
|
disable_splash_rendering = 1
|
||||||
disable_hyprland_logo = 1
|
disable_hyprland_logo = 1
|
||||||
focus_on_activate = 0 # This breaks vdesks
|
focus_on_activate = 0 # This breaks vdesks
|
||||||
|
anr_missed_pings = 10
|
||||||
}
|
}
|
||||||
ecosystem {
|
ecosystem {
|
||||||
no_donation_nag = 1
|
no_donation_nag = 1
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ label {
|
|||||||
# Day-Month-Date
|
# Day-Month-Date
|
||||||
label {
|
label {
|
||||||
monitor =
|
monitor =
|
||||||
text = cmd[update:1000] echo -e "$(date +"%d %B, %a.")"
|
text = cmd[update:1000] echo -e "$(date +"%d %B")"
|
||||||
color = rgba(255, 255, 255, 100)
|
color = rgba(255, 255, 255, 100)
|
||||||
font_size = 22
|
font_size = 22
|
||||||
font_family = Suisse Int'l Mono
|
font_family = Suisse Int'l Mono
|
||||||
@@ -104,16 +104,16 @@ input-field {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# CURRENT SONG
|
# CURRENT SONG
|
||||||
# label {
|
label {
|
||||||
# monitor = eDP-1
|
monitor = eDP-1
|
||||||
# text = cmd[update:1000] echo "$(~/.config/hypr/scripts/songdetail.sh)"
|
text = cmd[update:1000] echo "$(~/.config/hypr/scripts/songdetail.sh)"
|
||||||
# color = rgba(147, 196, 255, 1)
|
color = rgba(147, 196, 255, 1)
|
||||||
# font_size = 18
|
font_size = 18
|
||||||
# font_family = JetBrains Mono Nerd, SF Pro Display Bold
|
font_family = JetBrains Mono Nerd, SF Pro Display Bold
|
||||||
# position = 0, 20
|
position = 0, 20
|
||||||
# halign = center
|
halign = center
|
||||||
# valign = bottom
|
valign = bottom
|
||||||
# }
|
}
|
||||||
|
|
||||||
# Battery
|
# Battery
|
||||||
label {
|
label {
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ bindl=, XF86AudioNext, exec, playerctl next
|
|||||||
bindl=, XF86AudioPrev, exec, playerctl previous
|
bindl=, XF86AudioPrev, exec, playerctl previous
|
||||||
|
|
||||||
# Other FN keys
|
# Other FN keys
|
||||||
bindl= $mainMod CTRL, XF86TouchpadToggle, exec, hyprctl notify -1 2000 -1 "TODO Touchpad Toggle"
|
bind= $mainMod CTRL, XF86TouchpadToggle, exec, hyprctl notify -1 2000 -1 "TODO Touchpad Toggle"
|
||||||
bind = $mainMod, P, exec, hyprctl notify -1 2000 -1 "TODO Screen Settings"
|
bind = $mainMod, P, exec, hyprctl notify -1 2000 -1 "TODO Screen Settings"
|
||||||
bindl = , Print, exec, hyprshot -m output -m active
|
bindl = , Print, exec, hyprshot -m output -m active
|
||||||
bind = $mainMod, Print, exec, hyprshot -m window -m active
|
bind = $mainMod, Print, exec, hyprshot -m window -m active
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo "Preparing hyprlock configuration..."
|
||||||
# Path to hyprlock configuration file
|
# Path to hyprlock configuration file
|
||||||
CONF="$HOME/.config/hypr/hyprlock.conf"
|
CONF="$HOME/.config/hypr/hyprlock.conf"
|
||||||
|
|
||||||
# Get the list of outputs
|
# Get the list of outputs
|
||||||
mapfile -t outputs < <(hyprctl -j monitors | jq -r '.[].name')
|
mapfile -t outputs < <(hyprctl -j monitors | jq -r '.[].name')
|
||||||
|
|
||||||
@@ -25,44 +25,29 @@ awk -v content="$block" '
|
|||||||
{ print }
|
{ print }
|
||||||
' "$CONF" > "${CONF}.tmp" && mv "${CONF}.tmp" "$CONF"
|
' "$CONF" > "${CONF}.tmp" && mv "${CONF}.tmp" "$CONF"
|
||||||
|
|
||||||
|
echo "Starting hyprlock..."
|
||||||
/home/nathan/Git/hyprlock/build/hyprlock &
|
/home/nathan/Git/hyprlock/build/hyprlock &
|
||||||
|
|
||||||
|
echo "Taking screenshots for lock screen..."
|
||||||
# Take a screenshot of each output before locking (!THIS IS SLOW!)
|
# Take a screenshot of each output before locking (!THIS IS SLOW!)
|
||||||
for output in "${outputs[@]}"; do
|
for output in "${outputs[@]}"; do
|
||||||
# grim -o "$output" "/tmp/${output}-lockscreen.png" &
|
# grim -o "$output" "/tmp/${output}-lockscreen.png" &
|
||||||
$HOME/.config/hypr/scripts/spots.sh -s 8 <(grim -o "$output" -) "/tmp/${output}-lockscreen.png" &
|
$HOME/.config/hypr/scripts/spots.sh -s 8 <(grim -o "$output" -) "/tmp/${output}-lockscreen.png" &
|
||||||
done
|
done
|
||||||
|
|
||||||
while pgrep -x grim >/dev/null; do
|
echo "Waiting for screenshots to complete..."
|
||||||
sleep 0.1
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Start hyprlock while we process the images
|
|
||||||
|
|
||||||
|
|
||||||
# Apply image effect to each screenshot
|
|
||||||
# for output in "${outputs[@]}"; do
|
|
||||||
# # Apply blur effect using spots.sh
|
|
||||||
# /home/nathan/.config/hypr/scripts/spots.sh -s 8 "/tmp/${output}-lockscreen.png" "/tmp/${output}-lockscreen.png" &
|
|
||||||
# done
|
|
||||||
# Wait for all image processing to complete
|
# Wait for all image processing to complete
|
||||||
while pgrep -x spots.sh >/dev/null; do
|
while pgrep -x spots.sh >/dev/null; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Notify hyprlock to reload backgrounds
|
# Notify hyprlock to reload backgrounds
|
||||||
echo "Reloading hyprlock backgrounds..."
|
echo "Reloading hyprlock backgrounds..."
|
||||||
pkill -USR2 hyprlock
|
pkill -USR2 hyprlock
|
||||||
|
|
||||||
# Wait for hyprlock to exit
|
|
||||||
while pgrep -x hyprlock >/dev/null; do
|
|
||||||
echo "Waiting for hyprlock to exit..."
|
echo "Waiting for hyprlock to exit..."
|
||||||
sleep 1
|
wait
|
||||||
done
|
|
||||||
|
|
||||||
|
echo "Hyprlock exited. Cleaning up..."
|
||||||
# Cleanup: Restore hyprlock.conf to original state
|
# Cleanup: Restore hyprlock.conf to original state
|
||||||
sed -i '/^# AUTO BACKGROUND$/,/^# AUTO BACKGROUND END$/{//!d}' "$CONF"
|
sed -i '/^# AUTO BACKGROUND$/,/^# AUTO BACKGROUND END$/{//!d}' "$CONF"
|
||||||
|
|
||||||
|
|||||||
@@ -291,25 +291,25 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# test input image
|
# test input image
|
||||||
convert -quiet "$infile" $bricon -clamp +repage "$tmpA1" ||
|
magick -quiet "$infile" $bricon -clamp +repage "$tmpA1" ||
|
||||||
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
|
errMsg "--- FILE $infile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
|
||||||
|
|
||||||
# test spot file if exists
|
# test spot file if exists
|
||||||
if [ "$spotfile" != "" ]; then
|
if [ "$spotfile" != "" ]; then
|
||||||
convert -quiet "$spotfile" -alpha off +repage "$tmpA2" ||
|
magick -quiet "$spotfile" -alpha off +repage "$tmpA2" ||
|
||||||
errMsg "--- FILE $spotfile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
|
errMsg "--- FILE $spotfile DOES NOT EXIST OR IS NOT AN ORDINARY FILE, NOT READABLE OR HAS ZERO SIZE ---"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get image width, height and aspect
|
# get image width, height and aspect
|
||||||
ww=`convert $tmpA1 -ping -format "%w" info:`
|
ww=`magick $tmpA1 -ping -format "%w" info:`
|
||||||
hh=`convert $tmpA1 -ping -format "%h" info:`
|
hh=`magick $tmpA1 -ping -format "%h" info:`
|
||||||
|
|
||||||
# get size of spot and center of spot and last pixel of spot and pad size
|
# get size of spot and center of spot and last pixel of spot and pad size
|
||||||
if [ "$spotfile" = "" ]; then
|
if [ "$spotfile" = "" ]; then
|
||||||
sw=`echo $size | cut -dx -f1`
|
sw=`echo $size | cut -dx -f1`
|
||||||
sh=`echo $size | cut -dx -f2`
|
sh=`echo $size | cut -dx -f2`
|
||||||
scx=`convert xc: -format "%[fx:($sw-1)/2]" info:`
|
scx=`magick xc: -format "%[fx:($sw-1)/2]" info:`
|
||||||
scy=`convert xc: -format "%[fx:($sh-1)/2]" info:`
|
scy=`magick xc: -format "%[fx:($sh-1)/2]" info:`
|
||||||
lx=$((sw-1))
|
lx=$((sw-1))
|
||||||
ly=$((sh-1))
|
ly=$((sh-1))
|
||||||
|
|
||||||
@@ -318,8 +318,8 @@ if [ "$spotfile" = "" ]; then
|
|||||||
ph=$((sh+2*pad))
|
ph=$((sh+2*pad))
|
||||||
|
|
||||||
else
|
else
|
||||||
pw=`convert $tmpA2 -ping -format "%w" info:`
|
pw=`magick $tmpA2 -ping -format "%w" info:`
|
||||||
ph=`convert $tmpA2 -ping -format "%h" info:`
|
ph=`magick $tmpA2 -ping -format "%h" info:`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -332,19 +332,19 @@ if [ "$spotfile" = "" ]; then
|
|||||||
|
|
||||||
# create spot template
|
# create spot template
|
||||||
if [ "$type" = "circle" ]; then
|
if [ "$type" = "circle" ]; then
|
||||||
convert -size ${sw}x${sh} xc:black \
|
magick -size ${sw}x${sh} xc:black \
|
||||||
+antialias -fill white -draw "ellipse $scx,$scy $scx,$scy 0,360" -alpha off \
|
+antialias -fill white -draw "ellipse $scx,$scy $scx,$scy 0,360" -alpha off \
|
||||||
$padding \
|
$padding \
|
||||||
$tmpA2
|
$tmpA2
|
||||||
|
|
||||||
elif [ "$type" = "square" ]; then
|
elif [ "$type" = "square" ]; then
|
||||||
convert -size ${sw}x${sh} xc:black \
|
magick -size ${sw}x${sh} xc:black \
|
||||||
+antialias -fill white -draw "rectangle 0,0 $lx,$ly" -alpha off \
|
+antialias -fill white -draw "rectangle 0,0 $lx,$ly" -alpha off \
|
||||||
$padding \
|
$padding \
|
||||||
$tmpA2
|
$tmpA2
|
||||||
|
|
||||||
elif [ "$type" = "diamond" ]; then
|
elif [ "$type" = "diamond" ]; then
|
||||||
convert -size ${sw}x${sh} xc:black \
|
magick -size ${sw}x${sh} xc:black \
|
||||||
+antialias -fill white -draw "polygon $scx,0 $lx,$scy $scx,$ly 0,$scy" -alpha off \
|
+antialias -fill white -draw "polygon $scx,0 $lx,$scy $scx,$ly 0,$scy" -alpha off \
|
||||||
$padding \
|
$padding \
|
||||||
$tmpA2
|
$tmpA2
|
||||||
@@ -352,22 +352,22 @@ if [ "$spotfile" = "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# compute xmin and ymin and virtual canvas size
|
# compute xmin and ymin and virtual canvas size
|
||||||
xmin=`convert xc: -format "%[fx:ceil($ww/$pw)]" info:`
|
xmin=`magick xc: -format "%[fx:ceil($ww/$pw)]" info:`
|
||||||
ymin=`convert xc: -format "%[fx:ceil($hh/$ph)]" info:`
|
ymin=`magick xc: -format "%[fx:ceil($hh/$ph)]" info:`
|
||||||
www=`convert xc: -format "%[fx:$xmin*$pw]" info:`
|
www=`magick xc: -format "%[fx:$xmin*$pw]" info:`
|
||||||
hhh=`convert xc: -format "%[fx:$ymin*$ph]" info:`
|
hhh=`magick xc: -format "%[fx:$ymin*$ph]" info:`
|
||||||
|
|
||||||
|
|
||||||
# process image
|
# process image
|
||||||
if [ "$edge" = "0" ]; then
|
if [ "$edge" = "0" ]; then
|
||||||
convert \( $tmpA1 -define distort:viewport=${www}x${hhh}+0+0 -virtual-pixel mirror -distort SRT 0 \
|
magick \( $tmpA1 -define distort:viewport=${www}x${hhh}+0+0 -virtual-pixel mirror -distort SRT 0 \
|
||||||
-scale ${xmin}x${ymin}! -scale ${www}x${hhh}! -crop ${ww}x${hh}+0+0 +repage \) \
|
-scale ${xmin}x${ymin}! -scale ${www}x${hhh}! -crop ${ww}x${hh}+0+0 +repage \) \
|
||||||
\( $tmpA2 -write mpr:tile +delete -size ${ww}x${hh}! tile:mpr:tile \) \
|
\( $tmpA2 -write mpr:tile +delete -size ${ww}x${hh}! tile:mpr:tile \) \
|
||||||
-alpha off -compose copy_opacity -composite -compose over \
|
-alpha off -compose copy_opacity -composite -compose over \
|
||||||
-background $bgcolor -flatten \
|
-background $bgcolor -flatten \
|
||||||
"$outfile"
|
"$outfile"
|
||||||
else
|
else
|
||||||
convert \( $tmpA1 -define distort:viewport=${www}x${hhh}+0 -virtual-pixel mirror -distort SRT 0 \
|
magick \( $tmpA1 -define distort:viewport=${www}x${hhh}+0 -virtual-pixel mirror -distort SRT 0 \
|
||||||
-scale ${xmin}x${ymin}! -scale ${www}x${hhh}! -crop ${ww}x${hh}+0+0 +repage \) \
|
-scale ${xmin}x${ymin}! -scale ${www}x${hhh}! -crop ${ww}x${hh}+0+0 +repage \) \
|
||||||
\( $tmpA2 -write mpr:tile +delete -size ${ww}x${hh}! tile:mpr:tile \) \
|
\( $tmpA2 -write mpr:tile +delete -size ${ww}x${hh}! tile:mpr:tile \) \
|
||||||
\( -clone 1 -threshold 0 -edge $edge -clamp -fill $ecolor -opaque white -transparent black \) \
|
\( -clone 1 -threshold 0 -edge $edge -clamp -fill $ecolor -opaque white -transparent black \) \
|
||||||
|
|||||||
Reference in New Issue
Block a user