aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/cfg/default.nix1
-rw-r--r--share/cfg/hyprland.nix96
-rw-r--r--share/hm-modules/hyprdesktop.nix1
3 files changed, 98 insertions, 0 deletions
diff --git a/share/cfg/default.nix b/share/cfg/default.nix
index 1415377..9a6407d 100644
--- a/share/cfg/default.nix
+++ b/share/cfg/default.nix
@@ -13,5 +13,6 @@
./gallery-dl.nix
./fish.nix
./shellenv.nix
+ ./hyprland.nix
];
}
diff --git a/share/cfg/hyprland.nix b/share/cfg/hyprland.nix
new file mode 100644
index 0000000..f2b5ae5
--- /dev/null
+++ b/share/cfg/hyprland.nix
@@ -0,0 +1,96 @@
+{ ... }:
+let
+ programs = {
+ audio = {
+ increase = "wpctl set-volume @DEFAULT_AUDIO_SINK@ --limit 1.0 5%+";
+ decrease = "wpctl set-volume @DEFAULT_AUDIO_SINK@ --limit 1.0 5%-";
+ toggle-mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
+ };
+ screenshot = ''grim -g "$(slurp)" -t png - | wl-copy --type image/png'';
+ cmd = {
+ run = "tofi-run";
+ drun = "tofi-drun";
+ };
+ brightness = {
+ increase = "brightnessctl set +5%";
+ decrease = "brightnessctl set 5%-";
+ };
+ terminal = "kitty";
+ };
+in
+{
+ wayland.windowManager.hyprland = {
+ extraConfig = ''
+ $mod = SUPER
+
+ bind = $mod SHIFT, Return, exec, ${programs.terminal}
+
+ general {
+ layout = master
+ }
+
+ master {
+ mfact = 0.5
+ new_is_master = false
+ }
+
+ # workspaces
+ # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
+ ${builtins.concatStringsSep "\n" (builtins.genList (x:
+ let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
+ in ''
+ bind = $mod, ${ws}, workspace, ${toString (x + 1)}
+ bind = $mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}
+ '') 10)}
+
+ bind = $mod SHIFT, C, killactive
+ bind = $mod SHIFT, F, togglefloating
+ bind = $mod SHIFT, Q, exit
+ bind = $mod, P, exec, ${programs.cmd.drun}
+ bind = $mod SHIFT, P, exec, ${programs.cmd.run}
+
+ bind = $mod, H, cyclenext, prev
+ bind = $mod, L, cyclenext
+ bind = $mod SHIFT, H, swapnext, prev
+ bind = $mod SHIFT, L, swapnext
+
+ # audio control
+ binde =, XF86AudioRaiseVolume, exec, ${programs.audio.increase}
+ binde =, XF86AudioLowerVolume, exec, ${programs.audio.decrease}
+ bind =, XF86AudioMute, exec, ${programs.audio.toggle-mute}
+
+ # monitor brightness control
+ binde =, XF86MonBrightnessUp, exec, ${programs.brightness.increase}
+ binde =, XF86MonBrightnessDown, exec, ${programs.brightness.decrease}
+
+ # Screenshotting
+ # My stupid laptop outputs these three key codes when the PrtSc key is
+ # pressed instead of using just one code like any sane device would
+ bind = SUPER SHIFT, S, exec, ${programs.screenshot}
+
+ input {
+ # focus change on cursor move
+ follow_mouse = 1
+ accel_profile = flat
+ }
+ monitor=,preferred,auto,1
+
+ # set opacity to 0.9 active and 0.5 inactive for kitty
+ windowrule = opacity 0.9 override 0.5 override,^(kitty)$
+
+ # Move windows to their designated workspaces
+ windowrulev2 = workspace 3,class:(firefox)
+ windowrulev2 = workspace 4,class:(fluffychat)
+ windowrulev2 = workspace 4,class:(org.telegram.desktop)
+ windowrulev2 = workspace 4,class:(Signal)
+ windowrulev2 = workspace 5,class:(Bitwarden)
+
+ # workaround for https://github.com/hyprwm/Hyprland/issues/2661
+ windowrulev2 = stayfocused, title:^()$,class:^(steam)$
+ windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$
+
+ # No fade-in animation for the lanucher
+ layerrule = noanim, launcher
+ '';
+ };
+}
diff --git a/share/hm-modules/hyprdesktop.nix b/share/hm-modules/hyprdesktop.nix
index 1b6fe96..de2a780 100644
--- a/share/hm-modules/hyprdesktop.nix
+++ b/share/hm-modules/hyprdesktop.nix
@@ -49,6 +49,7 @@ in
};
config = mkIf cfg.enable {
+ wayland.windowManager.hyprland.enable = true;
home.packages = with pkgs; [
xh # Nice to use HTTP client
bc # CLI calculator