Compare commits

...
6 Commits
Author SHA1 Message Date
Alexander Heldt babec6336f waybar: Pin battery module to BAT0
Bluetooth HID devices (e.g. a mouse) appearing as power_supply
entries in sysfs make waybar's Battery::refreshBatteries() throw
an uncaught exception and abort. Restricting to BAT0 avoids
enumerating those devices.
2026-09-01 10:07:07 +02:00
Alexander Heldt 5ec6f7d636 hyprland: Fix mouse binds, hl.bindm does not exist
Hyprland's lua API only registers hl.bind; there is no separate
hl.bindm. The settings.bindm key rendered as a literal hl.bindm(...)
call, which errored with "attempt to call a nil value" at runtime.
Fold the mouse binds into settings.bind with { mouse = true }, per
the wiki's own example config.
2026-08-26 14:14:07 +02:00
Alexander Heldt acebeaf180 hyprland: Migrate config to Lua, bump back to current
Hyprland 0.56.x dropped the hyprlang (.conf) config backend in favor
of Lua-only config. Switch configType to "lua" and rewrite monitors,
workspace/window rules, binds, env vars, and autostart using the new
hl.* dispatcher API. Un-pin the hyprland flake input (back to current,
following root nixpkgs) now that the config no longer depends on the
old hyprlang backend.

Every module that injects Hyprland keybinds (foot, wezterm, bemenu,
music, light, sound, screenshot, physlock, hyprlock) is converted to
the same Lua bind syntax, since the config is all-or-nothing per
configType. hyprlock's swayidle dpms toggle and the hyprland-monitors
hotplug script's hyprctl dispatch calls are updated to the new
hl.dsp.* expression syntax the same way.

