From 8e6783cb5881e970ef1a3d8b43a0445c8437c807 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 30 Nov 2024 23:06:24 +0100 Subject: feat(modules/lf): Add a keymap for cd-ing to the download directory --- modules/by-name/lf/lf/keybindings/default.nix | 6 +++++- modules/by-name/lf/lf/module.nix | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'modules/by-name/lf') 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; + }; }; }; -- cgit 1.4.1