home: wm: i3bar: add VPN blocks
This commit is contained in:
parent
33b94a7f9d
commit
3a2f02f001
|
@ -36,6 +36,31 @@ in
|
||||||
|
|
||||||
i3bar = {
|
i3bar = {
|
||||||
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
||||||
|
|
||||||
|
vpn = {
|
||||||
|
enable = my.mkDisableOption "VPN configuration";
|
||||||
|
|
||||||
|
blockConfigs = mkOption {
|
||||||
|
type = with types; listOf (attrsOf str);
|
||||||
|
default = [
|
||||||
|
{
|
||||||
|
active_format = " VPN ";
|
||||||
|
service = "wg-quick-wg";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
active_format = " VPN (LAN) ";
|
||||||
|
service = "wg-quick-lan";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
example = [
|
||||||
|
{
|
||||||
|
active_format = " WORK ";
|
||||||
|
service = "some-service-name";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
description = "list of block configurations, merged with the defauls";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
rofi = {
|
rofi = {
|
||||||
|
|
|
@ -59,6 +59,19 @@ in
|
||||||
{
|
{
|
||||||
block = "disk_space";
|
block = "disk_space";
|
||||||
}
|
}
|
||||||
|
(lib.optionals cfg.vpn.enable
|
||||||
|
(
|
||||||
|
let
|
||||||
|
defaults = {
|
||||||
|
block = "service_status";
|
||||||
|
active_state = "Good";
|
||||||
|
inactive_format = "";
|
||||||
|
inactive_state = "Idle";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
builtins.map (block: defaults // block) cfg.vpn.blockConfigs
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
block = "net";
|
block = "net";
|
||||||
format = " $icon{| $ssid|} $ip{| $signal_strength|} ";
|
format = " $icon{| $ssid|} $ip{| $signal_strength|} ";
|
||||||
|
|
Loading…
Reference in a new issue