[waybar] small improvements
This commit is contained in:
parent
c955622ef6
commit
664390cc83
30
apps/hyprland/hypridle.sh
Executable file
30
apps/hyprland/hypridle.sh
Executable 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
|
@ -26,6 +26,7 @@ tooltip {
|
|||||||
#network,
|
#network,
|
||||||
#pulseaudio,
|
#pulseaudio,
|
||||||
#workspaces,
|
#workspaces,
|
||||||
|
#custom-hypridle,
|
||||||
#custom-wireguard,
|
#custom-wireguard,
|
||||||
#tray,
|
#tray,
|
||||||
#window {
|
#window {
|
||||||
@ -54,6 +55,10 @@ tooltip {
|
|||||||
color: #a6e3a1;
|
color: #a6e3a1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-hypridle {
|
||||||
|
color: #89b4fa;
|
||||||
|
}
|
||||||
|
|
||||||
#custom-wireguard {
|
#custom-wireguard {
|
||||||
color: #89b4fa;
|
color: #89b4fa;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,9 @@
|
|||||||
"modules-right": [
|
"modules-right": [
|
||||||
"custom/spotify",
|
"custom/spotify",
|
||||||
"tray",
|
"tray",
|
||||||
"network",
|
"custom/hypridle",
|
||||||
"custom/wireguard",
|
"custom/wireguard",
|
||||||
|
"network",
|
||||||
"battery",
|
"battery",
|
||||||
"backlight",
|
"backlight",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
@ -69,6 +70,13 @@
|
|||||||
"tooltip-format": "<tt><small>{calendar}</small></tt>"
|
"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": {
|
"custom/wireguard": {
|
||||||
"interval": 2,
|
"interval": 2,
|
||||||
"format": "{}",
|
"format": "{}",
|
||||||
|
@ -13,14 +13,14 @@ status_vpn () {
|
|||||||
if echo "$tailscale_status" | grep "$hostname_short" &> /dev/null; then
|
if echo "$tailscale_status" | grep "$hostname_short" &> /dev/null; then
|
||||||
vpn_status+='🔒 '
|
vpn_status+='🔒 '
|
||||||
else
|
else
|
||||||
vpn_status+='🛡️ '
|
vpn_status+='🔓 '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for direct connectivity
|
# check for direct connectivity
|
||||||
if "$tailscale_bin" status | grep allegro | grep direct &> /dev/null; then
|
if "$tailscale_bin" status | grep allegro | grep direct &> /dev/null; then
|
||||||
vpn_status+='✅'
|
vpn_status+='✅'
|
||||||
else
|
else
|
||||||
vpn_status+='❌'
|
vpn_status+='⚠️'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$vpn_status"
|
echo "$vpn_status"
|
||||||
|
Reference in New Issue
Block a user