add vpn-status
This commit is contained in:
parent
edc6346d0d
commit
090f4c1cc1
@ -53,9 +53,9 @@ in {
|
||||
command = scripts.brightness;
|
||||
interval = 1;
|
||||
};
|
||||
h_wireless = pkgs.stdenv.lib.optionalAttrs config.deviceSpecific.isLaptop {
|
||||
command = scripts.wireless;
|
||||
};
|
||||
# h_wireless = pkgs.stdenv.lib.optionalAttrs config.deviceSpecific.isLaptop {
|
||||
# command = scripts.wireless;
|
||||
# };
|
||||
# i_network = {
|
||||
# command = scripts.network;
|
||||
# };
|
||||
@ -85,6 +85,10 @@ in {
|
||||
echo '<span font="Material Icons 11"></span>' $(sudo btrfs fi usage / | grep "Free" | awk '{print $3}')
|
||||
'';
|
||||
};
|
||||
n_vpn = {
|
||||
command = scripts.vpn-status;
|
||||
interval = 600;
|
||||
};
|
||||
o_date = {
|
||||
command = "${pkgs.coreutils}/bin/date +'<span font=\"Material Icons 11\"></span> %a %y-%m-%d'";
|
||||
interval = 10;
|
||||
|
@ -30,6 +30,7 @@ writeTextFile {
|
||||
weather = ./weather.nix;
|
||||
sound = ./sound.nix;
|
||||
music = ./music.nix;
|
||||
vpn-status = ./vpn-status.nix;
|
||||
#temperature = ./temperature.nix;
|
||||
#free = ./free.nix;
|
||||
}
|
||||
|
9
modules/workspace/i3blocks/scripts/vpn-status.nix
Normal file
9
modules/workspace/i3blocks/scripts/vpn-status.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{ curl, ... }: ''
|
||||
#!/usr/bin/env bash
|
||||
API="$(${curl} https://am.i.mullvad.net/connected)"
|
||||
if [[ $(echo "$API" | awk -F'[ ()]+' '{print $6}') = 'server' ]]; then
|
||||
echo $(echo "$API" | awk -F'[ ()]+' '{print $7}')
|
||||
else
|
||||
echo 'Not connected'
|
||||
fi
|
||||
''
|
Loading…
x
Reference in New Issue
Block a user