Improve conditional for waybar
This commit is contained in:
@@ -8,8 +8,26 @@ let
|
||||
];
|
||||
text = builtins.readFile ./flakestat.sh;
|
||||
};
|
||||
arrhist = pkgs.stdenv.mkDerivation {
|
||||
name = "arrhist";
|
||||
propagatedBuildInputs = [
|
||||
(pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
|
||||
requests
|
||||
]))
|
||||
];
|
||||
src = ./arrhist.py;
|
||||
dontUnpack = true;
|
||||
installPhase = "install -Dm755 ${./arrhist.py} $out/bin/arrhist";
|
||||
};
|
||||
withArrhist = if (osConfig.system.name == "gunter") then true else false;
|
||||
withBattery = if (osConfig.system.name == "magicman") then true else false;
|
||||
in
|
||||
{
|
||||
sops.secrets."sonarr_base_url" = { };
|
||||
sops.secrets."sonarr_api_key" = { };
|
||||
sops.secrets."radarr_base_url" = { };
|
||||
sops.secrets."radarr_api_key" = { };
|
||||
|
||||
xdg.configFile."waybar/macchiato.css" = {
|
||||
source = pkgs.fetchFromGitHub
|
||||
{
|
||||
@@ -108,6 +126,7 @@ in
|
||||
#battery,
|
||||
#custom-powermenu,
|
||||
#custom-flakestat,
|
||||
#custom-arrhist,
|
||||
#custom-cava-internal {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
@@ -149,86 +168,95 @@ in
|
||||
font-family: "Hack Nerd Font";
|
||||
}
|
||||
'';
|
||||
settings = [{
|
||||
"layer" = "top";
|
||||
"position" = "top";
|
||||
modules-left = [ "custom/launcher" "hyprland/workspaces" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right =
|
||||
[
|
||||
"custom/flakestat"
|
||||
"pulseaudio"
|
||||
"pulseaudio#microphone"
|
||||
"memory"
|
||||
"cpu"
|
||||
"tray"
|
||||
(lib.mkIf (osConfig.system.name == "magicman") "battery")
|
||||
];
|
||||
"custom/launcher" = {
|
||||
"format" = " ";
|
||||
"on-click" = "pkill rofi || ~/.config/rofi/launcher.sh";
|
||||
"tooltip" = false;
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
"format" = "{name}";
|
||||
"on-click" = "activate";
|
||||
"on-scroll-up" = "hyprctl dispatch workspace e+1";
|
||||
"on-scroll-down" = "hyprctl dispatch workspace e-1";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
"scroll-step" = 5;
|
||||
"format" = "{icon} {volume}%";
|
||||
"format-muted" = "";
|
||||
"format-icons" = { "default" = [ "" "" "" ]; };
|
||||
"on-click" = "pamixer -t";
|
||||
};
|
||||
"pulseaudio#microphone" = {
|
||||
"format" = "{format_source}";
|
||||
"format-source" = " {volume}%";
|
||||
"format-source-muted" = "";
|
||||
"on-click" = "pamixer --default-source -t";
|
||||
"on-scroll-up" = "pamixer --default-source -i 5";
|
||||
"on-scroll-down" = "pamixer --default-source -d 5";
|
||||
"scroll-step" = 5;
|
||||
"on-click-right" = "pavucontrol";
|
||||
};
|
||||
"clock" = {
|
||||
"interval" = 1;
|
||||
"format" = "{:%H:%M %A %b %d}";
|
||||
"tooltip" = true;
|
||||
};
|
||||
"memory" = {
|
||||
"interval" = 3;
|
||||
"format" = " {percentage}%";
|
||||
"states" = { "warning" = 85; };
|
||||
};
|
||||
"cpu" = {
|
||||
"interval" = 3;
|
||||
"format" = " {usage}%";
|
||||
};
|
||||
"tray" = {
|
||||
"icon-size" = 15;
|
||||
"spacing" = 6;
|
||||
};
|
||||
"battery" = {
|
||||
"interval" = 60;
|
||||
"states" = {
|
||||
"warning" = 20;
|
||||
"critical" = 5;
|
||||
settings = [
|
||||
({
|
||||
"layer" = "top";
|
||||
"position" = "top";
|
||||
modules-left = [ "custom/launcher" "hyprland/workspaces" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right =
|
||||
[
|
||||
(lib.mkIf (withArrhist) "custom/arrhist")
|
||||
"custom/flakestat"
|
||||
"pulseaudio"
|
||||
"pulseaudio#microphone"
|
||||
"memory"
|
||||
"cpu"
|
||||
"tray"
|
||||
(lib.mkIf (withBattery) "battery")
|
||||
];
|
||||
"custom/launcher" = {
|
||||
"format" = " ";
|
||||
"on-click" = "pkill rofi || ~/.config/rofi/launcher.sh";
|
||||
"tooltip" = false;
|
||||
};
|
||||
"format" = "{icon} {capacity}%";
|
||||
"format-icons" = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"custom/flakestat" = {
|
||||
"exec" = "${flakestat}/bin/flakestat";
|
||||
"interval" = 600;
|
||||
};
|
||||
}];
|
||||
"hyprland/workspaces" = {
|
||||
"format" = "{name}";
|
||||
"on-click" = "activate";
|
||||
"on-scroll-up" = "hyprctl dispatch workspace e+1";
|
||||
"on-scroll-down" = "hyprctl dispatch workspace e-1";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
"scroll-step" = 5;
|
||||
"format" = "{icon} {volume}%";
|
||||
"format-muted" = "";
|
||||
"format-icons" = { "default" = [ "" "" "" ]; };
|
||||
"on-click" = "pamixer -t";
|
||||
};
|
||||
"pulseaudio#microphone" = {
|
||||
"format" = "{format_source}";
|
||||
"format-source" = " {volume}%";
|
||||
"format-source-muted" = "";
|
||||
"on-click" = "pamixer --default-source -t";
|
||||
"on-scroll-up" = "pamixer --default-source -i 5";
|
||||
"on-scroll-down" = "pamixer --default-source -d 5";
|
||||
"scroll-step" = 5;
|
||||
"on-click-right" = "pavucontrol";
|
||||
};
|
||||
"clock" = {
|
||||
"interval" = 1;
|
||||
"format" = "{:%H:%M %A %b %d}";
|
||||
"tooltip" = true;
|
||||
};
|
||||
"memory" = {
|
||||
"interval" = 3;
|
||||
"format" = " {percentage}%";
|
||||
"states" = { "warning" = 85; };
|
||||
};
|
||||
"cpu" = {
|
||||
"interval" = 3;
|
||||
"format" = " {usage}%";
|
||||
};
|
||||
"tray" = {
|
||||
"icon-size" = 15;
|
||||
"spacing" = 6;
|
||||
};
|
||||
"battery" = {
|
||||
"interval" = 60;
|
||||
"states" = {
|
||||
"warning" = 20;
|
||||
"critical" = 5;
|
||||
};
|
||||
"format" = "{icon} {capacity}%";
|
||||
"format-icons" = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"custom/flakestat" = {
|
||||
"exec" = "${flakestat}/bin/flakestat";
|
||||
"interval" = 600;
|
||||
};
|
||||
} // lib.optionalAttrs (withArrhist) {
|
||||
"custom/arrhist" = {
|
||||
"exec" = "${arrhist}/bin/arrhist";
|
||||
"return-type" = "json";
|
||||
"interval" = 30;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user