From 774778629a7ecceb08992786cacfa657db3bdf8a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 30 Nov 2024 08:36:21 +0100 Subject: fix(modules/yambar): Wrap the commands with arguments with a script --- modules/by-name/ya/yambar/module.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/by-name/ya/yambar/module.nix') diff --git a/modules/by-name/ya/yambar/module.nix b/modules/by-name/ya/yambar/module.nix index 2f6ea22f..2d0f1e97 100644 --- a/modules/by-name/ya/yambar/module.nix +++ b/modules/by-name/ya/yambar/module.nix @@ -18,6 +18,11 @@ dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); } + "/bin/${name}"; + + mkWrapper = bin: cmd: + pkgs.writeShellScript cmd '' + ${bin} ${cmd} + ''; in { options.soispha.programs.yambar = { enable = lib.mkEnableOption "yambar"; @@ -38,6 +43,7 @@ in { inherit lib; inherit (cfg) laptop; laptopBacklightName = cfg.backlight; + scripts = { mpd_song_name_script = makeScript { dependencies = [pkgs.mpc]; @@ -49,9 +55,9 @@ in { name = "sound-volume"; }; - cpu_script = "${lib.getExe pkgs.yambar-modules} cpu"; + cpu_script = mkWrapper (lib.getExe pkgs.yambar-modules) "cpu"; - memory_script = "${lib.getExe pkgs.yambar-modules} memory"; + memory_script = mkWrapper (lib.getExe pkgs.yambar-modules) "memory"; disk_script = makeScript { dependencies = with pkgs; [gawk btrfs-progs coreutils]; -- cgit 1.4.1