about summary refs log tree commit diff stats
path: root/modules/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name')
-rw-r--r--modules/by-name/lf/lf/keybindings/default.nix6
-rw-r--r--modules/by-name/lf/lf/module.nix24
-rw-r--r--modules/by-name/ya/yambar/module.nix10
-rw-r--r--modules/by-name/ya/yambar/settings/default.nix52
4 files changed, 58 insertions, 34 deletions
diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix
index 7ae720e0..f624719f 100644
--- a/modules/by-name/lf/lf/keybindings/default.nix
+++ b/modules/by-name/lf/lf/keybindings/default.nix
@@ -1,4 +1,7 @@
-{uid}: {
+{
+  uid,
+  downloadDir,
+}: {
   # Remove some defaults
   "'\"'" = null;
   ";" = null;
@@ -87,6 +90,7 @@
   gc = "cd ~/.config";
   gl = "cd ~/.local";
   gE = "cd /etc";
+  gd = "cd ${downloadDir}";
 
   "gU." = "cd /usr";
   gUs = " cd /usr/share";
diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix
index 1c02092d..840ba492 100644
--- a/modules/by-name/lf/lf/module.nix
+++ b/modules/by-name/lf/lf/module.nix
@@ -8,18 +8,28 @@
   ...
 }: let
   commands = import ./commands {inherit pkgs sysLib shell_library system;};
-  keybindings = import ./keybindings {inherit (cfg.keymaps) uid;};
+  keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;};
 
   cfg = config.soispha.programs.lf;
 in {
   options.soispha.programs.lf = {
     enable = lib.mkEnableOption "lf";
-    keymaps.uid = lib.mkOption {
-      description = ''
-        The uid to use when constructing the `/run/user/''${uid}` path.
-      '';
-      type = lib.types.ints.unsigned;
-      default = config.users.users.soispha.uid;
+    keymaps = {
+      downloadDir = lib.mkOption {
+        description = ''
+          The directory to cd to when the user wants to access the download dir.
+        '';
+        type = lib.types.str;
+        default = config.home-manager.users.soispha.xdg.userDirs.download;
+      };
+
+      uid = lib.mkOption {
+        description = ''
+          The uid to use when constructing the `/run/user/''${uid}` path.
+        '';
+        type = lib.types.ints.unsigned;
+        default = config.users.users.soispha.uid;
+      };
     };
   };
 
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];
diff --git a/modules/by-name/ya/yambar/settings/default.nix b/modules/by-name/ya/yambar/settings/default.nix
index 041ac88e..52c3d1f7 100644
--- a/modules/by-name/ya/yambar/settings/default.nix
+++ b/modules/by-name/ya/yambar/settings/default.nix
@@ -9,7 +9,7 @@
   mkUnderline = color: {
     underline = {
       inherit color;
-      size = "3";
+      size = 3;
     };
   };
 
@@ -22,7 +22,7 @@
       green = "a6e3a1dd";
       lavendar = "b4befedd";
       mauve = "cba6f7dd";
-      none = "0";
+      none = "00000000";
       normal = "c6ceefff";
       peach = "fab387dd";
       sapphire = "74c7ecdd";
@@ -30,14 +30,18 @@
     };
     font = {
       main = "Source Code Pro:pixelsize=${
-        if laptop
-        then "22"
-        else "26"
+        builtins.toString (
+          if laptop
+          then 22
+          else 26
+        )
       }";
       aws = "Font Awesome 5 Free:style=solid:pixelsize=${
-        if laptop
-        then "20"
-        else "23"
+        builtins.toString (
+          if laptop
+          then 20
+          else 23
+        )
       }";
     };
     background = {
@@ -91,19 +95,19 @@ in {
     font = values.font.main;
     height =
       if laptop
-      then "25"
-      else "45";
+      then 25
+      else 45;
     margin =
       if laptop
-      then "5"
-      else "10";
+      then 5
+      else 10;
     location = "top";
     layer = "bottom";
-    spacing = "0";
+    spacing = 0;
 
     border = {
-      margin = "0";
-      top-margin = "10";
+      margin = 0;
+      top-margin = 10;
     };
 
     left = [
@@ -113,7 +117,7 @@ in {
             map = let
               normal = {
                 string = {
-                  margin = "10";
+                  margin = 10;
                   text = "{id}";
                 };
               };
@@ -128,7 +132,7 @@ in {
                         values.underline.focused
                       ];
                     };
-                    margin = "10";
+                    margin = 10;
                     text = "{id}";
                   };
                 };
@@ -138,7 +142,7 @@ in {
                       occupied = {
                         string = {
                           deco = {background = {color = values.background.tag2;};};
-                          margin = "10";
+                          margin = 10;
                           text = "{id}";
                         };
                       };
@@ -149,7 +153,7 @@ in {
                 "state == unfocused" = {
                   string = {
                     deco = {background = {color = values.background.tag2;};};
-                    margin = "10";
+                    margin = 10;
                     text = "{id}";
                   };
                 };
@@ -161,7 +165,7 @@ in {
                         values.underline.urgent
                       ];
                     };
-                    margin = "10";
+                    margin = 10;
                     text = "{id}";
                   };
                 };
@@ -194,10 +198,10 @@ in {
               conditions = {"title == \"\"" = {string = {text = "";};};};
               default = {
                 string = {
-                  max = "35";
+                  max = 35;
                   deco = values.underline.title;
-                  left-margin = "12";
-                  right-margin = "12";
+                  left-margin = 12;
+                  right-margin = 12;
                   text = "{title}";
                 };
               };
@@ -317,7 +321,7 @@ in {
         {
           battery = {
             name = "BAT0";
-            poll-interval = "300";
+            poll-interval = 300;
             content.list.items = [
               {
                 ramp = {