pinwheel: Add warning in waybar when work-vpn is on

This commit is contained in:
Alexander Heldt
2023-10-01 22:41:11 +02:00
parent 776288f61e
commit 65de54d4bf
2 changed files with 25 additions and 3 deletions

View File

@@ -79,6 +79,11 @@ let
esac
'';
work-vpn-status = pkgs.writeShellScript "work-vpn-status" ''
ON=$(ls /tmp | grep work-vpn-on | wc -l)
[ "$ON" -gt 0 ] && echo "WORK-VPN ON"
'';
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
if [ -z "$POWERED_ON" ]; then
@@ -104,7 +109,7 @@ in
output = [ "eDP-1" ];
modules-left = [ "hyprland/workspaces" ];
modules-right = [ "custom/spotify" "custom/dunst" "custom/mullvad" "bluetooth" "wireplumber" "network" "battery" "clock" ];
modules-right = [ "custom/work-vpn-status" "custom/spotify" "custom/dunst" "custom/mullvad" "bluetooth" "wireplumber" "network" "battery" "clock" ];
"custom/spotify" = {
exec = spotify-status;
@@ -120,6 +125,11 @@ in
tooltip = false;
};
"custom/work-vpn-status" = {
exec = "${work-vpn-status}";
interval = 1;
};
"custom/mullvad" = {
exec = "${mullvad} --output";
return-type = "json";
@@ -174,7 +184,12 @@ in
output = [ "HDMI-A-1" ];
modules-left = [ "hyprland/workspaces" ];
modules-right = [ "clock" ];
modules-right = [ "custom/work-vpn-status" "clock" ];
"custom/work-vpn-status" = {
exec = "${work-vpn-status}";
interval = 1;
};
"clock" = {
"interval" = 1;
@@ -188,6 +203,7 @@ in
foreground = "#f9c22b";
foreground-dim = "#a57b06";
background = "#262626";
warning = "#FF6969";
in
''
* {
@@ -219,6 +235,10 @@ in
background-color: ${background};
}
#custom-work-vpn-status {
color: ${warning};
}
#clock {
margin-right: 10px;
}