diff --git a/flake.lock b/flake.lock index e61be89..594f01f 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "catppuccin": { "locked": { - "lastModified": 1731232837, - "narHash": "sha256-0aIwr/RC/oe7rYkfJb47xjdEQDSNcqpFGsEa+EPlDEs=", + "lastModified": 1732703064, + "narHash": "sha256-n8XOmn0WGtQhAMJKTnhL/3ttV2ZahPRf6gtlqZ6R4QE=", "owner": "catppuccin", "repo": "nix", - "rev": "32359bf226fe874d3b7a0a5753d291a4da9616fe", + "rev": "2e2bdecf0bae287d74947cd5cf967c5c499c23c1", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1732284644, - "narHash": "sha256-REGLarOB5McRMmFtOgNihEXXQILY6+2UBAY8lw8CJCI=", + "lastModified": 1732645828, + "narHash": "sha256-+4U2I2653JvPFxcux837ulwYS864QvEueIljUkwytsk=", "owner": "nix-community", "repo": "disko", - "rev": "abc8baff333ac9dca930fc4921a26a8fc248e442", + "rev": "869ba3a87486289a4197b52a6c9e7222edf00b3e", "type": "github" }, "original": { @@ -155,39 +155,6 @@ "type": "indirect" } }, - "flake-parts_3": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1714606777, - "narHash": "sha256-bMkNmAXLj8iyTvxaaD/StcLSadbj1chPcJOjtuVnLmA=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "4d34ce6412bc450b1d4208c953dc97c7fc764f1a", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-root": { - "locked": { - "lastModified": 1713493429, - "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", - "owner": "srid", - "repo": "flake-root", - "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "flake-root", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems_3" @@ -224,24 +191,6 @@ "type": "github" } }, - "flake-utils_3": { - "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "git-hooks": { "inputs": { "flake-compat": "flake-compat_2", @@ -320,11 +269,11 @@ ] }, "locked": { - "lastModified": 1732303962, - "narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=", + "lastModified": 1732482255, + "narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=", "owner": "nix-community", "repo": "home-manager", - "rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c", + "rev": "a9953635d7f34e7358d5189751110f87e3ac17da", "type": "github" }, "original": { @@ -537,11 +486,11 @@ ] }, "locked": { - "lastModified": 1732234033, - "narHash": "sha256-94yZ7eJiLvW+UknI5RZBCV6OMHtoSv1oWyOwKjTmS88=", + "lastModified": 1732689435, + "narHash": "sha256-9Klse4XZraC6Ls+eelgLa35CAjTyTtfOWw/5HAHolTs=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "10e11c32a4f4f7c9d64f45413642ded11fc538b6", + "rev": "eebc41c930eff8e4e47e9398fc6bfdf843cacd00", "type": "github" }, "original": { @@ -553,11 +502,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1732229552, - "narHash": "sha256-7tA7IeOjx1wgDQnY7RxIhIuwcFeSZu4Yc3WtLh+22TE=", + "lastModified": 1732652521, + "narHash": "sha256-50bhYFPBB+Z8yKpEPtRoIU0aQS9oRBXaq7qtVAdcJlg=", "owner": "neovim", "repo": "neovim", - "rev": "ff75f345ab5fa57c6560db021e8eb099aff90472", + "rev": "d460928263d0ff53283f301dfcb85f5b6e17d2ac", "type": "github" }, "original": { @@ -575,11 +524,11 @@ ] }, "locked": { - "lastModified": 1732326467, - "narHash": "sha256-xbuuY3oaQWlysM15XGrNHtf1l+RE2GS0MwlDJA3W870=", + "lastModified": 1732688645, + "narHash": "sha256-SQBVnfTAhVmNs5mKjoe942GykhAh9RQbcqScK9XlsWM=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "094d813a79d1d12a891dc9c99d6842fcd009205d", + "rev": "6adec7f87f6c1d455f89f57bd697740bd6dc88fa", "type": "github" }, "original": { @@ -610,34 +559,13 @@ "type": "github" } }, - "nixd": { - "inputs": { - "flake-parts": "flake-parts_3", - "flake-root": "flake-root", - "nixpkgs": "nixpkgs_3", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1732342928, - "narHash": "sha256-87zIj5gt1wY0UmRXHnf4ydCJoweOX4HCS/nEbvEF0b8=", - "owner": "nix-community", - "repo": "nixd", - "rev": "5507bb141efc11cf548e87e39b61da66dfbca9e5", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixd", - "type": "github" - } - }, "nixos-hardware": { "locked": { - "lastModified": 1731797098, - "narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=", + "lastModified": 1732483221, + "narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6", + "rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405", "type": "github" }, "original": { @@ -663,24 +591,6 @@ } }, "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1714253743, - "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib_2": { "locked": { "lastModified": 1730504152, "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", @@ -694,11 +604,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1732521221, + "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", "type": "github" }, "original": { @@ -724,58 +634,9 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1730831018, - "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1701436327, - "narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", - "rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", - "revCount": 555097, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.555097%2Brev-91050ea1e57e50388fa87a3302ba12d188ef723a/018c3450-2363-7c34-883b-4ba70b1eb7ae/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" - } - }, - "nuenv": { - "inputs": { - "nixpkgs": "nixpkgs_4", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1731006591, - "narHash": "sha256-zCh7F0XKC5IEJKBTSNnUQ3SwJz3izPdxEU3C4udG8qI=", - "owner": "DeterminateSystems", - "repo": "nuenv", - "rev": "45693a438df82b3a604f855c3372f4f7d9efb3eb", - "type": "github" - }, - "original": { - "owner": "DeterminateSystems", - "repo": "nuenv", - "type": "github" - } - }, "parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { "lastModified": 1730504689, @@ -799,11 +660,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1732367223, - "narHash": "sha256-YdYoULSyTkTE6wUGlof91Vc7oO0cqFn3qomoO0pIZIQ=", + "lastModified": 1732694692, + "narHash": "sha256-Lemr3iLLRAdKUypPcU8DTLYwngygXpAjqIOHgt9DP0A=", "owner": "wamserma", "repo": "flake-programs-sqlite", - "rev": "69fbca8d0f628b43224cac25768f37da55783d97", + "rev": "87acbd6c1b8b7a07ce44a55d48aa27350307f16f", "type": "github" }, "original": { @@ -824,13 +685,11 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-minecraft": "nix-minecraft", "nix-search": "nix-search", - "nixd": "nixd", "nixos-hardware": "nixos-hardware", "nixpkgs": [ "nixpkgs-unstable" ], "nixpkgs-unstable": "nixpkgs-unstable", - "nuenv": "nuenv", "parts": "parts", "programsdb": "programsdb", "sops-nix": "sops-nix", @@ -839,28 +698,6 @@ ] } }, - "rust-overlay": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "nuenv", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1701397143, - "narHash": "sha256-nYUJxZXwCWWVBYZXPgRxGDuQcZRhKTtD/Jp5Jl+9EWU=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "bb71557c93cad40f5921b2342d7fd69f9e6497ab", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "sops-nix": { "inputs": { "nixpkgs": [ @@ -868,11 +705,11 @@ ] }, "locked": { - "lastModified": 1732186149, - "narHash": "sha256-N9JGWe/T8BC0Tss2Cv30plvZUYoiRmykP7ZdY2on2b0=", + "lastModified": 1732575825, + "narHash": "sha256-xtt95+c7OUMoqZf4OvA/7AemiH3aVuWHQbErYQoPwFk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "53c853fb1a7e4f25f68805ee25c83d5de18dc699", + "rev": "3433ea14fbd9e6671d0ff0dd45ed15ee4c156ffa", "type": "github" }, "original": { @@ -941,42 +778,6 @@ "type": "github" } }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixd", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, "utils": { "locked": { "lastModified": 1678901627, diff --git a/flake.nix b/flake.nix index 7b04459..b77359e 100644 --- a/flake.nix +++ b/flake.nix @@ -21,8 +21,8 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; - nixd.url = "github:nix-community/nixd"; - nuenv.url = "github:DeterminateSystems/nuenv"; + # nixd.url = "github:nix-community/nixd"; + # nuenv.url = "github:DeterminateSystems/nuenv"; # Fast nix search client nix-search = { diff --git a/home/modules/wayland/hyprland/binds.nix b/home/modules/wayland/hyprland/binds.nix new file mode 100644 index 0000000..2e2aa26 --- /dev/null +++ b/home/modules/wayland/hyprland/binds.nix @@ -0,0 +1,123 @@ +let + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + workspaces = 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); + + toggle = program: let + prog = builtins.substring 0 14 program; + in "pkill ${prog} || uwsm app -- ${program}"; + + runOnce = program: "pgrep ${program} || uwsm app -- ${program}"; +in { + wayland.windowManager.hyprland.settings = { + # mouse movements + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + + # binds + bind = + [ + # compositor commands + "$mod SHIFT, E, exec, pkill Hyprland" + "$mod, Q, killactive," + "$mod, F, fullscreen," + "$mod, G, togglegroup," + "$mod SHIFT, N, changegroupactive, f" + "$mod SHIFT, P, changegroupactive, b" + "$mod, R, togglesplit," + "$mod, T, togglefloating," + "$mod, P, pseudo," + "$mod ALT, ,resizeactive," + + # utility + # terminal + "$mod, Return, exec, uwsm app -- foot" + # logout menu + "$mod, Escape, exec, ${toggle "wlogout"} -p layer-shell" + # lock screen + "$mod, L, exec, ${runOnce "hyprlock"}" + # lock screen, to be used with the special key Fn+F10 on my keyboard + "$mod, I, exec, ${runOnce "hyprlock"}" + # select area to perform OCR on + "$mod, O, exec, ${runOnce "wl-ocr"}" + ", XF86Favorites, exec, ${runOnce "wl-ocr"}" + # open settings + # "$mod, U, exec, XDG_CURRENT_DESKTOP=gnome ${runOnce "gnome-control-center"}" + + # move focus + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # screenshot + # area + ", Print, exec, ${runOnce "grimblast"} --notify copysave area" + "$mod SHIFT, R, exec, ${runOnce "grimblast"} --notify copysave area" + + # current screen + "CTRL, Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output" + "$mod SHIFT CTRL, R, exec, ${runOnce "grimblast"} --notify --cursor copysave output" + + # all screens + "ALT, Print, exec, ${runOnce "grimblast"} --notify --cursor copysave screen" + "$mod SHIFT ALT, R, exec, ${runOnce "grimblast"} --notify --cursor copysave screen" + + # special workspace + "$mod SHIFT, grave, movetoworkspace, special" + "$mod, grave, togglespecialworkspace, eDP-1" + + # cycle workspaces + "$mod, bracketleft, workspace, m-1" + "$mod, bracketright, workspace, m+1" + + # cycle monitors + "$mod SHIFT, bracketleft, focusmonitor, l" + "$mod SHIFT, bracketright, focusmonitor, r" + + # send focused workspace to left/right monitors + "$mod SHIFT ALT, bracketleft, movecurrentworkspacetomonitor, l" + "$mod SHIFT ALT, bracketright, movecurrentworkspacetomonitor, r" + ] + ++ workspaces; + + bindr = [ + # launcher + #"$mod, SUPER_L, exec, ${toggle "anyrun"}" + ]; + + bindl = [ + # media controls + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioNext, exec, playerctl next" + + # volume + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ]; + + bindle = [ + # volume + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-" + + # backlight + ", XF86MonBrightnessUp, exec, brillo -q -u 300000 -A 5" + ", XF86MonBrightnessDown, exec, brillo -q -u 300000 -U 5" + ]; + }; +} diff --git a/home/modules/wayland/hyprland/default.nix b/home/modules/wayland/hyprland/default.nix index a5119db..1b42ce2 100644 --- a/home/modules/wayland/hyprland/default.nix +++ b/home/modules/wayland/hyprland/default.nix @@ -45,13 +45,12 @@ wpctl = "${pkgs.wireplumber}/bin/wpctl"; in { imports = [ - # ../../shared - # ../../foot ../../hyprlock ../../hyprpaper - # ../../programs/pyprland - # ../../programs/waybar ../../hypridle + ./binds.nix + ./rules.nix + ./settings.nix ]; home = { @@ -98,28 +97,33 @@ in { wayland.windowManager.hyprland = { enable = true; extraConfig = - (builtins.readFile ./hyprland.conf) - + '' + '' + # debug + + debug:disable_scale_checks=true + + # bindings bind=SUPER,P,exec,${lib.getExe pkgs.wofi} --show run --style=${./wofi.css} --term=footclient --prompt=Run - bind=SUPER,A,exec,${gblast} save area - bind=SUPER,S,exec,${gblast} save screen bind=SUPERCTRL,L,exec,${lib.getExe pkgs.hyprlock} - # audio volume bindings - bindel=,XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+ - bindel=,XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%- - bindl=,XF86AudioMute,exec,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle + + exec-once=~/.config/hypr/start-way-displays.sh exec-once=${lib.getExe pkgs.hyprpaper} exec-once=${pkgs.pyprland}/bin/pypr exec-once=${pkgs.blueman}/bin/blueman-applet exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator exec-once=${lib.getExe pkgs.pasystray} ''; - plugins = []; + systemd = { - enable = true; + enable = false; variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; }; + plugins = []; xwayland.enable = true; }; } diff --git a/home/modules/wayland/hyprland/rules.nix b/home/modules/wayland/hyprland/rules.nix new file mode 100644 index 0000000..16c2aa6 --- /dev/null +++ b/home/modules/wayland/hyprland/rules.nix @@ -0,0 +1,78 @@ +{lib, ...}: { + wayland.windowManager.hyprland.settings = { + # layer rules + layerrule = let + toRegex = list: let + elements = lib.concatStringsSep "|" list; + in "^(${elements})$"; + + lowopacity = [ + "bar" + "calendar" + "notifications" + "system-menu" + ]; + + highopacity = [ + "anyrun" + "osd" + "logout_dialog" + ]; + + blurred = lib.concatLists [ + lowopacity + highopacity + ]; + in [ + "blur, ${toRegex blurred}" + "xray 1, ${toRegex ["bar"]}" + "ignorealpha 0.5, ${toRegex (highopacity ++ ["music"])}" + "ignorealpha 0.2, ${toRegex lowopacity}" + ]; + + # window rules + windowrulev2 = [ + # telegram media viewer + "float, title:^(Media viewer)$" + + # Bitwarden extension + "float, title:^(.*Bitwarden Password Manager.*)$" + + # gnome calculator + "float, class:^(org.gnome.Calculator)$" + "size 360 490, class:^(org.gnome.Calculator)$" + + # allow tearing in games + "immediate, class:^(osu\!|cs2)$" + + # make Firefox/Zen PiP window floating and sticky + "float, title:^(Picture-in-Picture)$" + "pin, title:^(Picture-in-Picture)$" + + # throw sharing indicators away + "workspace special silent, title:^(Firefox — Sharing Indicator)$" + "workspace special silent, title:^(Zen — Sharing Indicator)$" + "workspace special silent, title:^(.*is sharing (your screen|a window)\.)$" + + # start spotify in ws9 + "workspace 9 silent, title:^(Spotify( Premium)?)$" + + # idle inhibit while watching videos + "idleinhibit focus, class:^(mpv|.+exe|celluloid)$" + "idleinhibit focus, class:^(zen)$, title:^(.*YouTube.*)$" + "idleinhibit fullscreen, class:^(zen)$" + + "dimaround, class:^(gcr-prompter)$" + "dimaround, class:^(xdg-desktop-portal-gtk)$" + "dimaround, class:^(polkit-gnome-authentication-agent-1)$" + + # fix xwayland apps + "rounding 0, xwayland:1" + "center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$" + "size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$" + + # don't render hyprbars on tiling windows + "plugin:hyprbars:nobar, floating:0" + ]; + }; +} diff --git a/home/modules/wayland/hyprland/settings.nix b/home/modules/wayland/hyprland/settings.nix new file mode 100644 index 0000000..c7cf89b --- /dev/null +++ b/home/modules/wayland/hyprland/settings.nix @@ -0,0 +1,148 @@ +{config, ...}: let + pointer = config.home.pointerCursor; + + cursorName = "Bibata-Modern-Classic-Hyprcursor"; +in { + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + env = [ + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "HYPRCURSOR_THEME,${cursorName}" + "HYPRCURSOR_SIZE,${toString pointer.size}" + ]; + + exec-once = [ + # finalize startup + "uwsm finalize" + # set cursor for HL itself + "hyprctl setcursor ${cursorName} ${toString pointer.size}" + "hyprlock" + ]; + + general = { + gaps_in = 5; + gaps_out = 5; + border_size = 1; + "col.active_border" = "rgba(88888888)"; + "col.inactive_border" = "rgba(00000088)"; + + allow_tearing = true; + resize_on_border = true; + }; + + decoration = { + rounding = 16; + blur = { + enabled = true; + brightness = 1.0; + contrast = 1.0; + noise = 0.01; + + vibrancy = 0.2; + vibrancy_darkness = 0.5; + + passes = 4; + size = 7; + + popups = true; + popups_ignorealpha = 0.2; + }; + + shadow = { + enabled = true; + color = "rgba(00000055)"; + ignore_window = true; + offset = "0 15"; + range = 100; + render_power = 2; + scale = 0.97; + }; + }; + + animations = { + enabled = true; + animation = [ + "border, 1, 2, default" + "fade, 1, 4, default" + "windows, 1, 3, default, popin 80%" + "workspaces, 1, 2, default, slide" + ]; + }; + + group = { + groupbar = { + font_size = 10; + gradients = false; + text_color = "rgb(b6c4ff)"; + }; + + "col.border_active" = "rgba(35447988)"; + "col.border_inactive" = "rgba(dce1ff88)"; + }; + + input = { + kb_layout = "us"; + + # focus change on cursor move + follow_mouse = 1; + accel_profile = "flat"; + touchpad.scroll_factor = 0.1; + }; + + dwindle = { + # keep floating dimensions while tiling + pseudotile = true; + preserve_split = true; + }; + + misc = { + # disable auto polling for config file changes + disable_autoreload = true; + + force_default_wallpaper = 0; + + # disable dragging animation + animate_mouse_windowdragging = false; + + # enable variable refresh rate (effective depending on hardware) + vrr = 1; + }; + + render.direct_scanout = true; + + # touchpad gestures + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + }; + + xwayland.force_zero_scaling = true; + + debug.disable_logs = false; + + plugin = { + hyprbars = { + bar_height = 20; + bar_precedence_over_border = true; + + # order is right-to-left + hyprbars-button = [ + # close + "rgb(ffb4ab), 15, , hyprctl dispatch killactive" + # maximize + "rgb(b6c4ff), 15, , hyprctl dispatch fullscreen 1" + ]; + }; + + hyprexpo = { + columns = 3; + gap_size = 4; + bg_col = "rgb(000000)"; + + enable_gesture = true; + gesture_distance = 300; + gesture_positive = false; + }; + }; + }; +} diff --git a/nixos/modules/gaming.nix b/nixos/modules/gaming.nix index 544712a..49bc93c 100644 --- a/nixos/modules/gaming.nix +++ b/nixos/modules/gaming.nix @@ -6,6 +6,7 @@ environment.systemPackages = with pkgs; [ heroic steam + gamescope dosbox protontricks shattered-pixel-dungeon diff --git a/nixos/modules/greetd.nix b/nixos/modules/greetd.nix index 4b6dc05..5c974d9 100644 --- a/nixos/modules/greetd.nix +++ b/nixos/modules/greetd.nix @@ -20,16 +20,13 @@ TTYVTDisallocate = true; }; - # nice but buggy: https://github.com/rharish101/ReGreet/issues/45 - programs.regreet = { - enable = false; - settings = - (lib.importTOML ./regreet.toml) - // { - background = { - path = ../imgs/hyprland.png; - }; - }; + programs.uwsm = { + enable = true; + waylandCompositors.hyprland = { + binPath = "/run/current-system/sw/bin/Hyprland"; + prettyName = "Hyprland"; + comment = "Hyprland managed by UWSM"; + }; }; services = { @@ -45,22 +42,18 @@ # User's credentials manager gnome.gnome-keyring.enable = true; - # Init session with hyprland - greetd = { + # greetd display manager + greetd = let + session = { + command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop"; + user = "bruce"; + }; + in { enable = true; - settings = rec { - regreet_session = { - command = "${lib.getExe pkgs.cage} -s -- ${lib.getExe pkgs.greetd.regreet}"; - user = "greeter"; - }; - tuigreet_session = let - session = "${pkgs.hyprland}/bin/Hyprland"; - tuigreet = "${lib.getExe pkgs.greetd.tuigreet}"; - in { - command = "${tuigreet} --time --remember --cmd ${session}"; - user = "greeter"; - }; - default_session = tuigreet_session; + settings = { + terminal.vt = 1; + default_session = session; + initial_session = session; }; };