mirror of
https://github.com/kmein/niveum
synced 2026-03-20 12:01:06 +01:00
feat(i3): show which vpn is active
This commit is contained in:
@@ -121,22 +121,16 @@ in {
|
|||||||
print("🌅 {} 🌇 {} {} {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase], round(current_phase, 1)))
|
print("🌅 {} 🌇 {} {} {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase], round(current_phase, 1)))
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
(let service = "openvpn-hu-berlin"; in {
|
{
|
||||||
block = "custom";
|
block = "custom";
|
||||||
interval = 5;
|
interval = 5;
|
||||||
command = pkgs.writers.writeDash "net-device" ''
|
command = pkgs.writers.writeDash "hu-berlin-vpn" ''
|
||||||
PATH=${lib.makeBinPath [ pkgs.systemd ]}
|
PATH=${lib.makeBinPath [ pkgs.systemd ]}
|
||||||
systemctl is-active --quiet ${service}.service && echo "🎓👍" || echo "🎓👎"
|
(systemctl is-active --quiet openvpn-hu-berlin.service && echo "🎓👍 (OpenVPN)") \
|
||||||
|
|| (systemctl is-active --quiet hu-vpn.service && echo "🎓👍 (PPP+SSL)") \
|
||||||
|
|| echo "🎓👎"
|
||||||
'';
|
'';
|
||||||
on_click = pkgs.writers.writeDash "toggle" ''
|
}
|
||||||
PATH=${lib.makeBinPath [ pkgs.systemd pkgs.libnotify ]}
|
|
||||||
systemctl is-active --quiet ${service}.service && {
|
|
||||||
systemctl stop ${service}.service && notify-send -a "${service}" stopped
|
|
||||||
} || {
|
|
||||||
systemctl start ${service}.service && notify-send -a "${service}" started
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
block = "net";
|
block = "net";
|
||||||
device = wirelessInterface;
|
device = wirelessInterface;
|
||||||
|
|||||||
Reference in New Issue
Block a user