One behavior change: hl.workspace_rule keeps only the last monitor set
per workspace (unlike hyprlang's rule list), so workspaces that used
to declare two candidate monitors now declare one static default;
the hyprland-monitors service still re-dispatches the correct monitor
on startup and hotplug.
2026-08-26 14:08:28 +02:00
Alexander Heldt 548507d60b flake: Pin hyprland to pre-0.56.0 rev, keep own nixpkgs
Hyprland 0.56.0 dropped the hyprlang (.conf) config backend entirely
in favor of a Lua-only config, breaking the deployed hyprland.conf on
pinwheel. Pin back to 79bc0ca (last hyprlang-supporting build) until
the config is migrated to Lua.

Also drop hyprland's nixpkgs.follows override: building the old
Hyprland rev against the current (newer) root nixpkgs caused a
libstdc++ ABI mismatch between the cached hyprtoolkit binary and a
freshly-compiled hyprland-guiutils.
2026-08-26 12:54:43 +02:00
Alexander Heldt 9d15eb0e9f Update flake inputs 2026-08-18 09:39:02 +00:00
Alexander Heldt 4dbd2ccded Update todo flake input 2026-08-18 09:32:39 +00:00
12 changed files with 430 additions and 186 deletions
Generated
+61 -61
View File
@@ -43,11 +43,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782073106, "lastModified": 1787400831,
"narHash": "sha256-dnS5SaZlPqR1E0dPXaPc+lFkBwLUbAgbwsVMk7uA6dY=", "narHash": "sha256-H3MEkFDZf+UH+QrVgW8TdKrssPFltF8fBg/rh0J1zIc=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "6d6e2384f381def4ea4ea81543cba4bbdac72457", "rev": "7ce889cb78b97979b83a4648509fc3ef405c3286",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -106,11 +106,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1784109865, "lastModified": 1787018211,
"narHash": "sha256-UCJ0O811UeGSe3GlLj8QxVa4ykHRfjl9rZvqFpiECME=", "narHash": "sha256-6l9VDWVP2ePuI/8zSXLY4+50BKJpd1IF1REYKsUoxls=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "422352494e740d44d7551549916655b122a9fd01", "rev": "a65bcf36c4d8aa4c5ff51d571f2a2c2555681dad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -251,11 +251,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783963347, "lastModified": 1786999651,
"narHash": "sha256-r376E2XpakiXwModDHIxlvB6qLq4iFVEq730vxOO4JY=", "narHash": "sha256-MTGMFlLDTklsXhCp4r5GXB4VAVadPdalXLvUjd/K7h0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a45a7c451455a51ae740ec3bce4024b312809c29", "rev": "353742587cbaf079b3caee743115d037bc51fea6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -280,11 +280,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1776511930, "lastModified": 1786464181,
"narHash": "sha256-fCpwFiTW0rT7oKJqr3cqHMnkwypSwQKpbtUEtxdkgrM=", "narHash": "sha256-2alOMkLjXANh7unkZnYnCF2K2rApZaOLMoQ3o+VX2CY=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprcursor", "repo": "hyprcursor",
"rev": "39435900785d0c560c6ae8777d29f28617d031ef", "rev": "e4ed7c08123df5af460a0a70961380cbfb872f76",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -309,11 +309,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782566056, "lastModified": 1786464367,
"narHash": "sha256-haEZcHzYrePnjFOYSWTbxm/Nrla0aPslJfmvdCvqtVc=", "narHash": "sha256-k58p4wbzIXWyRWrW84pP8tD+iaZSSYiiM+fr0Auk4oU=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprgraphics", "repo": "hyprgraphics",
"rev": "c6e7b9f673f4360bc813d3dc75028f75ee88d3f8", "rev": "7c895c44e3ca6d28ed68ddd80ec02b02b925e7fc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -341,11 +341,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1784043142, "lastModified": 1787612295,
"narHash": "sha256-vd4VSlddmDAToJv/twyr0O8Siq4U/sOIXeo6DFZIolc=", "narHash": "sha256-K7sUeS1tKTSDu+aQK0ZwCxJCls+JzDj1qeTJRGk+CV8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "79bc0ca16e7cca40c247a9200634d150fa8193d1", "rev": "0bd11c7a04a63d2785abd53363f09d552175d67d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -407,11 +407,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782563850, "lastModified": 1786464504,
"narHash": "sha256-rs/EzgrgPHbCtJjFZN4aR1HYldH/0NtGAempWVpWQTs=", "narHash": "sha256-7sHwM86KILQyHDHDuE2SDBlQ2jvZ0EW3hY7sW009/cg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-guiutils", "repo": "hyprland-guiutils",
"rev": "5ba080ee036c30cb2485f2647ff8a61f7aa08178", "rev": "4c30cf3097ea963c0e250749ee0c59f8b08816d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -461,11 +461,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777320127, "lastModified": 1786464129,
"narHash": "sha256-Qu+Wf2Bp5qUjyn2YpZNq8a7JyzTGowhT1knrwE38a9U=", "narHash": "sha256-339AkTlpMYSIvFuG0rnR+8Yg4/AZKeJalshJavlnKfg=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlang", "repo": "hyprlang",
"rev": "090117506ddc3d7f26e650ff344d378c2ec329cc", "rev": "9508458be316a0d70d37ebed1ab725ccd10411ff",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -513,11 +513,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782554491, "lastModified": 1785930473,
"narHash": "sha256-+p3MlyN/nqRefcf2IckPlGRUn9+hielqpS9XClbLleM=", "narHash": "sha256-DitTu625BhEYpZjtjxtGpjrEJwPwW+X/+jJvhSZNSJM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprtoolkit", "repo": "hyprtoolkit",
"rev": "bdba25ced39ea39ab004a8f31593ba0b0ff1ca35", "rev": "af515b69dfbe366dc7873aa1475cb2f4db3ebad7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -538,11 +538,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783002634, "lastModified": 1786903207,
"narHash": "sha256-xGqHIUK0wIZoW7SiMalwvO6uGOO/VrlQwoRobpE7dDI=", "narHash": "sha256-QTwMqLLONRhv9iz6CVeuX6BqQNQCIqI8hL/cPYlR/24=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "41fb809557abd29a57151b6e1aaeabd05f9437e1", "rev": "6cf50415e06dc6bd9f1252f1b745eac6b4a1cc39",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -563,11 +563,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1777159683, "lastModified": 1786464033,
"narHash": "sha256-Jxixw6wZphUp+nHYxOKUYSckL17QMBx2d5Zp0rJHr1g=", "narHash": "sha256-QM8Qe4/L8lpdVN4bgwahmi+jyyc4fisseDMe4afcDxA=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "b8632713a6beaf28b56f2a7b0ab2fb7088dbb404", "rev": "62e62c1ca23da17612c6890d4ad2064f575643db",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -592,11 +592,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1778410714, "lastModified": 1786464294,
"narHash": "sha256-o6RzFj4nJXaPRY7EM01siuCQeT41RfwwmcmFQqwFJJg=", "narHash": "sha256-ZQsZ2WvBdkboCIyh8LStDPdAIARmxzn0XMNxxoOhjPE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwire", "repo": "hyprwire",
"rev": "85148a8e612808cf5ddb25d0b3c5840f3498a7dc", "rev": "4ce7cd6b6128c1ac41caf23c58a30a26b327f9dd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -677,11 +677,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773476909, "lastModified": 1785952180,
"narHash": "sha256-hSg/7xFO+3G3wWFq1480OecREqTY+fu06L06rM2UBmQ=", "narHash": "sha256-iDuEHW+ll+wdKEfbhFaQQ0vsE0/Nl+TS1osI947cv5w=",
"owner": "detoxify92", "owner": "detoxify92",
"repo": "naviterm", "repo": "naviterm",
"rev": "f89dbde00222fb1e4f611419d05583d8edee4c25", "rev": "82ec8adc0a9dbb781ddae409bb19269936559f7f",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@@ -733,11 +733,11 @@
"systems": "systems_5" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1783761716, "lastModified": 1786782246,
"narHash": "sha256-1I1HEeTEBHcBy/jIO2l5NiJJZSqrQSMjwKo9A9ONZr4=", "narHash": "sha256-D8uy48k++htZCZF13wZJ9jcxFmI6G7uId1pSj0wD7rw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-jetbrains-plugins", "repo": "nix-jetbrains-plugins",
"rev": "dc3c00516880f4fd82671bea4b3500451b29958d", "rev": "35359b4f515f165bb2a11c5de793a282daa78c03",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -751,11 +751,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1784100666, "lastModified": 1786867632,
"narHash": "sha256-HF/mrw5NYQfKFZgkfV2h1UL5/E3ccfsE2XJ1AbbLLJ0=", "narHash": "sha256-ez+ubZlA1RtdjCB18a6zJ9M4u8qoPDy08EcnsW5M3Xw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "fccfa9031a85b78a437f2f153c1f6449f3bc3185", "rev": "ff17823245ab9ff7bcae6acf950bd89cba82c38c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -783,11 +783,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1784011430, "lastModified": 1786943417,
"narHash": "sha256-lDebytrYdd47IBLwvNOD+6AGeoqZ78CIKlp70hzW280=", "narHash": "sha256-b4qgjdFtlz5TAZ1Hi7DFJeqX3sjaDUnrwr9OO+O1rM0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8eeec934ae0dbeca3d7868c059568a65c08b2fc3", "rev": "0dd31db7e6dbf9ce05697c4545f6fe01accec994",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -812,11 +812,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1784007870, "lastModified": 1786862985,
"narHash": "sha256-djcLt/JJphyNt4eDY9XTly+/WbCK5lqWq9lSgCmJkkQ=", "narHash": "sha256-FBJRXmbGXiSUDvYEbfLYRkckayyZ6SK1UEqhCrIZ2Cs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "18b9261cb3294b6d2a06d03f96872827b8fe2698", "rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -856,11 +856,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1783008725, "lastModified": 1784288435,
"narHash": "sha256-jGiy6+sxjNWXSjp25uoJuNfyH9zBK1PEDY0lVoL4ibQ=", "narHash": "sha256-ReRHaLgr/uVqdD8afFSn+myXIfpHeOhP0yYe0TJqAA8=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "bca82caa46d5ec0f5d422c61fb1e30bc51313cbe", "rev": "43b3c1ab9d40fb1dbb008f451988a91e375825e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1050,11 +1050,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1786867690, "lastModified": 1787045443,
"narHash": "sha256-MLNw1prKR4Wb3n3MyyypHvtuCJNlI2HPyYvqWAAONqI=", "narHash": "sha256-zgpME9KjeRyp2teHkuJUrOUIsWUd1QrCRxUy7GuS41w=",
"ref": "main", "ref": "main",
"rev": "4a20b96f654ae34159d6f1e8bfba8efc1ee206e8", "rev": "3bef06edde9fed897ce7f4c0c3c1b93945fd1e03",
"revCount": 27, "revCount": 28,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/todo.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/todo.git"
}, },
@@ -1134,11 +1134,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782644412, "lastModified": 1786988229,
"narHash": "sha256-/iSa/bL1QQFLv+uJ9gI0N87J8gOeZXvca7EjoPGKE6w=", "narHash": "sha256-frEFLVRj8xXvBBDs44IRiqHo6R2PxsRpluygL7abjjI=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "c01c99fc278ec68c82e9865923088f043c7c1621", "rev": "59d429bf45aed4e2209043c0c36565ad8e2859a5",
"type": "github" "type": "github"
}, },
"original": { "original": {
+8 -1
View File
@@ -28,7 +28,14 @@ in
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ "$mod, SPACE, exec, ${bmr}" ]; bind = [
{
_args = [
"SUPER + SPACE"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${bmr}")'')
];
}
];
}; };
}; };
}; };
+6 -1
View File
@@ -33,7 +33,12 @@ in
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ bind = [
"$mod, RETURN, exec, ${pkgs.foot}/bin/foot" {
_args = [
"SUPER + RETURN"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.foot}/bin/foot")'')
];
}
]; ];
}; };
}; };
+261 -101
View File
@@ -8,6 +8,8 @@
let let
enabled = config.mod.hyprland.enable; enabled = config.mod.hyprland.enable;
mod = "SUPER";
monitorScript = pkgs.writeShellScript "hyprland-monitor-handler" '' monitorScript = pkgs.writeShellScript "hyprland-monitor-handler" ''
INTERNAL="eDP-1" INTERNAL="eDP-1"
EXTERNAL_MONITORS="HDMI-A-1 DP-3" EXTERNAL_MONITORS="HDMI-A-1 DP-3"
@@ -31,15 +33,15 @@ let
if external=$(get_active_external); then if external=$(get_active_external); then
# External monitor connected: move workspaces 1-5 to external, 6-10 to internal # External monitor connected: move workspaces 1-5 to external, 6-10 to internal
for ws in 1 2 3 4 5; do for ws in 1 2 3 4 5; do
batch="$batch dispatch moveworkspacetomonitor $ws $external;" batch="$batch dispatch hl.dsp.workspace.move({ monitor = \"$external\", workspace = $ws });"
done done
for ws in 6 7 8 9 10; do for ws in 6 7 8 9 10; do
batch="$batch dispatch moveworkspacetomonitor $ws $INTERNAL;" batch="$batch dispatch hl.dsp.workspace.move({ monitor = \"$INTERNAL\", workspace = $ws });"
done done
else else
# No external monitor: move all workspaces to internal # No external monitor: move all workspaces to internal
for ws in 1 2 3 4 5 6 7 8 9 10; do for ws in 1 2 3 4 5 6 7 8 9 10; do
batch="$batch dispatch moveworkspacetomonitor $ws $INTERNAL;" batch="$batch dispatch hl.dsp.workspace.move({ monitor = \"$INTERNAL\", workspace = $ws });"
done done
fi fi
@@ -97,91 +99,180 @@ in
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
systemd.enable = false; systemd.enable = false;
configType = "hyprlang"; configType = "lua";
extraConfig = ''
exec-once = uwsm app -- waybar
exec-once = uwsm app -- hyprctl setcursor Adwaita 24
env = GDK_DPI_SCALE,1.5
env = HYPRCURSOR_THEME,Adwaita
env = HYPRCURSOR_SIZE,24
monitor=eDP-1, 1920x1200, auto-center-down, 1
monitor=HDMI-A-1, 2560x1440@100, auto-center-up, 1
monitor=DP-3, 2560x1440@60, auto-center-up, 1
# Workspaces 1-5 on external monitors (HDMI-A-1 or DP-3)
workspace = 1, monitor:HDMI-A-1, default:true
workspace = 2, monitor:HDMI-A-1
workspace = 3, monitor:HDMI-A-1
workspace = 4, monitor:HDMI-A-1
workspace = 5, monitor:HDMI-A-1
workspace = 1, monitor:DP-3, default:true
workspace = 2, monitor:DP-3
workspace = 3, monitor:DP-3
workspace = 4, monitor:DP-3
workspace = 5, monitor:DP-3
# Workspaces 6-10 on internal monitor
workspace = 6, monitor:eDP-1, default:true
workspace = 7, monitor:eDP-1
workspace = 8, monitor:eDP-1
workspace = 9, monitor:eDP-1
workspace = 10, monitor:eDP-1
workspace = w[tv1], gapsout:0, gapsin:0
workspace = f[1], gapsout:0, gapsin:0
windowrule = border_size 0, match:float 0, match:workspace w[tv1]
windowrule = rounding 0, match:float 0, match:workspace w[tv1]
windowrule = border_size 0, match:float 0, match:workspace f[1]
windowrule = rounding 0, match:float 0, match:workspace f[1]
# https://wiki.archlinux.org/title/Hyprland#Jetbrains_apps_focus_issues
windowrule = match:xwayland true, no_initial_focus on
'';
settings = { settings = {
"$mod" = "SUPER"; config = {
xwayland.force_zero_scaling = true;
animations.enabled = false; input = {
kb_layout = "se";
xwayland = { # 2 - Cursor focus will be detached from keyboard focus. Clicking on a window will move keyboard focus to that window.
force_zero_scaling = true; follow_mouse = 2;
};
input = { sensitivity = 0.3;
kb_layout = "se"; accel_profile = "flat";
touchpad = {
# 2 - Cursor focus will be detached from keyboard focus. Clicking on a window will move keyboard focus to that window. natural_scroll = false;
follow_mouse = 2; tap_and_drag = false;
};
sensitivity = 0.3;
accel_profile = "flat";
touchpad = {
natural_scroll = false;
tap-and-drag = false;
}; };
cursor = {
zoom_factor = 1;
zoom_rigid = true;
};
general = {
layout = "dwindle";
gaps_in = 0; # gaps between windows
gaps_out = 0; # gaps between windows and monitor edges
col = {
active_border = "rgba(${config.lib.colors.foreground}ff)";
inactive_border = "rgba(${config.lib.colors.background}ff)";
};
};
dwindle.force_split = 2;
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
animations.enabled = false;
}; };
cursor = { monitor = [
zoom_factor = 1; {
zoom_rigid = true; output = "eDP-1";
}; mode = "1920x1200";
position = "auto-center-down";
scale = "1";
}
{
output = "HDMI-A-1";
mode = "2560x1440@100";
position = "auto-center-up";
scale = "1";
}
{
output = "DP-3";
mode = "2560x1440@60";
position = "auto-center-up";
scale = "1";
}
];
general = { # Static defaults only: a workspace can only have one `monitor` in
layout = "dwindle"; # hl.workspace_rule (later calls overwrite it, unlike hyprlang's
# rule list). The hyprland-monitors service re-dispatches these to
# whichever external monitor is actually connected at startup and
# on hotplug, so this only matters for the brief window before it
# runs.
workspace_rule = [
{
workspace = "1";
monitor = "HDMI-A-1";
default = true;
}
{
workspace = "2";
monitor = "HDMI-A-1";
}
{
workspace = "3";
monitor = "HDMI-A-1";
}
{
workspace = "4";
monitor = "HDMI-A-1";
}
{
workspace = "5";
monitor = "HDMI-A-1";
}
gaps_in = 0; # gaps between windows {
gaps_out = 0; # gaps between windows and monitor edges workspace = "6";
monitor = "eDP-1";
default = true;
}
{
workspace = "7";
monitor = "eDP-1";
}
{
workspace = "8";
monitor = "eDP-1";
}
{
workspace = "9";
monitor = "eDP-1";
}
{
workspace = "10";
monitor = "eDP-1";
}
"col.active_border" = "rgba(${config.lib.colors.foreground}ff)"; {
"col.inactive_border" = "rgba(${config.lib.colors.background}ff)"; workspace = "w[tv1]";
}; gaps_out = 0;
gaps_in = 0;
}
{
workspace = "f[1]";
gaps_out = 0;
gaps_in = 0;
}
];
dwindle = { window_rule = [
force_split = 2; {
name = "no-gaps-wtv1";
match = {
float = false;
workspace = "w[tv1]";
};
border_size = 0;
rounding = 0;
}
{
name = "no-gaps-f1";
match = {
float = false;
workspace = "f[1]";
};
border_size = 0;
rounding = 0;
}
{
# https://wiki.archlinux.org/title/Hyprland#Jetbrains_apps_focus_issues
name = "xwayland-no-initial-focus";
match.xwayland = true;
no_initial_focus = true;
}
];
env = [
{ _args = [ "GDK_DPI_SCALE" "1.5" ]; }
{ _args = [ "HYPRCURSOR_THEME" "Adwaita" ]; }
{ _args = [ "HYPRCURSOR_SIZE" "24" ]; }
];
on = {
_args = [
"hyprland.start"
(lib.generators.mkLuaInline ''
function()
hl.exec_cmd("uwsm app -- waybar")
hl.exec_cmd("uwsm app -- hyprctl setcursor Adwaita 24")
end
'')
];
}; };
bind = bind =
@@ -193,10 +284,23 @@ in
in in
builtins.toString n; builtins.toString n;
select = builtins.genList (x: "$mod, ${ws x}, workspace, ${builtins.toString (x + 1)}") 10; focusWs = x: {
move = builtins.genList ( _args = [
x: "$mod SHIFT, ${ws x}, movetoworkspacesilent, ${builtins.toString (x + 1)}" "${mod} + ${ws x}"
) 10; (lib.generators.mkLuaInline "hl.dsp.focus({ workspace = ${builtins.toString (x + 1)} })")
];
};
moveToWs = x: {
_args = [
"${mod} + SHIFT + ${ws x}"
(lib.generators.mkLuaInline
"hl.dsp.window.move({ workspace = ${builtins.toString (x + 1)}, follow = false })"
)
];
};
select = builtins.genList focusWs 10;
move = builtins.genList moveToWs 10;
magnifier = pkgs.writeShellScript "magnifier" '' magnifier = pkgs.writeShellScript "magnifier" ''
CURRENT=$(${pkgs.hyprland}/bin/hyprctl getoption cursor:zoom_factor -j | ${pkgs.jq}/bin/jq .float) CURRENT=$(${pkgs.hyprland}/bin/hyprctl getoption cursor:zoom_factor -j | ${pkgs.jq}/bin/jq .float)
@@ -219,31 +323,87 @@ in
select select
++ move ++ move
++ [ ++ [
"$mod, ESCAPE, killactive" {
_args = [
"${mod} + ESCAPE"
(lib.generators.mkLuaInline "hl.dsp.window.close()")
];
}
"$mod, f, fullscreen, 1" {
"$mod SHIFT, f, togglefloating, active" _args = [
"${mod} + f"
(lib.generators.mkLuaInline ''hl.dsp.window.fullscreen({ mode = "maximized" })'')
];
}
{
_args = [
"${mod} + SHIFT + f"
(lib.generators.mkLuaInline ''hl.dsp.window.float({ action = "toggle" })'')
];
}
"$mod, h, movefocus, l" {
"$mod, j, movefocus, d" _args = [
"$mod, k, movefocus, u" "${mod} + h"
"$mod, l, movefocus, r" (lib.generators.mkLuaInline ''hl.dsp.focus({ direction = "left" })'')
];
}
{
_args = [
"${mod} + j"
(lib.generators.mkLuaInline ''hl.dsp.focus({ direction = "down" })'')
];
}
{
_args = [
"${mod} + k"
(lib.generators.mkLuaInline ''hl.dsp.focus({ direction = "up" })'')
];
}
{
_args = [
"${mod} + l"
(lib.generators.mkLuaInline ''hl.dsp.focus({ direction = "right" })'')
];
}
"$mod CONTROL, 1, exec, ${magnifier} --increase" {
"$mod CONTROL, 2, exec, ${magnifier} --decrease" _args = [
"$mod CONTROL, 3, exec, ${magnifier} --reset" "${mod} + CONTROL + 1"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${magnifier} --increase")'')
];
}
{
_args = [
"${mod} + CONTROL + 2"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${magnifier} --decrease")'')
];
}
{
_args = [
"${mod} + CONTROL + 3"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${magnifier} --reset")'')
];
}
# mouse movements: hyprland's lua API has no separate `bindm`,
# mouse binds are plain `hl.bind` with `{ mouse = true }`.
{
_args = [
"${mod} + mouse:272" # left click
(lib.generators.mkLuaInline "hl.dsp.window.drag()")
{ mouse = true; }
];
}
{
_args = [
"${mod} + mouse:273" # right click
(lib.generators.mkLuaInline "hl.dsp.window.resize()")
{ mouse = true; }
];
}
]; ];
bindm = [
# mouse movements
"$mod, mouse:272, movewindow" # left click
"$mod, mouse:273, resizewindow" # right click
];
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
}; };
}; };
+24 -4
View File
@@ -59,17 +59,37 @@ in
pause-music = "${pkgs.playerctl}/bin/playerctl -a pause"; pause-music = "${pkgs.playerctl}/bin/playerctl -a pause";
dpmsTimeout = config.mod.hyprlock.dpmsTimeout; dpmsTimeout = config.mod.hyprlock.dpmsTimeout;
dpmsOff = pkgs.writeShellScript "dpms-off" ''
${pkgs.hyprland}/bin/hyprctl dispatch 'hl.dsp.dpms({ action = "off" })'
'';
dpmsOn = pkgs.writeShellScript "dpms-on" ''
${pkgs.hyprland}/bin/hyprctl dispatch 'hl.dsp.dpms({ action = "on" })'
'';
dpms-lock = pkgs.writeShellScript "dpms-lock" '' dpms-lock = pkgs.writeShellScript "dpms-lock" ''
${pkgs.swayidle}/bin/swayidle \ ${pkgs.swayidle}/bin/swayidle \
timeout ${dpmsTimeout} "${pkgs.hyprland}/bin/hyprctl dispatch dpms off" \ timeout ${dpmsTimeout} ${dpmsOff} \
resume "${pkgs.hyprland}/bin/hyprctl dispatch dpms on" & resume ${dpmsOn} &
${pkgs.hyprlock}/bin/hyprlock; ${pkgs.procps}/bin/pkill swayidle ${pkgs.hyprlock}/bin/hyprlock; ${pkgs.procps}/bin/pkill swayidle
''; '';
in in
[ [
"$mod, x, exec, ${pause-music}; ${dpms-lock}" {
"$mod SHIFT, x, exec, ${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl suspend" _args = [
"SUPER + x"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pause-music}; ${dpms-lock}")'')
];
}
{
_args = [
"SUPER + SHIFT + x"
(lib.generators.mkLuaInline
''hl.dsp.exec_cmd("${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl suspend")''
)
];
}
]; ];
}; };
}; };
+12 -2
View File
@@ -14,8 +14,18 @@ in
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ bind = [
", XF86MonBrightnessUp, exec, ${pkgs.brightnessctl}/bin/brightnessctl set +5%" {
", XF86MonBrightnessDown, exec, ${pkgs.brightnessctl}/bin/brightnessctl set 5%-" _args = [
"XF86MonBrightnessUp"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.brightnessctl}/bin/brightnessctl set +5%")'')
];
}
{
_args = [
"XF86MonBrightnessDown"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.brightnessctl}/bin/brightnessctl set 5%-")'')
];
}
]; ];
}; };
}; };
+14 -7
View File
@@ -16,16 +16,23 @@ in
let let
prev = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify previous"; prev = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify previous";
next = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify next"; next = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify next";
mkExec = key: cmd: {
_args = [
key
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${cmd}")'')
];
};
in in
[ [
", XF86AudioPrev, exec, ${prev}" (mkExec "XF86AudioPrev" prev)
", XF86AudioNext, exec, ${next}" (mkExec "XF86AudioNext" next)
", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause" (mkExec "XF86AudioPlay" "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause")
", XF86AudioPause, exec, ${pkgs.playerctl}/bin/playerctl -p naviterm,spoitfy play-pause" (mkExec "XF86AudioPause" "${pkgs.playerctl}/bin/playerctl -p naviterm,spoitfy play-pause")
"$mod ALT, LEFT, exec, ${prev}" (mkExec "SUPER + ALT + LEFT" prev)
"$mod ALT, RIGHT, exec, ${next}" (mkExec "SUPER + ALT + RIGHT" next)
"$mod ALT, DOWN, exec, ${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause" (mkExec "SUPER + ALT + DOWN" "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause")
]; ];
}; };
}; };
+14 -2
View File
@@ -38,8 +38,20 @@ in
in in
[ [
# will lock the screen with `physlock`, see `lockOn.suspend # will lock the screen with `physlock`, see `lockOn.suspend
"$mod SHIFT, x, exec, ${pause-music}; systemctl suspend" {
"$mod, x, exec, ${pause-music}; ${config.security.wrapperDir}/physlock -d -s -m" _args = [
"SUPER + SHIFT + x"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pause-music}; systemctl suspend")'')
];
}
{
_args = [
"SUPER + x"
(lib.generators.mkLuaInline
''hl.dsp.exec_cmd("${pause-music}; ${config.security.wrapperDir}/physlock -d -s -m")''
)
];
}
]; ];
}; };
}; };
+12 -2
View File
@@ -19,8 +19,18 @@ in
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ bind = [
"$mod, Print, exec, ${area}" {
"$mod CTRL, Print, exec, ${screen}" _args = [
"SUPER + Print"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${area}")'')
];
}
{
_args = [
"SUPER + CTRL + Print"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${screen}")'')
];
}
]; ];
}; };
}; };
+11 -4
View File
@@ -38,12 +38,19 @@ in
MUTED=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep MUTED | wc -l) MUTED=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep MUTED | wc -l)
echo $MUTED > /sys/class/leds/platform::micmute/brightness echo $MUTED > /sys/class/leds/platform::micmute/brightness
''; '';
mkExec = key: cmd: {
_args = [
key
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${cmd}")'')
];
};
in in
[ [
", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+" (mkExec "XF86AudioRaiseVolume" "${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+")
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-" (mkExec "XF86AudioLowerVolume" "${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-")
", XF86AudioMute, exec, ${toggle-output-mute}" (mkExec "XF86AudioMute" "${toggle-output-mute}")
", XF86AudioMicMute, exec, ${toggle-input-mute}" (mkExec "XF86AudioMicMute" "${toggle-input-mute}")
]; ];
}; };
}; };
@@ -208,6 +208,7 @@ in
}; };
battery = { battery = {
"bat" = "BAT0";
"interval" = 60; "interval" = 60;
"format" = "<span font='10' rise='1000'>{icon}</span> {capacity}%"; "format" = "<span font='10' rise='1000'>{icon}</span> {capacity}%";
"format-time" = "{H}h {M}min"; "format-time" = "{H}h {M}min";
+6 -1
View File
@@ -78,7 +78,12 @@ in
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ bind = [
"$mod, RETURN, exec, ${pkgs.wezterm}/bin/wezterm" {
_args = [
"SUPER + RETURN"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.wezterm}/bin/wezterm")'')
];
}
]; ];
}; };
}; };