From 3f5be7bb74d727b936e9ab1531874d1e5157480f Mon Sep 17 00:00:00 2001 From: Christian Ott Date: Sat, 4 May 2024 21:27:35 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=B2=20extract=20hyprland=20into=20own=20m?= =?UTF-8?q?odule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home.nix | 29 ++++------------------------- hyperland/default.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 hyperland/default.nix diff --git a/home.nix b/home.nix index 0a7aa63..4bdfb43 100644 --- a/home.nix +++ b/home.nix @@ -1,35 +1,14 @@ { config, pkgs, pkgs-unstable, username, ... }: { + imports = [ + ./hyperland + ]; + # TODO please change the username & home directory to your own home.username = "${username}"; home.homeDirectory = "/home/${username}"; - wayland.windowManager.hyprland.enable = true; - wayland.windowManager.hyprland.settings = { - "$mod" = "SUPER"; - bind = - [ - "$mod, F, exec, firefox" - ", Print, exec, grimblast copy area" - ] - ++ ( - # workspaces - # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - ] - ) - 10) - ); - }; # Packages that should be installed to the user profile. home.packages = with pkgs; [ diff --git a/hyperland/default.nix b/hyperland/default.nix new file mode 100644 index 0000000..d4cf163 --- /dev/null +++ b/hyperland/default.nix @@ -0,0 +1,30 @@ +{ config, pkgs, pkgs-unstable, username, ... }: + +{ + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + bind = + [ + "$mod, F, exec, firefox" + "$mod, k, exec, kitty" + ", Print, exec, grimblast copy area" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10) + ); + }; +} \ No newline at end of file