From 2fc0d8a66936653e6e78a6430d0e0d187880b9a9 Mon Sep 17 00:00:00 2001 From: Heiko Blobner Date: Thu, 13 Jul 2023 10:58:48 +0200 Subject: [PATCH] hmgr: herbstluft --- home-manager/modules/desktop/herbstluftwm.nix | 17 +++++++++++++++++ home-manager/pfke_at_errol.nix | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 home-manager/modules/desktop/herbstluftwm.nix diff --git a/home-manager/modules/desktop/herbstluftwm.nix b/home-manager/modules/desktop/herbstluftwm.nix new file mode 100644 index 0000000..3b65ac3 --- /dev/null +++ b/home-manager/modules/desktop/herbstluftwm.nix @@ -0,0 +1,17 @@ +{config, lib, pkgs, ...}: +let + # A list is used because it preserves ordering + tags = [ + { name = "tag 1"; key = "something"; } + { name = "tag 2"; } + ]; + # Attribute set of { = "use "; } + keybinds = let + tagsWithKeybinds = lib.filter (lib.hasAttr "key") tags; + in lib.listToAttrs (map (x: lib.nameValuePair x.key "use ${x.name}") tagsWithKeybinds); +in +{ + xsession.windowManager.herbstluftwm.enable = true; + xsession.windowManager.herbstluftwm.keybinds = keybinds; + xsession.windowManager.herbstluftwm.tags = lib.catAttrs "name" tags; +} diff --git a/home-manager/pfke_at_errol.nix b/home-manager/pfke_at_errol.nix index 843077a..b44a360 100644 --- a/home-manager/pfke_at_errol.nix +++ b/home-manager/pfke_at_errol.nix @@ -9,7 +9,7 @@ in { ./modules/cli/bat.nix ./modules/cli/starship.nix ./modules/cli/zsh.nix - ./modules/desktop/hprland + ./modules/desktop/herbstluftwm.nix ./modules/keychain.nix ]; monitors = [