Files
nixy/home/system/hyprland/bindings.nix
T
kptltd00m 849b0f0cfd Replace caelestia shell with Waybar and Walker
Remove caelestia-shell/cli inputs and prune corresponding flake.lock
entries. Update Hyprland keybindings to use walker, grimblast and
Waybar, use loginctl for locking and pkill/waybar for restart. Add
new home/system modules for waybar and walker and enable them in
host configs. Delete obsolete INSTALL-laptop.md.
2026-06-28 12:48:00 +02:00

195 lines
5.9 KiB
Nix

{
pkgs,
lib,
config,
...
}: let
colors = config.lib.stylix.colors;
mkMenu = menu: let
configFile = pkgs.writeText "config.yaml" (
lib.generators.toYAML {} {
anchor = "bottom-right";
border = "#${colors.base0D}80";
background = "#${colors.base01}EE";
color = "#${colors.base05}";
margin_right = 15;
margin_bottom = 15;
rows_per_column = 5;
inherit menu;
}
);
in
pkgs.writeShellScriptBin "menu" ''
exec ${lib.getExe pkgs.wlr-which-key} ${configFile}
'';
in {
wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER";
"$shiftMod" = "SUPER_SHIFT";
bind =
[
# Applications
(
"$shiftMod, A, exec, "
+ lib.getExe (mkMenu [
{
key = "a";
desc = "Proton Authenticator";
cmd = "env WEBKIT_DISABLE_COMPOSITING_MODE=1 ${pkgs.proton-authenticator}/bin/proton-authenticator";
}
{
key = "p";
desc = "Proton Pass";
cmd = "${pkgs.proton-pass}/bin/proton-pass";
}
{
key = "v";
desc = "Proton VPN";
cmd = "${pkgs.proton-vpn}/bin/protonvpn-app";
}
{
key = "c";
desc = "Proton Calendar";
cmd = "${config.programs.librewolf.package}/bin/helium 'https://calendar.proton.me/'";
}
{
key = "m";
desc = "Proton Mail";
cmd = "${config.programs.librewolf.package}/bin/helium 'https://mail.proton.me/'";
}
{
key = "o";
desc = "Obsidian";
cmd = "${pkgs.obsidian}/bin/obsidian";
}
{
key = "s";
desc = "Signal";
cmd = "${pkgs.signal-desktop}/bin/signal-desktop";
}
{
key = "t";
desc = "TickTick";
cmd = "${pkgs.ticktick}/bin/ticktick";
}
{
key = "b";
desc = "Helium";
cmd = "${config.programs.librewolf.package}/bin/helium";
}
{
key = "i";
desc = "Helium (Incognito)";
cmd = "${config.programs.librewolf.package}/bin/helium --incognito";
}
])
)
"$mod,B, exec, uwsm app -- ${config.programs.librewolf.package}/bin/helium" # Browser
# Power
(
"$mod, X, exec, "
+ lib.getExe (mkMenu [
{
key = "l";
desc = "Lock";
cmd = "loginctl lock-session";
}
{
key = "s";
desc = "Suspend";
cmd = "systemctl suspend";
}
{
key = "r";
desc = "Reboot";
cmd = "systemctl reboot";
}
{
key = "p";
desc = "Power Off";
cmd = "systemctl poweroff";
}
{
key = "n";
desc = "Nightshift";
cmd = "nightshift-toggle";
}
{
key = "c";
desc = "Restart Waybar";
cmd = "pkill -x waybar; waybar";
}
])
)
# Quick launch
"$mod,RETURN, exec, uwsm app -- ${pkgs.ghostty}/bin/ghostty" # Ghostty (terminal)
"$mod,E, exec, uwsm app -- ${pkgs.thunar}/bin/thunar" # Thunar
"$mod, SPACE, exec, walker" # Launcher
"$mod, N, exec, ${lib.getExe pkgs.grimblast} save area" # Save screenshot
"$mod, D, exec, ${lib.getExe pkgs.grimblast} copy area" # Copy screenshot
# Windows
"$mod,Q, killactive," # Close window
"$mod,F, fullscreen" # Toggle Fullscreen
"$shiftMod,F, togglefloating," # Toggle Floating
# Focus Windows
"$mod,H, movefocus, l" # Move focus left
"$mod,J, movefocus, d" # Move focus Down
"$mod,K, movefocus, u" # Move focus Up
"$mod,L, movefocus, r" # Move focus Right
"$shiftMod,H, focusmonitor, -1" # Focus previous monitor
"$shiftMod,J, layoutmsg, removemaster" # Remove from master
"$shiftMod,K, layoutmsg, addmaster" # Add to master
"$shiftMod,L, focusmonitor, 1" # Focus next monitor
# Utilities
"$shiftMod, S, exec, ${lib.getExe pkgs.grimblast} copy area" # Capture region
", Print, exec, ${lib.getExe pkgs.grimblast} copy area" # Capture region
"$shiftMod+Alt, S, exec, ${lib.getExe pkgs.grimblast} save area" # Capture region
]
++ (builtins.concatLists (
builtins.genList (
i: let
ws = i + 1;
in [
"$mod,code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT,code:1${toString i}, movetoworkspace, ${toString ws}"
]
)
9
));
bindm = [
"$mod,mouse:272, movewindow" # Move Window (mouse)
"$mod,R, resizewindow" # Resize Window (mouse)
];
bindl = [
# Brightness
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set 5%+"
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 5%-"
# Media
", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioPause, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next"
", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous"
", XF86AudioStop, exec, ${lib.getExe pkgs.playerctl} stop"
# Sound
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
};
}