pinwheel: Add warning in waybar when work-vpn is on
This commit is contained in:
@@ -79,6 +79,11 @@ let
|
|||||||
esac
|
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" ''
|
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
|
||||||
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
|
POWERED_ON=$(bluetoothctl show | grep "Powered: yes")
|
||||||
if [ -z "$POWERED_ON" ]; then
|
if [ -z "$POWERED_ON" ]; then
|
||||||
@@ -104,7 +109,7 @@ in
|
|||||||
output = [ "eDP-1" ];
|
output = [ "eDP-1" ];
|
||||||
|
|
||||||
modules-left = [ "hyprland/workspaces" ];
|
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" = {
|
"custom/spotify" = {
|
||||||
exec = spotify-status;
|
exec = spotify-status;
|
||||||
@@ -120,6 +125,11 @@ in
|
|||||||
tooltip = false;
|
tooltip = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/work-vpn-status" = {
|
||||||
|
exec = "${work-vpn-status}";
|
||||||
|
interval = 1;
|
||||||
|
};
|
||||||
|
|
||||||
"custom/mullvad" = {
|
"custom/mullvad" = {
|
||||||
exec = "${mullvad} --output";
|
exec = "${mullvad} --output";
|
||||||
return-type = "json";
|
return-type = "json";
|
||||||
@@ -174,7 +184,12 @@ in
|
|||||||
output = [ "HDMI-A-1" ];
|
output = [ "HDMI-A-1" ];
|
||||||
|
|
||||||
modules-left = [ "hyprland/workspaces" ];
|
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" = {
|
"clock" = {
|
||||||
"interval" = 1;
|
"interval" = 1;
|
||||||
@@ -188,6 +203,7 @@ in
|
|||||||
foreground = "#f9c22b";
|
foreground = "#f9c22b";
|
||||||
foreground-dim = "#a57b06";
|
foreground-dim = "#a57b06";
|
||||||
background = "#262626";
|
background = "#262626";
|
||||||
|
warning = "#FF6969";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
* {
|
* {
|
||||||
@@ -219,6 +235,10 @@ in
|
|||||||
background-color: ${background};
|
background-color: ${background};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-work-vpn-status {
|
||||||
|
color: ${warning};
|
||||||
|
}
|
||||||
|
|
||||||
#clock {
|
#clock {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ let
|
|||||||
pkgs.writeShellApplication {
|
pkgs.writeShellApplication {
|
||||||
name = "work-vpn";
|
name = "work-vpn";
|
||||||
text = ''
|
text = ''
|
||||||
|
touch /tmp/work-vpn-on; \
|
||||||
sudo \
|
sudo \
|
||||||
${pkgs.openvpn}/bin/openvpn \
|
${pkgs.openvpn}/bin/openvpn \
|
||||||
--script-security 2 \
|
--script-security 2 \
|
||||||
@@ -17,7 +18,8 @@ let
|
|||||||
--down ${pkgs.update-systemd-resolved}/libexec/openvpn/update-systemd-resolved \
|
--down ${pkgs.update-systemd-resolved}/libexec/openvpn/update-systemd-resolved \
|
||||||
--down-pre \
|
--down-pre \
|
||||||
--config ${ovpnconfig} \
|
--config ${ovpnconfig} \
|
||||||
--auth-user-pass ${userpass}
|
--auth-user-pass ${userpass}; \
|
||||||
|
rm /tmp/work-vpn-on
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
Reference in New Issue
Block a user