diff --git a/modules/nixos/linux/gui/hyprland/default.nix b/modules/nixos/linux/gui/hyprland/default.nix index 586125e..05605a0 100644 --- a/modules/nixos/linux/gui/hyprland/default.nix +++ b/modules/nixos/linux/gui/hyprland/default.nix @@ -39,6 +39,7 @@ in hyprshade hyprshot hyprpaper + playerctl # TODO: https://github.com/nix-community/home-manager/issues/5899 hyprlock diff --git a/modules/nixos/linux/gui/hyprland/settings.nix b/modules/nixos/linux/gui/hyprland/settings.nix index 437df18..b045b06 100644 --- a/modules/nixos/linux/gui/hyprland/settings.nix +++ b/modules/nixos/linux/gui/hyprland/settings.nix @@ -1,3 +1,5 @@ +# See default config here: +# https://github.com/hyprwm/Hyprland/blob/main/example/hyprland.conf { pkgs, lib, ... }: let @@ -9,12 +11,12 @@ let ''; runtimeInputs = with pkgs; [ hyprshade hyprshot ]; text = '' + #!/bin/sh + trap 'hyprshade on ${blue-light-filter}' EXIT # Turn off blue light filter hyprshade off # Take a screenshot of a region and copy it to clipboard hyprshot --clipboard-only -m region - # Turn on blue light filter - hyprshade on ${blue-light-filter} ''; }; in @@ -22,13 +24,55 @@ in wayland.windowManager.hyprland.settings = { "$mainMod" = "SUPER"; bind = [ - "$mainMod, R, exec, walker" "$mainMod, Q, exec, rio" - "$mainMod, T, exec, ${lib.getExe screenshot}" + + # Window management + "$mainMod, C, killactive," + "$mainMod, J, togglesplit," + "$mainMod, F, fullscreen" + + # Workspace management + # Switch + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + # Move window to workspace + "$mainMod SHIFT, 1, movetoworkspace, 1" + "$mainMod SHIFT, 2, movetoworkspace, 2" + "$mainMod SHIFT, 3, movetoworkspace, 3" + "$mainMod SHIFT, 4, movetoworkspace, 4" + "$mainMod SHIFT, 5, movetoworkspace, 5" + ]; + + # Move/resize windows with mouse + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + # Fn keys + bindl = [ + # Laptop multimedia keys for volume and LCD brightness + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ", XF86MonBrightnessUp, exec, brightnessctl s 10%+" + ", XF86MonBrightnessDown, exec, brightnessctl s 10%-" + # Requires playerctl + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + + ", XF86Favorites, exec, walker" + ", Print, exec, ${lib.getExe screenshot}" ]; exec-once = [ - "hyprshade on ${blue-light-filter}" + "${lib.getExe pkgs.hyprshade} on ${blue-light-filter}" ]; monitor = [ @@ -39,14 +83,33 @@ in "DP-6,disable" # Same as DP-5 ]; - #env = [ - # "XCURSOR_SIZE,24" - # "HYPRCURSOR_SIZE,24" - #]; + general = { + border_size = 2; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + resize_on_border = true; + }; + + decoration = { + rounding = 10; + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + blur = { + enabled = true; + size = 3; + }; + }; + + misc = { + force_default_wallpaper = 2; + }; input = { follow_mouse = 1; natural_scroll = true; + touchpad.natural_scroll = true; kb_options = "ctrl:nocaps"; }; }; diff --git a/modules/nixos/linux/gui/hyprland/waybar.nix b/modules/nixos/linux/gui/hyprland/waybar.nix index 56eb7e2..130dc7d 100644 --- a/modules/nixos/linux/gui/hyprland/waybar.nix +++ b/modules/nixos/linux/gui/hyprland/waybar.nix @@ -5,7 +5,7 @@ enable = true; settings = { mainBar = { - output = [ "eDP-1" ]; # Laptop screen only + # output = [ "eDP-1" ]; # Laptop screen only }; }; };