From 32393d5ffe6f6b5f5fd06e55d6d703b91ce4b71d Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sun, 31 May 2026 14:41:17 -0700 Subject: [PATCH] [Hyprland] Migrates to new lua-based config --- flake.lock | 553 +++++++++++++++++- flake.nix | 4 + home-manager/apps/discord.nix | 4 - home-manager/features/gaming.nix | 41 +- home-manager/features/hypr/config/.luarc.json | 7 + .../features/hypr/config/autostart.lua | 3 + .../features/hypr/config/hyprland.lua | 384 ++++++++++++ home-manager/features/hypr/hyprland.nix | 123 ++++ home-manager/features/hyprland.nix | 511 ---------------- home-manager/features/linux-desktop.nix | 2 +- home-manager/features/mounts/mcp-archive.nix | 30 +- .../neovim/config/lua/plugins/lsp.lua | 7 +- .../rofi/config/powermenu/powermenu.sh | 34 +- home-manager/features/rofi/rofi.nix | 11 +- home-manager/features/wallpaper.nix | 7 +- system/features/gui.nix | 2 +- system/hosts/altair/configuration.nix | 2 +- system/hosts/altair/drew.nix | 25 +- .../hosts/altair/hardware-configuration.nix | 2 +- system/hosts/vega/drew.nix | 41 +- 20 files changed, 1168 insertions(+), 625 deletions(-) create mode 100644 home-manager/features/hypr/config/.luarc.json create mode 100644 home-manager/features/hypr/config/autostart.lua create mode 100644 home-manager/features/hypr/config/hyprland.lua create mode 100644 home-manager/features/hypr/hyprland.nix delete mode 100644 home-manager/features/hyprland.nix diff --git a/flake.lock b/flake.lock index dfc747e..de612b0 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,81 @@ { "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprsplit", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1778620495, + "narHash": "sha256-Gu7UhWjwKCgSiVC3Qz/Rc7cYi9DNuDTBxYzg3kfLvfM=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "be35f75ac305f430f5f9d89b5f5a4af59ca7567e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprsplit", + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,7 +97,395 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprsplit", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1776511930, + "narHash": "sha256-fCpwFiTW0rT7oKJqr3cqHMnkwypSwQKpbtUEtxdkgrM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "39435900785d0c560c6ae8777d29f28617d031ef", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1776426399, + "narHash": "sha256-RUESLKNikIeEq9ymGJ6nmcDXiSFQpUW1IhJ245nL3xM=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "68d064434787cf1ed4a2fe257c03c5f52f33cf84", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-guiutils": "hyprland-guiutils", + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "hyprwire": "hyprwire", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1779392427, + "narHash": "sha256-0SiD8JBx6cU0KL1XjLMsR/nSZB5XY3uhrNnvfxH0CtY=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "8b7110cc68662a343b6839f292ac0f44a64c3364", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-guiutils": { + "inputs": { + "aquamarine": [ + "hyprsplit", + "hyprland", + "aquamarine" + ], + "hyprgraphics": [ + "hyprsplit", + "hyprland", + "hyprgraphics" + ], + "hyprlang": [ + "hyprsplit", + "hyprland", + "hyprlang" + ], + "hyprtoolkit": "hyprtoolkit", + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprsplit", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1776426575, + "narHash": "sha256-KI6nIfVihn/DPaeB5Et46Xg3dkNHrrEtUd5LBBVomB0=", + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "rev": "a968d211048e3ed538e47b84cb3649299578f19d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-guiutils", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1772460177, + "narHash": "sha256-/6G/MsPvtn7bc4Y32pserBT/Z4SUUdBd4XYJpOEKVR4=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "1cb6db5fd6bb8aee419f4457402fa18293ace917", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1777320127, + "narHash": "sha256-Qu+Wf2Bp5qUjyn2YpZNq8a7JyzTGowhT1knrwE38a9U=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "090117506ddc3d7f26e650ff344d378c2ec329cc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprsplit": { + "inputs": { + "hyprland": "hyprland", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779414137, + "narHash": "sha256-XpwuFhwnfwPbzImZeUWWns///UEpoKNkpl1hN90C3Ag=", + "owner": "shezdy", + "repo": "hyprsplit", + "rev": "0fc01e7930625ecb3e069f5dc8e1d61eab929f3b", + "type": "github" + }, + "original": { + "owner": "shezdy", + "repo": "hyprsplit", + "type": "github" + } + }, + "hyprtoolkit": { + "inputs": { + "aquamarine": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "aquamarine" + ], + "hyprgraphics": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "hyprgraphics" + ], + "hyprlang": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "hyprlang" + ], + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "hyprland-guiutils", + "systems" + ] + }, + "locked": { + "lastModified": 1772462885, + "narHash": "sha256-5pHXrQK9zasMnIo6yME6EOXmWGFMSnCITcfKshhKJ9I=", + "owner": "hyprwm", + "repo": "hyprtoolkit", + "rev": "9af245a69fa6b286b88ddfc340afd288e00a6998", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprtoolkit", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1778234770, + "narHash": "sha256-jAcsogZwWMfXT9MfXxZzkwliAqIuZUV0p71h6Ba9ReE=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "a2dbd8a4cc51f7cbe4224732668392bb1aa79df2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1777159683, + "narHash": "sha256-Jxixw6wZphUp+nHYxOKUYSckL17QMBx2d5Zp0rJHr1g=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "b8632713a6beaf28b56f2a7b0ab2fb7088dbb404", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "hyprwire": { + "inputs": { + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1778410714, + "narHash": "sha256-o6RzFj4nJXaPRY7EM01siuCQeT41RfwwmcmFQqwFJJg=", + "owner": "hyprwm", + "repo": "hyprwire", + "rev": "85148a8e612808cf5ddb25d0b3c5840f3498a7dc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwire", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1778443072, + "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1779971959, "narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=", @@ -37,10 +501,35 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778507602, + "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "hyprsplit": "hyprsplit", + "nixpkgs": "nixpkgs_2", "sops-nix": "sops-nix", "zen-browser": "zen-browser" } @@ -65,6 +554,68 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprsplit", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprsplit", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprsplit", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprsplit", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprsplit", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprsplit", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1778265244, + "narHash": "sha256-8jlPtGSsv/CQY6tVVyLF4Jjd0gnS+Zbn9yk/V13A9nM=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "813ea5ca9a1702a9a2d1f5836bc00172ef698968", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, "zen-browser": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 014dfb2..4608ba7 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,10 @@ url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprsplit = { + url = "github:shezdy/hyprsplit"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = diff --git a/home-manager/apps/discord.nix b/home-manager/apps/discord.nix index c6cfef1..75ada6d 100644 --- a/home-manager/apps/discord.nix +++ b/home-manager/apps/discord.nix @@ -11,8 +11,4 @@ exec = "env ELECTRON_OZONE_PLATFORM_HINT= discord --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-gpu"; }; }; - wayland.windowManager.hyprland.settings.bind = [ - # Pass Mouse4 through to discord - # ", mouse:275, pass, class:^discord$" - ]; } diff --git a/home-manager/features/gaming.nix b/home-manager/features/gaming.nix index 1c18210..d586789 100644 --- a/home-manager/features/gaming.nix +++ b/home-manager/features/gaming.nix @@ -108,24 +108,25 @@ in }; }; - wayland.windowManager.hyprland.settings.windowrule = [ - # Set up full-screen games on monitor 1 (since window 0 is the vertical one.) - # "match:class ^steam_app_\d+$, float" - "match:class ^steam_app_\d+$, fullscreen 1, monitor 1" - "match:class ^steam_app_\d+$, center on" - - # Make sure WoW spawns on the right monitor and that Battlenet floats so it renders correctly - "match:title ^World of Warcraft$, monitor 1" - "match:title ^World of Warcraft$, fullscreen on" - "match:title ^Battle.net$, monitor 1" - "match:title ^Battle.net$, float on" - - # Make Balatro into a regular window. - "match:title ^Balatro$, monitor 1" - "match:title ^Balatro$, tile on" - - # Load Cyberpunk 2077 on the right monitor. - "match:class steam_app_1091500, monitor 1" - "match:class steam_app_1091500, fullscreen on" - ]; + # TODO: Merge into config + # wayland.windowManager.hyprland.settings.windowrule = [ + # # Set up full-screen games on monitor 1 (since window 0 is the vertical one.) + # # "match:class ^steam_app_\d+$, float" + # "match:class ^steam_app_\d+$, fullscreen 1, monitor 1" + # "match:class ^steam_app_\d+$, center on" + # + # # Make sure WoW spawns on the right monitor and that Battlenet floats so it renders correctly + # "match:title ^World of Warcraft$, monitor 1" + # "match:title ^World of Warcraft$, fullscreen on" + # "match:title ^Battle.net$, monitor 1" + # "match:title ^Battle.net$, float on" + # + # # Make Balatro into a regular window. + # "match:title ^Balatro$, monitor 1" + # "match:title ^Balatro$, tile on" + # + # # Load Cyberpunk 2077 on the right monitor. + # "match:class steam_app_1091500, monitor 1" + # "match:class steam_app_1091500, fullscreen on" + # ]; } diff --git a/home-manager/features/hypr/config/.luarc.json b/home-manager/features/hypr/config/.luarc.json new file mode 100644 index 0000000..aa1f83a --- /dev/null +++ b/home-manager/features/hypr/config/.luarc.json @@ -0,0 +1,7 @@ +{ + "workspace": { + "library": [ + "/nix/store/ndq4688w4wjlip63msnlxld8zwcwr66l-hyprland-0.55.2/share/hypr/stubs" + ] + } +} diff --git a/home-manager/features/hypr/config/autostart.lua b/home-manager/features/hypr/config/autostart.lua new file mode 100644 index 0000000..048c789 --- /dev/null +++ b/home-manager/features/hypr/config/autostart.lua @@ -0,0 +1,3 @@ +hl.on("hyprland.start", function() + hl.exec_cmd("eww open-many primary-statusbar secondary-statusbar") +end) diff --git a/home-manager/features/hypr/config/hyprland.lua b/home-manager/features/hypr/config/hyprland.lua new file mode 100644 index 0000000..dec1a09 --- /dev/null +++ b/home-manager/features/hypr/config/hyprland.lua @@ -0,0 +1,384 @@ +local browser = "zen --new-window" +local mainMod = "SUPER + ALT" +local menu = "rofi -show combi -combi-modes drun,ssh,run -theme ~/.config/rofi/launcher/style.rasi" +local terminal = "foot" + +local split = require("hyprsplit") + +split.config({ + num_workspaces = 10, + persistent_workspaces = true, +}) + +hl.config({ + general = { + allow_tearing = false, + border_size = 2, + col = { + active_border = { + colors = { "rgba(eeeeffee)", "rgba(3366ffee)" }, + angle = 45, + }, + inactive_border = "rgba(595959aa)", + }, + gaps_in = 5, + gaps_out = 10, + layout = "hy3", + resize_on_border = true, + }, + decoration = { + active_opacity = 1.000000, + blur = { + enabled = true, + passes = 1, + size = 3, + vibrancy = 0.169600, + }, + inactive_opacity = 1.000000, + rounding = 5, + shadow = { + color = "rgba(1a1a1aee)", + enabled = true, + range = 5, + render_power = 3, + }, + }, + input = { + follow_mouse = 1, + kb_layout = "us", + kb_options = "compose:ralt", + sensitivity = 0, + touchpad = { + natural_scroll = false, + }, + }, + misc = { + disable_hyprland_logo = true, + force_default_wallpaper = 0, + vrr = 1, + }, + debug = { + disable_logs = false, + }, + cursor = { + no_hardware_cursors = true, + }, + animations = { + enabled = true, + }, + -- plugin = { + -- hy3 = { + -- group_inset = 10, + -- no_gaps_when_only = 0, + -- node_collapse_policy = 2, + -- tab_first_window = false, + -- tabs = { + -- height = 20, + -- rounding = 2, + -- text_height = 10, + -- }, + -- }, + -- }, +}) + +hl.device({ + name = "logitech-g502-1", + sensitivity = -0.200000, +}) + +hl.monitor({ + output = "DP-2", + mode = "3440x1440@164", + position = "0x0", +}) +hl.monitor({ + output = "DP-1", + mode = "2560x1440", + position = "-1440x-510", + -- 0 -> normal (no transforms) + -- 1 -> 90 degrees + -- 2 -> 180 degrees + -- 3 -> 270 degrees + -- 4 -> flipped + -- 5 -> flipped + 90 degrees + -- 6 -> flipped + 180 degrees + -- 7 -> flipped + 270 degrees + transform = 1, +}) + +hl.workspace_rule({ workspace = "1" }) +hl.workspace_rule({ workspace = "2" }) +hl.workspace_rule({ workspace = "3" }) +hl.workspace_rule({ workspace = "4" }) +hl.workspace_rule({ workspace = "5" }) +hl.workspace_rule({ workspace = "6" }) +hl.workspace_rule({ workspace = "7" }) +hl.workspace_rule({ workspace = "8" }) +hl.workspace_rule({ workspace = "9" }) +hl.workspace_rule({ workspace = "10" }) +hl.workspace_rule({ workspace = "11" }) +hl.workspace_rule({ workspace = "12" }) +hl.workspace_rule({ workspace = "13" }) +hl.workspace_rule({ workspace = "14" }) +hl.workspace_rule({ workspace = "15" }) +hl.workspace_rule({ workspace = "16" }) +hl.workspace_rule({ workspace = "17" }) +hl.workspace_rule({ workspace = "18" }) +hl.workspace_rule({ workspace = "19" }) +hl.workspace_rule({ workspace = "20" }) + +hl.window_rule({ match = "match:class Rofi", stay_focused = true }) +-- hl.window_rule({ match = { class = "suppress_event maximize" }, "match:class" = ".*" }) +-- hl.window_rule({ match = { class = "fullscreen 1" }, "match:class" = "^steam_app_d+$" }) +-- PATTERN: MERGED with line 208 +-- MIGRATION_WARNING: Window rule conflict for 'center on': 'match:class ^steam_app_d+$' (line 199) vs 'match:class Rofi' (line 208) +-- hl.window_rule({ match = { class = "center on" }, match:class = "^steam_app_d+$", match:class = "Rofi" }) +-- PATTERN: MERGED with line 202 +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Battle.net$' (line 202) +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Balatro$' (line 204) +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:class steam_app_1091500' (line 206) +-- hl.window_rule({ +-- match = { class = "monitor 1" }, +-- match:title = "^World of Warcraft$", +-- match:title = "^Battle.net$", +-- match:title = "^Balatro$", +-- match:class = "steam_app_1091500", +-- }) +-- PATTERN: MERGED with line 207 +-- MIGRATION_WARNING: Window rule conflict for 'fullscreen on': 'match:title ^World of Warcraft$' (line 201) vs 'match:class steam_app_1091500' (line 207) +-- hl.window_rule({ match = { class = "fullscreen on" }, match:title = "^World of Warcraft$", match:class = "steam_app_1091500" }) +-- hl.window_rule({ match = { class = "float on" }, match:title = "^Battle.net$" }) +-- hl.window_rule({ match = { class = "tile on" }, match:title = "^Balatro$" }) + +hl.bind("SUPER + ALT + T", function() + hl.exec_cmd(terminal) +end) +hl.bind("SUPER + ALT + B", function() + hl.exec_cmd(browser) +end) +hl.bind("SUPER + ALT + D", function() + hl.exec_cmd(menu) +end) +hl.bind("SUPER + ALT + SHIFT + S", function() + hl.exec_cmd("hyprshot -m region --clipboard-only") +end) +hl.bind("SUPER + ALT + CTRL + SHIFT + S", function() + hl.exec_cmd("hyprshot -m region -o ~/Pictures") +end) +hl.bind("SUPER + ALT + C", function() + hl.exec_cmd("swaync-client -t") +end) +hl.bind("SUPER + ALT + CTRL + Q", function() + hl.exec_cmd("/home/drew/.config/rofi/powermenu/powermenu.sh") +end) +hl.bind("SUPER + ALT + X", function() + hl.exec_cmd("/home/drew/.config/rofi/powermenu/powermenu.sh") +end) +hl.bind("SUPER + ALT + F", hl.dsp.window.float({ action = "toggle" })) +hl.bind("SUPER + ALT + SHIFT + F", hl.dsp.window.fullscreen({ action = "toggle" })) +hl.bind("SUPER + ALT + CTRL + left", hl.dsp.window.resize({ x = -20, y = 0 })) +hl.bind("SUPER + ALT + CTRL + right", hl.dsp.window.resize({ x = 20, y = 0 })) +hl.bind("SUPER + ALT + CTRL + down", hl.dsp.window.resize({ x = 0, y = 20 })) +hl.bind("SUPER + ALT + CTRL + up", hl.dsp.window.resize({ x = 0, y = -20 })) +hl.bind("SUPER + ALT + R", hl.dsp.focus({ monitor = "next" })) +-- +hl.bind("SUPER + ALT + r", hl.dsp.focus({ monitor = "l" })) +hl.bind("SUPER + ALT + s", hl.dsp.focus({ monitor = "r" })) + +local hy3 = hl.plugin.hy3 + +hl.bind("SUPER + ALT + Q", hy3.kill_active()) +hl.bind("SUPER + ALT + G", hy3.make_group("opposite")) +hl.bind("SUPER + ALT + W", hy3.make_group("tab", { toggle = true })) +hl.bind("SUPER + ALT + A", hy3.change_focus("raise")) +hl.bind("SUPER + ALT + Z", hy3.change_focus("lower")) +hl.bind("SUPER + ALT + O", hy3.change_group("opposite")) +hl.bind("SUPER + ALT + left", hy3.move_focus("left")) +hl.bind("SUPER + ALT + right", hy3.move_focus("right")) +hl.bind("SUPER + ALT + up", hy3.move_focus("up")) +hl.bind("SUPER + ALT + down", hy3.move_focus("down")) +hl.bind("SUPER + ALT + SHIFT + left", hy3.move_window("left")) +hl.bind("SUPER + ALT + SHIFT + right", hy3.move_window("right")) +hl.bind("SUPER + ALT + SHIFT + up", hy3.move_window("up")) +hl.bind("SUPER + ALT + SHIFT + down", hy3.move_window("down")) + +-- Workspace binds +for i = 1, 10 do + hl.bind("SUPER + ALT + " .. (i % 10), split.dsp.focus({ workspace = tostring(i) })) + hl.bind("SUPER + ALT + SHIFT + " .. (i % 10), hy3.move_to_workspace(tostring(i))) +end + +hl.bind("SUPER + ALT + SHIFT + r", hl.dsp.window.move({ monitor = "+1" })) +hl.bind(" + XF86AudioRaiseVolume", function() + hl.exec_cmd("swayosd-client --output-volume raise") +end, { locked = true }) +hl.bind(" + XF86AudioLowerVolume", function() + hl.exec_cmd("swayosd-client --output-volume lower") +end, { locked = true }) +hl.bind(" + XF86AudioMute", function() + hl.exec_cmd("swayosd-client --output-volume mute-toggle") +end, { locked = true }) +hl.bind(" + XF86AudioMicMute", function() + hl.exec_cmd("swayosd-client --input-volume mute-toggle") +end, { locked = true }) +hl.bind(" + XF86MonBrightnessUp", function() + hl.exec_cmd("brightnessctl s 10%+") +end, { locked = true }) +hl.bind(" + XF86MonBrightnessDown", function() + hl.exec_cmd("brightnessctl s 10%-") +end, { locked = true }) +hl.bind(" + XF86AudioNext", function() + hl.exec_cmd("playerctl next") +end, { locked = true }) +hl.bind(" + XF86AudioPause", function() + hl.exec_cmd("playerctl play-pause") +end, { locked = true }) +hl.bind(" + XF86AudioPlay", function() + hl.exec_cmd("playerctl play-pause") +end, { locked = true }) +hl.bind(" + XF86AudioPrev", function() + hl.exec_cmd("playerctl previous") +end, { locked = true }) +hl.bind("SUPER + mouse:272", hl.dsp.window.drag(), { mouse = true }) +hl.bind("SUPER + mouse:273", hl.dsp.window.resize(), { mouce = true }) +-- hl.bind(" + mouse:272", hl.dsp.hy3:focustab({ mouse })) --, { non_consuming = true } + +hl.on("hyprland.start", function() + hl.exec_cmd("hyprctl plugin load /nix/store/faphbyy63c9v1m6a7dl3ash30vy8bap9-hy3-0.55.0/lib/libhy3.so") + hl.exec_cmd("nm-applet") + hl.exec_cmd("sleep 2 && hyprpm reload -n") + hl.exec_cmd("systemctl --user start hyprpolkitagent") + hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'") + hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'") + hl.exec_cmd("wpaperd") + hl.exec_cmd("sleep 2 && eww open-many primary-statusbar secondary-statusbar") + hl.exec_cmd("xrandr --output DP-2 --primary") +end) + +hl.curve("easeOutQuint", { + type = "bezier", + points = { { 0.23, 1.0 }, { 0.32, 1.0 } }, +}) +hl.curve("easeInOutCubic", { + type = "bezier", + points = { { 0.65, 0.05 }, { 0.36, 1.0 } }, +}) +hl.curve("linear", { + type = "bezier", + points = { { 0.0, 0.0 }, { 1.0, 1.0 } }, +}) +hl.curve("almostLinear", { + type = "bezier", + points = { { 0.5, 0.5 }, { 0.75, 1.0 } }, +}) +hl.curve("quick", { + type = "bezier", + points = { { 0.15, 0.0 }, { 0.1, 1.0 } }, +}) + +hl.animation({ + leaf = "global", + enabled = true, + speed = 10.0, + bezier = "default", +}) +hl.animation({ + leaf = "border", + enabled = true, + speed = 5.39, + bezier = "easeOutQuint", +}) +hl.animation({ + leaf = "windows", + enabled = true, + speed = 4.79, + bezier = "easeOutQuint", +}) +hl.animation({ + leaf = "windowsIn", + enabled = true, + speed = 4.1, + bezier = "easeOutQuint", + style = "popin 87%", +}) +hl.animation({ + leaf = "windowsOut", + enabled = true, + speed = 1.49, + bezier = "linear", + style = "popin 87%", +}) +hl.animation({ + leaf = "fadeIn", + enabled = true, + speed = 1.73, + bezier = "almostLinear", +}) +hl.animation({ + leaf = "fadeOut", + enabled = true, + speed = 1.46, + bezier = "almostLinear", +}) +hl.animation({ + leaf = "fade", + enabled = true, + speed = 3.03, + bezier = "quick", +}) +hl.animation({ + leaf = "layers", + enabled = true, + speed = 3.81, + bezier = "easeOutQuint", +}) +hl.animation({ + leaf = "layersIn", + enabled = true, + speed = 4.0, + bezier = "easeOutQuint", + style = "fade", +}) +hl.animation({ + leaf = "layersOut", + enabled = true, + speed = 1.5, + bezier = "linear", + style = "fade", +}) +hl.animation({ + leaf = "fadeLayersIn", + enabled = true, + speed = 1.79, + bezier = "almostLinear", +}) +hl.animation({ + leaf = "fadeLayersOut", + enabled = true, + speed = 1.39, + bezier = "almostLinear", +}) +hl.animation({ + leaf = "workspaces", + enabled = true, + speed = 1.94, + bezier = "almostLinear", + style = "fade", +}) +hl.animation({ + leaf = "workspacesIn", + enabled = true, + speed = 1.21, + bezier = "almostLinear", + style = "fade", +}) +hl.animation({ + leaf = "workspacesOut", + enabled = true, + speed = 1.94, + bezier = "almostLinear", + style = "fade", +}) + +-- Additional configs +require("config.autostart") diff --git a/home-manager/features/hypr/hyprland.nix b/home-manager/features/hypr/hyprland.nix new file mode 100644 index 0000000..3583d1e --- /dev/null +++ b/home-manager/features/hypr/hyprland.nix @@ -0,0 +1,123 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + ../swaylock.nix + ./hypridle.nix + ]; + + xdg.configFile = { + "hypr/hyprsplit" = { + source = "${inputs.hyprsplit}"; + recursive = true; + }; + + "hypr/base.lua" = { + source = ./config/hyprland.lua; + }; + "hypr/config" = { + source = ./config; + recursive = true; + }; + }; + + home.packages = with pkgs; [ + swayosd # volume pop-up + swaynotificationcenter # notifications + hyprpolkitagent # Privilege managent + hyprshot # Screenshot utility + + # For clipboard management. See below. + wl-clipboard + xclip + ]; + + wayland.windowManager.hyprland = { + enable = true; + + # TODO: Switch to the newer LUA config? + configType = "lua"; + + plugins = [ + # https://github.com/outfoxxed/hy3 + pkgs.hyprlandPlugins.hy3 + ]; + + extraConfig = '' + require("config.hyprland") + ''; + + # Disable systemd because it conflicts with UWSM + systemd.enable = false; + + }; + + programs.hyprlock = { + enable = false; + settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + }; + + background = { + monitor = ""; + color = "rgb(000000)"; + }; + + # Time + label = { + monitor = ""; + text = '' + cmd[update:1000] echo "$(date '+%F %T')" + ''; + font_size = 96; + font_family = "NotoSans Nerd Font"; + color = "rgb(990000)"; + position = "0, 0"; + halign = "center"; + valign = "center"; + }; + + input-field = { + monitor = ""; + size = "300, 40"; + fade_on_empty = true; + outline_thickness = 2; + outer_color = "rgb(cc2222) rgb(661111)"; + inner_color = "rgb(221111)"; + + font_color = "rgb(cc2222)"; + dots_size = 0.2; + dots_spacing = 0.1; + placeholder_text = ""; + + fail_color = "rgb(cc3333)"; + capslock_color = "rgb(cccc33)"; + + halign = "center"; + valign = "center"; + position = "0, -300px"; + }; + }; + }; + + # UWSM sessions should not use Hyprland's variables but instead use UWSM's variable management. + # See https://wiki.hyprland.org/Configuring/Environment-variables/ + home.file.".config/uwsm/env".text = '' + export XCURSOR_SIZE="32" + export HYPRCURSOR_SIZE="32" + export HYPRCURSOR_THEME="phinger" + + # Nvidia config + export LIBVA_DRIVER_NAME="nvidia" + export __GLX_VENDOR_LIBRARY_NAME="nvidia" + + # For window theming + export QT_QPA_PLATFORMTHEME="qt6ct # for Qt apps" + export GTK_THEME="Adwaita-dark" + + # Tell electron apps they should use OZone for Wayland + export ELECTRON_OZONE_PLATFORM_HINT="auto" + ''; + +} diff --git a/home-manager/features/hyprland.nix b/home-manager/features/hyprland.nix deleted file mode 100644 index f123a67..0000000 --- a/home-manager/features/hyprland.nix +++ /dev/null @@ -1,511 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./swaylock.nix - ./hypr/hypridle.nix - ]; - - home.packages = with pkgs; [ - swayosd # volume pop-up - swaynotificationcenter # notifications - hyprpolkitagent # Privilege managent - hyprshot # Screenshot utility - - # For clipboard management. See below. - wl-clipboard - xclip - ]; - - wayland.windowManager.hyprland = { - enable = true; - - # TODO: Switch to the newer LUA config? - configType = "hyprlang"; - - plugins = [ - # https://github.com/outfoxxed/hy3 - pkgs.hyprlandPlugins.hy3 - # https://github.com/shezdy/hyprsplit - # TODO: Fails to build - # pkgs.hyprlandPlugins.hyprsplit - ]; - - # Disable systemd because it conflicts with UWSM - systemd.enable = false; - - settings = { - debug = { - disable_logs = false; - }; - - monitor = [ - "DP-2, 3440x1440@164.90, 0x0, 1" - "DP-1, 2560x1440, -1440x-510, 1, transform, 1" - ]; - - "$terminal" = "foot"; - "$menu" = "rofi -show combi -combi-modes drun,ssh,run -theme ~/.config/rofi/launcher/style.rasi"; - "$browser" = "zen --new-window"; - - exec-once = [ - "nm-applet" - "sleep 2 && hyprpm reload -n" - "systemctl --user start hyprpolkitagent" - - "gsettings set org.gnome.desktop.interface color-scheme \"prefer-dark\"" - "gsettings set org.gnome.desktop.interface gtk-theme \"Adwaita-dark\"" - # Hyprland doesn't paste into Firefox or Wine apps. This program is a workaround. - # See https://github.com/hyprwm/Hyprland/issues/2319 - # - # However, it also sometimes gets messed up and prevents all copy-paste. Disabling unless I need it. - # - # -t text = Only handle text - # -w xclip -selection clipboard = Watch for events and invoke xclip - # "wl-paste -t text -w xclip -selection clipboard" - ]; - - general = { - gaps_in = 5; - gaps_out = 10; - - border_size = 2; - - # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors - "col.active_border" = "rgba(eeeeffee) rgba(3366ffee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - - # Set to true enable resizing windows by clicking and dragging on borders and gaps - resize_on_border = true; - - # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on - allow_tearing = false; - - layout = "hy3"; - }; - - # https://wiki.hyprland.org/Configuring/Variables/#decoration - decoration = { - rounding = 5; - - # Change transparency of focused and unfocused windows - active_opacity = 1.0; - inactive_opacity = 1.0; - - shadow = { - enabled = true; - range = 5; - render_power = 3; - color = "rgba(1a1a1aee)"; - }; - - # https://wiki.hyprland.org/Configuring/Variables/#blur - blur = { - enabled = true; - size = 3; - passes = 1; - vibrancy = 0.1696; - }; - }; - - # https://wiki.hyprland.org/Configuring/Variables/#animations - animations = { - enabled = "yes"; - - # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = [ - "easeOutQuint,0.23,1,0.32,1" - "easeInOutCubic,0.65,0.05,0.36,1" - "linear,0,0,1,1" - "almostLinear,0.5,0.5,0.75,1.0" - "quick,0.15,0,0.1,1" - ]; - - animation = [ - "global, 1, 10, default" - "border, 1, 5.39, easeOutQuint" - "windows, 1, 4.79, easeOutQuint" - "windowsIn, 1, 4.1, easeOutQuint, popin 87%" - "windowsOut, 1, 1.49, linear, popin 87%" - "fadeIn, 1, 1.73, almostLinear" - "fadeOut, 1, 1.46, almostLinear" - "fade, 1, 3.03, quick" - "layers, 1, 3.81, easeOutQuint" - "layersIn, 1, 4, easeOutQuint, fade" - "layersOut, 1, 1.5, linear, fade" - "fadeLayersIn, 1, 1.79, almostLinear" - "fadeLayersOut, 1, 1.39, almostLinear" - "workspaces, 1, 1.94, almostLinear, fade" - "workspacesIn, 1, 1.21, almostLinear, fade" - "workspacesOut, 1, 1.94, almostLinear, fade" - ]; - }; - - # https://wiki.hyprland.org/Configuring/Variables/#misc - misc = { - force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers - disable_hyprland_logo = true; # If true disables the random hyprland logo / anime girl background. :( - vrr = 1; # Enable variable refresh rate - }; - - cursor = { - no_hardware_cursors = true; - }; - - ############### - ### PLUGINS ### - ############### - - plugin = { - hy3 = { - # disable gaps when only one window is onscreen - # 0 - always show gaps - # 1 - hide gaps with a single window onscreen - # 2 - 1 but also show the window border - no_gaps_when_only = 0; # default: 0 - - # policy controlling what happens when a node is removed from a group, - # leaving only a group - # 0 = remove the nested group - # 1 = keep the nested group - # 2 = keep the nested group only if its parent is a tab group - node_collapse_policy = 2; # default: 2 - - # offset from group split direction when only one window is in a group - group_inset = 10; # default: 10 - - # if a tab group will automatically be created for the first window spawned in a workspace - tab_first_window = false; - - # tab group settings - tabs = { - # height of the tab bar - height = 20; # default: 15 - - # padding between the tab bar and its focused node - # padding = # default: 5 - - # the tab bar should animate in/out from the top instead of below the window - # from_top = # default: false - - # rounding of tab bar corners - rounding = 2; # default: 3 - - # render the window title on the bar - # render_text = # default: true - - # center the window title - # text_center = # default: false - - # font to render the window title with - # text_font = # default: Sans - - # height of the window title - text_height = 10; # default: 8 - - # left padding of the window title - # text_padding = # default: 3 - - # active tab bar segment color - # col.active = # default: 0xff32b4ff - - # urgent tab bar segment color - # col.urgent = # default: 0xffff4f4f - - # inactive tab bar segment color - # col.inactive = # default: 0x80808080 - - # active tab bar text color - # col.text.active = # default: 0xff000000 - - # urgent tab bar text color - # col.text.urgent = # default: 0xff000000 - - # inactive tab bar text color - # col.text.inactive = # default: 0xff000000 - }; - - # autotiling settings - autotile = { - # enable autotile - # enable = # default: false - - # make autotile-created groups ephemeral - # ephemeral_groups = # default: true - - # if a window would be squished smaller than this width, a vertical split will be created - # -1 = never automatically split vertically - # 0 = always automatically split vertically - # = pixel width to split at - # trigger_width = # default: 0 - - # if a window would be squished smaller than this height, a horizontal split will be created - # -1 = never automatically split horizontally - # 0 = always automatically split horizontally - # = pixel height to split at - # trigger_height = # default: 0 - - # a space or comma separated list of workspace ids where autotile should be enabled - # it's possible to create an exception rule by prefixing the definition with "not:" - # workspaces = 1,2 # autotiling will only be enabled on workspaces 1 and 2 - # workspaces = not:1,2 # autotiling will be enabled on all workspaces except 1 and 2 - # workspaces = # default: all - }; - }; - - hyprsplit = { - num_workspaces = 10; - persistent_workspaces = true; - }; - }; - - ############# - ### INPUT ### - ############# - - # https://wiki.hyprland.org/Configuring/Variables/#input - input = { - kb_layout = "us"; - # kb_variant = - # kb_model = - kb_options = "compose:ralt"; - # kb_rules = - - follow_mouse = 1; - - sensitivity = 0; # -1.0 - 1.0, 0 means no modification. - - touchpad = { - natural_scroll = false; - }; - }; - - # Example per-device config - # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more - device = { - name = "logitech-g502-1"; - sensitivity = -0.2; - }; - - ################### - ### KEYBINDINGS ### - ################### - - # See https://wiki.hyprland.org/Configuring/Keywords/ - "$mainMod" = "SUPER + ALT"; - - bind = [ - "$mainMod, T, exec, $terminal" - "$mainMod, B, exec, $browser" - "$mainMod, D, exec, $menu" - "$mainMod + SHIFT, S, exec, hyprshot -m region --clipboard-only" - "$mainMod + CTRL + SHIFT, S, exec, hyprshot -m region -o ~/Pictures" - "$mainMod, C, exec, swaync-client -t" - - "$mainMod + L_CONTROL, Q, exec, /home/drew/.config/rofi/powermenu/powermenu.sh" - "$mainMod, X, exec, /home/drew/.config/rofi/powermenu/powermenu.sh" - # "$mainMod, X, exec, hyprlock" - # "$mainMod + SHIFT, X, exec, systemctl suspend" - - "$mainMod, F, togglefloating," - "$mainMod + SHIFT, F, fullscreen, 1" - "$mainMod + CTRL, left, resizeactive, -20 0" - "$mainMod + CTRL, right, resizeactive, 20 0" - "$mainMod + CTRL, down, resizeactive, 0 20" - "$mainMod + CTRL, up, resizeactive, 0 -20" - - # Monitors - "$mainMod, R, focusmonitor, next" - "$mainMod + CTRL, R, movecurrentworkspacetomonitor, l" - "$mainMod + CTRL, S, movecurrentworkspacetomonitor, r" - - # Hy3 Stuff - "$mainMod, Q, hy3:killactive," - "$mainMod, G, hy3:makegroup, opposite, ephemeral" - "$mainMod, W, hy3:makegroup, tab, ephemeral" - "$mainMod + SHIFT, W, hy3:changegroup, toggletab" - "$mainMod, A, hy3:changefocus, raise" - "$mainMod, Z, hy3:changefocus, lower" - "$mainMod, O, hy3:changegroup, opposite" - "$mainMod, left, hy3:movefocus, l" - "$mainMod, right, hy3:movefocus, r" - "$mainMod, up, hy3:movefocus, u" - "$mainMod, down, hy3:movefocus, d" - "$mainMod, r, focusmonitor, l" - "$mainMod, s, focusmonitor, r" - "$mainMod + SHIFT, left, hy3:movewindow, l" - "$mainMod + SHIFT, right, hy3:movewindow, r" - "$mainMod + SHIFT, up, hy3:movewindow, u" - "$mainMod + SHIFT, down, hy3:movewindow, d" - # Switch workspaces with mainMod + [0-9] - "$mainMod, 1, workspace, 1" - "$mainMod, 2, workspace, 2" - "$mainMod, 3, workspace, 3" - "$mainMod, 4, workspace, 4" - "$mainMod, 5, workspace, 5" - "$mainMod, 6, workspace, 6" - "$mainMod, 7, workspace, 7" - "$mainMod, 8, workspace, 8" - "$mainMod, 9, workspace, 9" - "$mainMod, 0, workspace, 10" - # Move active window to a workspace with mainMod + SHIFT + [0-9] - # Note: using hy3:movetoworkspace instead of split:movetoworkspace. - # The plugins are compatible. - "$mainMod SHIFT, 1, hy3:movetoworkspace, 1, follow" - "$mainMod SHIFT, 2, hy3:movetoworkspace, 2, follow" - "$mainMod SHIFT, 3, hy3:movetoworkspace, 3, follow" - "$mainMod SHIFT, 4, hy3:movetoworkspace, 4, follow" - "$mainMod SHIFT, 5, hy3:movetoworkspace, 5, follow" - "$mainMod SHIFT, 6, hy3:movetoworkspace, 6, follow" - "$mainMod SHIFT, 7, hy3:movetoworkspace, 7, follow" - "$mainMod SHIFT, 8, hy3:movetoworkspace, 8, follow" - "$mainMod SHIFT, 9, hy3:movetoworkspace, 9, follow" - "$mainMod SHIFT, 0, hy3:movetoworkspace, 10, follow" - # These don't take monitor numbers, but rather differences. It's next/prev but - # it'll always just move it to the other monitor - "$mainMod SHIFT, r, movewindow, mon:+1" - ]; - - # m = mouse bindings - # These use just SUPER so I can hit them with my left hand - bindm = [ - "SUPER, mouse:272, movewindow" - "SUPER, mouse:273, resizewindow" - ]; - - # n = non-consuming - bindn = [ - ", mouse:272, hy3:focustab, mouse" - ]; - - # l = available when locked - bindl = [ - # Laptop multimedia keys for volume and LCD brightness - ",XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise" - ",XF86AudioLowerVolume, exec, swayosd-client --output-volume lower" - ",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle" - ",XF86AudioMicMute, exec, swayosd-client --input-volume mute-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" - ]; - - ############################## - ### WINDOWS AND WORKSPACES ### - ############################## - - # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - - windowrule = [ - # Ignore maximize requests from apps. You'll probably like this. - "match:class .*, suppress_event maximize" - - # Fix some dragging issues with XWayland - # "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" - - # Make right-click backgrounds not transparent. The menus have no class or title. - # "opaque,class:(),title:()" - # "noshadow,class:(),title:()" - # "match:class (),title:(), noblur" - ]; - - # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules - workspace = [ - "1, defaultName:L1" - "2, defaultName:L2" - "3, defaultName:L3" - "4, defaultName:L4" - "5, defaultName:L5" - "6, defaultName:L6" - "7, defaultName:L7" - "8, defaultName:L8" - "9, defaultName:L9" - "10, defaultName:L10" - "11, defaultName:R1" - "12, defaultName:R2" - "13, defaultName:R3" - "14, defaultName:R4" - "15, defaultName:R5" - "16, defaultName:R6" - "17, defaultName:R7" - "18, defaultName:R8" - "19, defaultName:R9" - "20, defaultName:R10" - ]; - }; - }; - - programs.hyprlock = { - enable = false; - settings = { - general = { - disable_loading_bar = true; - hide_cursor = true; - }; - - background = { - monitor = ""; - color = "rgb(000000)"; - }; - - # Time - label = { - monitor = ""; - text = '' - cmd[update:1000] echo "$(date '+%F %T')" - ''; - font_size = 96; - font_family = "NotoSans Nerd Font"; - color = "rgb(990000)"; - position = "0, 0"; - halign = "center"; - valign = "center"; - }; - - input-field = { - monitor = ""; - size = "300, 40"; - fade_on_empty = true; - outline_thickness = 2; - outer_color = "rgb(cc2222) rgb(661111)"; - inner_color = "rgb(221111)"; - - font_color = "rgb(cc2222)"; - dots_size = 0.2; - dots_spacing = 0.1; - placeholder_text = ""; - - fail_color = "rgb(cc3333)"; - capslock_color = "rgb(cccc33)"; - - halign = "center"; - valign = "center"; - position = "0, -300px"; - }; - }; - }; - - # UWSM sessions should not use Hyprland's variables but instead use UWSM's variable management. - # See https://wiki.hyprland.org/Configuring/Environment-variables/ - home.file.".config/uwsm/env".text = '' - export XCURSOR_SIZE="32" - export HYPRCURSOR_SIZE="32" - export HYPRCURSOR_THEME="phinger" - - # Nvidia config - export LIBVA_DRIVER_NAME="nvidia" - export __GLX_VENDOR_LIBRARY_NAME="nvidia" - - # For window theming - export QT_QPA_PLATFORMTHEME="qt6ct # for Qt apps" - export GTK_THEME="Adwaita-dark" - - # Tell electron apps they should use OZone for Wayland - export ELECTRON_OZONE_PLATFORM_HINT="auto" - ''; - -} diff --git a/home-manager/features/linux-desktop.nix b/home-manager/features/linux-desktop.nix index b012585..de30345 100644 --- a/home-manager/features/linux-desktop.nix +++ b/home-manager/features/linux-desktop.nix @@ -5,7 +5,7 @@ in { imports = [ ./audio.nix - ./hyprland.nix + ./hypr/hyprland.nix ./rofi/rofi.nix ./sway.nix ../apps/element.nix diff --git a/home-manager/features/mounts/mcp-archive.nix b/home-manager/features/mounts/mcp-archive.nix index a50754e..6307d25 100644 --- a/home-manager/features/mounts/mcp-archive.nix +++ b/home-manager/features/mounts/mcp-archive.nix @@ -16,7 +16,7 @@ drew@mcp:/tank/archive/drew \ %h/archive ''; - unmountArchive = "/run/wrappers/bin/fusermount -u %h/archive"; + # unmountArchive = "/run/wrappers/bin/fusermount -u %h/archive"; in { # Mounts the archive when the system is online. @@ -35,7 +35,6 @@ Type = "simple"; ExecStartPre = "/run/current-system/sw/bin/mkdir -p %h/archive"; ExecStart = mountArchive; - ExecStop = unmountArchive; Restart = "on-failure"; RestartSec = "10s"; @@ -45,33 +44,6 @@ WantedBy = [ "default.target" ]; }; }; - - # Unmounts the SSHFS mount whenever the system wants to go to sleep. If I - # don't do this, the service will prevent sleep while it tries to - # reconnect. - mcp-archive-unmount-on-sleep = { - Unit = { - Description = "Unmount SSHFS archive before sleep"; - - # Run this before the system goes to sleep. It should then be - # shutdown after the system wakes up. - Before = [ "sleep.target" ]; - StopWhenUnneeded = true; - }; - - Service = { - Type = "oneshot"; - # The service will remain after it runs so that it stays in the - # service registry as active. - RemainAfterExit = true; - ExecStart = unmountArchive; - ExecStop = mountArchive; - }; - - Install = { - WantedBy = [ "sleep.target" ]; - }; - }; }; } diff --git a/home-manager/features/neovim/config/lua/plugins/lsp.lua b/home-manager/features/neovim/config/lua/plugins/lsp.lua index 1c8b2e3..13337eb 100644 --- a/home-manager/features/neovim/config/lua/plugins/lsp.lua +++ b/home-manager/features/neovim/config/lua/plugins/lsp.lua @@ -4,7 +4,12 @@ return { opts = { servers = { -- Lua - lua_ls = {}, + lua_ls = { + root_markers = { + ".luarc.json", + ".git", + }, + }, -- Nix nil_ls = {}, -- Typescript diff --git a/home-manager/features/rofi/config/powermenu/powermenu.sh b/home-manager/features/rofi/config/powermenu/powermenu.sh index 5a7595a..cc7492e 100755 --- a/home-manager/features/rofi/config/powermenu/powermenu.sh +++ b/home-manager/features/rofi/config/powermenu/powermenu.sh @@ -66,21 +66,25 @@ run_cmd() { amixer set Master mute systemctl suspend elif [[ $1 == '--logout' ]]; then - if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then - openbox --exit - elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then - bspc quit - elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then - i3-msg exit - elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then - qdbus org.kde.ksmserver /KSMServer logout 0 0 0 - elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then - qdbus org.kde.ksmserver /KSMServer logout 0 0 0 - elif [[ "$DESKTOP_SESSION" == 'hyprland-uwsm' ]]; then - hyprctl dispatch exit - elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then - hyprctl dispatch exit - fi + hyprctl dispatch 'hl.dsp.exec_cmd("uwsm stop")' + # DESKTOP_SESSION appears to be empty right now. I'm not going + # to bother setting it until I'm using more than one manager. + # + # if [[ "$DESKTOP_SESSION" == 'openbox' ]]; then + # openbox --exit + # elif [[ "$DESKTOP_SESSION" == 'bspwm' ]]; then + # bspc quit + # elif [[ "$DESKTOP_SESSION" == 'i3' ]]; then + # i3-msg exit + # elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then + # qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + # elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then + # qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + # elif [[ "$DESKTOP_SESSION" == 'hyprland-uwsm' ]]; then + # hyprctl dispatch 'exec, uwsm stop' + # elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + # hyprctl dispatch exit + # fi fi else exit 0 diff --git a/home-manager/features/rofi/rofi.nix b/home-manager/features/rofi/rofi.nix index 74ae62d..c643f5b 100644 --- a/home-manager/features/rofi/rofi.nix +++ b/home-manager/features/rofi/rofi.nix @@ -9,9 +9,10 @@ recursive = true; }; - wayland.windowManager.hyprland.settings.windowrule = [ - # Forces the Rofi window to hold focus so that it gets input even if - # something else opens or the mouse is outside the window. - "stay_focused on, match:class Rofi" - ]; + # TODO: Merge into lua config + # wayland.windowManager.hyprland.settings.windowrule = [ + # # Forces the Rofi window to hold focus so that it gets input even if + # # something else opens or the mouse is outside the window. + # "stay_focused on, match:class Rofi" + # ]; } diff --git a/home-manager/features/wallpaper.nix b/home-manager/features/wallpaper.nix index 62dcbba..074e56f 100644 --- a/home-manager/features/wallpaper.nix +++ b/home-manager/features/wallpaper.nix @@ -1,9 +1,10 @@ monitors: { ... }: { - wayland.windowManager.hyprland.settings.exec-once = [ - "wpaperd" - ]; + # TODO: Merge into hyprland + # wayland.windowManager.hyprland.settings.exec-once = [ + # "wpaperd" + # ]; services.wpaperd = { enable = true; diff --git a/system/features/gui.nix b/system/features/gui.nix index 0987d69..7dad85e 100644 --- a/system/features/gui.nix +++ b/system/features/gui.nix @@ -21,7 +21,7 @@ enable = true; # See https://github.com/S41G0N/ly/blob/master/res/config.ini settings = { - animation = "matrix"; # matrix|doom|none + animation = "doom"; # matrix|doom|none bigclock = "en"; clear_password = true; # erase the password on failure clock = "%c"; # Show the clock diff --git a/system/hosts/altair/configuration.nix b/system/hosts/altair/configuration.nix index 8eafc93..12cae51 100644 --- a/system/hosts/altair/configuration.nix +++ b/system/hosts/altair/configuration.nix @@ -18,7 +18,7 @@ networking.networkmanager.enable = true; # Disable wpa-supplicant to avoid conflicts with network manager. # Appears this is not needed as of 26.05 - # networking.wireless.enable = false; + networking.wireless.enable = true; # Set your time zone. time.timeZone = "America/Los_Angeles"; diff --git a/system/hosts/altair/drew.nix b/system/hosts/altair/drew.nix index dbddcaf..5a787cb 100644 --- a/system/hosts/altair/drew.nix +++ b/system/hosts/altair/drew.nix @@ -48,16 +48,17 @@ in }; }; - wayland.windowManager.hyprland.settings = { - exec-once = [ - # Set up eww here because it's based on the monitor configuration - "sleep 2 && eww open-many primary-statusbar secondary-statusbar" - # Set DP-2 as the primary monitor, otherwise it defaults to DP-1 because it's first in the list. - "xrandr --output DP-2 --primary" - ]; - windowrule = [ - # Rofi doesn't center properly when I have the two asymetric monitors, so we need hyprland to manage it. - "match:class Rofi, center on" - ]; - }; + # TODO: Merge into lua config + # wayland.windowManager.hyprland.settings = { + # exec-once = [ + # # Set up eww here because it's based on the monitor configuration + # "sleep 2 && eww open-many primary-statusbar secondary-statusbar" + # # Set DP-2 as the primary monitor, otherwise it defaults to DP-1 because it's first in the list. + # "xrandr --output DP-2 --primary" + # ]; + # windowrule = [ + # # Rofi doesn't center properly when I have the two asymetric monitors, so we need hyprland to manage it. + # "match:class Rofi, center on" + # ]; + # }; } diff --git a/system/hosts/altair/hardware-configuration.nix b/system/hosts/altair/hardware-configuration.nix index dfeb4f1..004f3a5 100644 --- a/system/hosts/altair/hardware-configuration.nix +++ b/system/hosts/altair/hardware-configuration.nix @@ -86,7 +86,7 @@ # # Current versions can be found in https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix # - package = config.boot.kernelPackages.nvidiaPackages.beta; + package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; diff --git a/system/hosts/vega/drew.nix b/system/hosts/vega/drew.nix index d13700e..bdebc6f 100644 --- a/system/hosts/vega/drew.nix +++ b/system/hosts/vega/drew.nix @@ -34,24 +34,25 @@ email = "periodic@blazestar.net"; }; - wayland.windowManager.hyprland.settings = { - # Set up eww here because it's based on the monitor configuration - # Eww is idempotent, so it's fine to just run it on every reload to make sure things are open - exec-once = [ - "sleep 2 && eww open-many vertical-statusbar" - ]; - # Set up workspaces for this system - # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules - workspace = [ - "1, defaultName:1" - "2, defaultName:2" - "3, defaultName:3" - "4, defaultName:4" - "5, defaultName:5" - "6, defaultName:6" - "7, defaultName:7" - "8, defaultName:8" - "9, defaultName:9" - ]; - }; + # TODO: Merge into LUA configs + # wayland.windowManager.hyprland.settings = { + # # Set up eww here because it's based on the monitor configuration + # # Eww is idempotent, so it's fine to just run it on every reload to make sure things are open + # exec-once = [ + # "sleep 2 && eww open-many vertical-statusbar" + # ]; + # # Set up workspaces for this system + # # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules + # workspace = [ + # "1, defaultName:1" + # "2, defaultName:2" + # "3, defaultName:3" + # "4, defaultName:4" + # "5, defaultName:5" + # "6, defaultName:6" + # "7, defaultName:7" + # "8, defaultName:8" + # "9, defaultName:9" + # ]; + # }; }