diff --git a/flake.nix b/flake.nix index d9d68e4..a77f362 100644 --- a/flake.nix +++ b/flake.nix @@ -11,15 +11,20 @@ }; hyprland.url = "github:hyprwm/Hyprland"; + hyprland-contrib = { + url = "github:hyprwm/contrib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, home-manager, hyprland, ... }: + outputs = { nixpkgs, home-manager, hyprland, ... }@inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; in { homeConfigurations."pan" = home-manager.lib.homeManagerConfiguration { inherit pkgs; + extraSpecialArgs = { inherit inputs; }; modules = [ hyprland.homeManagerModules.default ./home.nix diff --git a/programs/hypr/default.conf b/programs/hypr/default.conf deleted file mode 100644 index d92465d..0000000 --- a/programs/hypr/default.conf +++ /dev/null @@ -1,80 +0,0 @@ -monitor=DP-2,2560x1440@144,0x0,1 -monitor=DP-1,2560x1440@144,-2560x0,1 -monitor=HDMI-A-1,disable -env = HYPR_MON_PRIMARY, DP-2 -env = HYPR_MON_SECONDARY, DP-1 - -# Primaries -workspace=name:home, monitor:DP-2, persistent:true, default:true -workspace=name:game, monitor:DP-2, persistent:true -workspace=name:etc0, monitor:DP-2, persistent:true -# Secondaries -workspace=name:chat, monitor:DP-1, persistent:true, default:true -workspace=name:misc0, monitor:DP-1, persistent:true -# Switches -workspace=name:web , monitor:DP-1, persistent:true -workspace=name:med , monitor:DP-1, persistent:true - -windowrule = workspace name:web, librewolf -windowrulev2 = workspace name:med, librewolf,title:Picture-in-Picture -windowrule = workspace name:chat, discord - -env = LIBVA_DRIVER_NAME,nvidia -env = XDG_SESSION_TYPE,wayland -env = GBM_BACKEND,nvidia-drm -env = __GLX_VENDOR_LIBRARY_NAME,nvidia -env = WLR_NO_HARDWARE_CURSORS,1 - -env = HYPR_WORK_DB,$XDG_CACHE_HOME/hypr/workspace.db -exec-once = $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh - -exec-once = swww init -exec-once = swww img $HOME/med/pix/bg.png - -input { - kb_layout = us - follow_mouse = 1 - accel_profile = flat - sensitivity = -0.52 - #sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification. -} - -general { - gaps_in = 3 - gaps_out = 3 - border_size = 2 - col.active_border = rgb(F5C2E7) - col.inactive_border = rgb(1E1D2F) - - layout = master -} - -decoration { - rounding = 2 - blur { - size = 12 - } -} - -animations { - enabled = yes - - animation = windows, 1, 4, default, popin 50% - animation = windowsOut, 1, 4, default, popin 50% - animation = windowsMove, 1, 3, default - animation = border, 1, 3, default - animation = fade, 1, 3, default - animation = workspaces, 1, 3, default -} - -master { - no_gaps_when_only = true - new_is_master = false -} - -Binds { - workspace_back_and_forth = true -} - -windowrule = opacity 0.9 0.9,^(Alacritty)$ -windowrule = opacity 0.94 0.94,^(discord)$ diff --git a/programs/hypr/default.nix b/programs/hypr/default.nix index e1234a3..b57f85a 100644 --- a/programs/hypr/default.nix +++ b/programs/hypr/default.nix @@ -1,18 +1,26 @@ -{ config, pkgs, ... }: +{ inputs, pkgs, ... }: let rootPath = ./.; in { wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.extraConfig = '' - ${builtins.readFile ./default.conf} + ${builtins.readFile ./window_rules.conf} + ${builtins.readFile ./settings.conf} + ${builtins.readFile ./nvidia.conf} ${builtins.readFile ./keybinds.conf} + ${builtins.readFile ./xwaylandvideobridge.conf} ''; # wayland.windowManager.hyprland.enableNvidiaPatches = true; home.packages = with pkgs; [ socat # For hyprland scripts swww # Wallpaper engine wlr-randr # Xrandr for wayland + wl-clipboard # Clipboard manager for wayland xdg-desktop-portal-hyprland # XDP for hyprland + hyprpicker # Colorpicker, needed for screenshot tool + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast # Screenshot tool + xwaylandvideobridge # Allows screensharing with xwayland apps ]; + # Hyprland screenshot tool xdg.configFile."hypr-scripts" = { source = rootPath + "/scripts"; target = "hypr/scripts"; diff --git a/programs/hypr/keybinds.conf b/programs/hypr/keybinds.conf index ab4d5a0..3c9b2d8 100644 --- a/programs/hypr/keybinds.conf +++ b/programs/hypr/keybinds.conf @@ -3,6 +3,8 @@ $mainMod = SUPER # Exec programs bind = $mainMod, return, exec, alacritty bind = $mainMod SHIFT, return, exec, rofi -show run +bind = $mainMod, P, exec, grimblast --freeze copy area +bind = $mainMod SHIFT, P, exec, grimblast --freeze copysave area # Hyprland Management bind = $mainMod SHIFT, Q, exit, @@ -24,6 +26,9 @@ bind = $mainMod, 4, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh game binde = $mainMod, 5, exec, $XDG_CONFIG_HOME/hypr/scripts/changeprimary.xsh etc binde = $mainMod, TAB, exec, $XDG_CONFIG_HOME/hypr/scripts/changesecondary.xsh +bind = $mainMod, m, togglespecialworkspace, mus +bind = $mainMod, i, togglespecialworkspace, scratch + # Window Management bind = $mainMod, C, killactive, diff --git a/programs/hypr/nvidia.conf b/programs/hypr/nvidia.conf new file mode 100644 index 0000000..1271144 --- /dev/null +++ b/programs/hypr/nvidia.conf @@ -0,0 +1,6 @@ +# Nivida Settings +env = LIBVA_DRIVER_NAME,nvidia +env = XDG_SESSION_TYPE,wayland +env = GBM_BACKEND,nvidia-drm +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +env = WLR_NO_HARDWARE_CURSORS,1 diff --git a/programs/hypr/scripts/initdb.xsh b/programs/hypr/scripts/initdb.xsh index 8e7af93..85bdad5 100755 --- a/programs/hypr/scripts/initdb.xsh +++ b/programs/hypr/scripts/initdb.xsh @@ -8,6 +8,6 @@ import shelve with shelve.open($HYPR_WORK_DB) as db: db["primary"] = "home" db["secondary"] = "chat" - db["secondaries"] = ["chat", "web"] + db["secondaries"] = ["chat", "web", "med"] db["secondary_extras"] = 1 db["primary_extras"] = 1 diff --git a/programs/hypr/settings.conf b/programs/hypr/settings.conf new file mode 100644 index 0000000..71d0ae2 --- /dev/null +++ b/programs/hypr/settings.conf @@ -0,0 +1,59 @@ +# Monitor Settings +monitor=DP-2,2560x1440@144,0x0,1 +monitor=DP-1,2560x1440@144,-2560x0,1 +monitor=HDMI-A-1,disable + +# Fix screen tearing +env = WLR_DRM_NO_ATOMIC,1 + +# Inits +exec-once = swww init +exec-once = swww img $HOME/med/pix/bg.png + +# Settings +input { + kb_layout = us + follow_mouse = 1 + accel_profile = flat + sensitivity = -0.52 + #sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification. +} + +general { + gaps_in = 3 + gaps_out = 3 + border_size = 2 + col.active_border = rgb(F5C2E7) + col.inactive_border = rgb(1E1D2F) + + layout = master + allow_tearing = true +} + +decoration { + rounding = 2 + blur { + enabled = true + size = 12 + passes = 2 + special = true + } + dim_special = 0.2 +} + +animations { + enabled = yes + + animation = windows, 1, 4, default, popin 50% + animation = windowsOut, 1, 4, default, popin 50% + animation = windowsMove, 1, 3, default + animation = border, 1, 3, default + animation = fade, 1, 3, default + animation = workspaces, 1, 3, default +} + +master { + no_gaps_when_only = true + new_is_master = false + mfact = 0.53 +} diff --git a/programs/hypr/window_rules.conf b/programs/hypr/window_rules.conf new file mode 100644 index 0000000..671e13c --- /dev/null +++ b/programs/hypr/window_rules.conf @@ -0,0 +1,36 @@ +env = HYPR_MON_PRIMARY, DP-2 +env = HYPR_MON_SECONDARY, DP-1 + +# Primaries +workspace=name:home, monitor:DP-2, persistent:true, default:true +workspace=name:game, monitor:DP-2, persistent:true +workspace=name:etc0, monitor:DP-2, persistent:true +# Secondaries +workspace=name:chat, monitor:DP-1, persistent:true, default:true +workspace=name:misc0, monitor:DP-1, persistent:true +# Switches +workspace=name:web , monitor:DP-1, persistent:true +workspace=name:med , monitor:DP-1, persistent:true +# Pseudo +workspace=special:mus, persistent:true +workspace=special:scratch, on-created-empty: [float; size 50% 50%; center] alacritty + +windowrule = workspace name:web, librewolf +windowrulev2 = workspace name:med, librewolf,title:Picture-in-Picture +windowrule = workspace name:chat, discord +windowrule = workspace name:chat, Beeper +windowrule = workspace name:game, lutris +windowrule = workspace name:game, explorer.exe +windowrule = workspace name:game, leagueclient.exe +windowrule = workspace name:game, leagueclientux.exe +windowrule = workspace name:game, league of legends.exe +windowrule = immediate, league of legends.exe + +windowrule = opacity 0.9 0.9,^(Alacritty)$ +windowrule = opacity 0.94 0.94,^(discord)$ + +env = HYPR_WORK_DB,$XDG_CACHE_HOME/hypr/workspace.db + +exec-once = [workspace special:mus silent;float;size 70% 70%;center] alacritty -e spt +exec-once = [workspace name:chat silent] Discord +exec-once = [workspace name:chat silent] beeper diff --git a/programs/hypr/xwaylandvideobridge.conf b/programs/hypr/xwaylandvideobridge.conf new file mode 100644 index 0000000..4b77ad2 --- /dev/null +++ b/programs/hypr/xwaylandvideobridge.conf @@ -0,0 +1,5 @@ +windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$ +windowrulev2 = noanim,class:^(xwaylandvideobridge)$ +windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ +windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ +windowrulev2 = noblur,class:^(xwaylandvideobridge)$