1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(i3status-rust): add netdevice indicator

This commit is contained in:
2021-05-18 20:38:26 +02:00
parent 0f6d9bdc66
commit 295dfad33e

View File

@@ -102,6 +102,22 @@ in {
echo "$mail_count"
'';
}
(let service = "openvpn-hu-berlin"; in {
block = "custom";
interval = 5;
command = pkgs.writers.writeDash "net-device" ''
PATH=${lib.makeBinPath [ pkgs.systemd ]}
systemctl is-active --quiet ${service}.service && echo "🎓👍" || 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";
device = wirelessInterface;