Compare commits

..

2 commits

Author SHA1 Message Date
3fb913b104 hypr: eww-bard launched at startup 2024-01-26 09:59:00 +01:00
d41ea45326 eww-bard: Added script 2024-01-26 09:58:21 +01:00
3 changed files with 48 additions and 1 deletions

46
bin/eww-bard Executable file
View file

@ -0,0 +1,46 @@
#!/bin/dash
WIDGET_NAME=bar
mon_count=0
# Generates $1 different window names
gen_names () {
end=$(($1-1))
out=""
for i in $(seq 0 $end); do
out="$out $WIDGET_NAME:$WIDGET_NAME$i"
done
echo $out
}
# Generates $1 monitor args
gen_args () {
end=$(($1-1))
out=""
for i in $(seq 0 $end); do
out="$out --arg $WIDGET_NAME$i:monitor=$i"
done
echo $out
}
update (){
monitors=$(hyprctl monitors -j)
count=$(echo "$monitors" | jq -c length)
if [ $mon_count -ne $count ]; then
# Close bars
eww close $(seq -s " " 0 $(($mon_count-1)))
# Open new window count
echo "eww open-many $(gen_names $count) $(gen_args $count)"
eww open-many $(gen_names $count) $(gen_args $count)
# Update mon_count
mon_count=$count
fi
}
update
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
update
done

View file

@ -5,5 +5,5 @@ exec-once = mako
exec-once = hyprpaper exec-once = hyprpaper
exec-once = swayosd-server exec-once = swayosd-server
exec-once = udiskie exec-once = udiskie
exec-once = eww open bar --arg monitor=0 exec-once = eww-bard
exec-once = dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

1
sync
View file

@ -68,6 +68,7 @@ synced_files = [
("bin/mc-key-fix", "~/.local/bin/mc-key-fix"), ("bin/mc-key-fix", "~/.local/bin/mc-key-fix"),
("bin/x11-toggle-primary-gpu", "~/.local/bin/x11-toggle-primary-gpu"), ("bin/x11-toggle-primary-gpu", "~/.local/bin/x11-toggle-primary-gpu"),
("bin/uwu-launcher", "~/.local/bin/uwu-launcher"), ("bin/uwu-launcher", "~/.local/bin/uwu-launcher"),
("bin/eww-bard", "~/.local/bin/eww-bard"),
# Submodules # Submodules
("Ahurac-dotfiles/bin/ssh-fwd", "~/.local/bin/ssh-fwd"), ("Ahurac-dotfiles/bin/ssh-fwd", "~/.local/bin/ssh-fwd"),
] ]