[waybar] small improvements

This commit is contained in:
Simon Cornet 2024-03-30 13:34:41 +01:00
parent c955622ef6
commit 664390cc83
4 changed files with 46 additions and 3 deletions

30
apps/hyprland/hypridle.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env zsh
# function to toggle hypridle
function toggle () {
if pgrep "hypridle" > /dev/null
then
pkill hypridle
notify-send -u normal -t 4500 "🙈 Hypridle Inactive"
else
hypridle &
notify-send -u normal -t 4500 "🙊 Hypridle Active"
fi
}
# main function
case $1 in
toggle)
toggle
;;
*)
if pgrep "hypridle" > /dev/null
then
icon="🙊"
else
icon="🙈"
fi
printf "%s" "$icon"
;;
esac

View File

@ -26,6 +26,7 @@ tooltip {
#network,
#pulseaudio,
#workspaces,
#custom-hypridle,
#custom-wireguard,
#tray,
#window {
@ -54,6 +55,10 @@ tooltip {
color: #a6e3a1;
}
#custom-hypridle {
color: #89b4fa;
}
#custom-wireguard {
color: #89b4fa;
}

View File

@ -22,8 +22,9 @@
"modules-right": [
"custom/spotify",
"tray",
"network",
"custom/hypridle",
"custom/wireguard",
"network",
"battery",
"backlight",
"pulseaudio",
@ -69,6 +70,13 @@
"tooltip-format": "<tt><small>{calendar}</small></tt>"
},
"custom/hypridle": {
"interval": 2,
"format": "{}",
"exec": "$HOME/.dotfiles/apps/hyprland/hypridle.sh",
"on-click": "$HOME/.dotfiles/apps/hyprland/hypridle.sh toggle"
},
"custom/wireguard": {
"interval": 2,
"format": "{}",

View File

@ -13,14 +13,14 @@ status_vpn () {
if echo "$tailscale_status" | grep "$hostname_short" &> /dev/null; then
vpn_status+='🔒 '
else
vpn_status+='🛡️ '
vpn_status+='🔓 '
fi
# check for direct connectivity
if "$tailscale_bin" status | grep allegro | grep direct &> /dev/null; then
vpn_status+='✅'
else
vpn_status+=''
vpn_status+='⚠️'
fi
echo "$vpn_status"