Unwrap the hyprland shortcut config

This commit is contained in:
SebastianStork 2024-04-27 18:58:28 +02:00
parent 9b8b7795e6
commit b6e03035f6

View file

@ -5,113 +5,86 @@
... ...
}: { }: {
config = lib.mkIf config.myConfig.de.hyprland.enable { config = lib.mkIf config.myConfig.de.hyprland.enable {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.extraConfig = ''
"$mod" = "SUPER"; $mod = SUPER
"$terminal" = "kitty";
"$browser" = "brave"; # Bindflags:
"$fileManager" = "nemo"; # r = release
# e = repeat
# l = locked
bind =
[
# Essentials # Essentials
"$mod SHIFT, C, killactive," bind = $mod SHIFT, C, killactive,
"$mod, TAB, cyclenext," bind = $mod, TAB, cyclenext,
"$mod SHIFT, V, togglefloating," bind = $mod SHIFT, V, togglefloating,
"$mod SHIFT, F, fullscreen, 0" bind = $mod SHIFT, F, fullscreen, 0
# Launch programs # Launch programs
"$mod, RETURN, exec, $terminal" bind = $mod, RETURN, exec, kitty
"$mod, V, exec, ${lib.getExe pkgs.cliphist} list | rofi -dmenu | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"}" bindr = $mod, R, exec, pkill rofi || rofi -show drun
"$mod, B, exec, $browser" bind = $mod, V, exec, ${lib.getExe pkgs.cliphist} list | rofi -dmenu | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"}
"$mod, F, exec, $fileManager" bind = $mod, B, exec, brave
"$mod, C, exec, codium" bind = $mod, F, exec, nemo
"$mod, S, exec, spotify" bind = $mod, C, exec, codium
"$mod, D, exec, webcord" bind = $mod, S, exec, spotify
"$mod, N, exec, notepadqq --new-window" bind = $mod, D, exec, webcord
bind = $mod, N, exec, notepadqq --new-window
# Move focus # Move focus
"$mod, left, movefocus, l" bind = $mod, left, movefocus, l
"$mod, right, movefocus, r" bind = $mod, right, movefocus, r
"$mod, up, movefocus, u" bind = $mod, up, movefocus, u
"$mod, down, movefocus, d" bind = $mod, down, movefocus, d
# Move window # Move window
"$mod SHIFT, left, movewindow, l" bind = $mod SHIFT, left, movewindow, l
"$mod SHIFT, right, movewindow, r" bind = $mod SHIFT, right, movewindow, r
"$mod SHIFT, up, movewindow, u" bind = $mod SHIFT, up, movewindow, u
"$mod SHIFT, down, movewindow, d" bind = $mod SHIFT, down, movewindow, d
bindm = $mod, mouse:272, movewindow
# Scroll through workspaces # Resize window
"$mod, mouse_down, workspace, e-1" binde = $mod CONTROL, left, resizeactive, -100 0
"$mod, mouse_up, workspace, e+1" binde = $mod CONTROL, right, resizeactive, 100 0
binde = $mod CONTROL, up, resizeactive, 0 -100
binde = $mod CONTROL, down, resizeactive, 0 100
bindm = $mod, mouse:273, resizewindow
# Screenshot
", Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave output"
"SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave area"
]
# Switch workspace # Switch workspace
++ ( ${lib.concatLines (builtins.concatLists (builtins.genList (
builtins.concatLists (builtins.genList (
x: [ x: [
"$mod, ${toString (x + 1)}, workspace, ${toString (x + 1)}" "bind = $mod, ${toString (x + 1)}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${toString (x + 1)}, movetoworkspacesilent, ${toString (x + 1)}" "bind = $mod SHIFT, ${toString (x + 1)}, movetoworkspacesilent, ${toString (x + 1)}"
] ]
) )
9) 9))}
);
# Release # Scroll through workspaces
bindr = [ bind = $mod, mouse_down, workspace, e-1
# Launcher bind = $mod, mouse_up, workspace, e+1
"$mod, R, exec, pkill rofi || rofi -show drun"
];
# Repeat
binde = [
# Resize window
"$mod CONTROL, left, resizeactive, -100 0"
"$mod CONTROL, right, resizeactive, 100 0"
"$mod CONTROL, up, resizeactive, 0 -100"
"$mod CONTROL, down, resizeactive, 0 100"
];
# Locked
bindl = [
", switch:on:Lid Switch, exec, systemctl suspend"
# Media
", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} --player=spotify play-pause"
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
];
# Release + Locked
bindrl = [
# Manage session # Manage session
"$mod CONTROL, P, exec, poweroff" bindrl = $mod CONTROL, P, exec, poweroff
"$mod CONTROL, R, exec, reboot" bindrl = $mod CONTROL, R, exec, reboot
"$mod CONTROL, Q, exit," bindrl = $mod CONTROL, Q, exit,
"$mod CONTROL, S, exec, systemctl suspend" bindrl = $mod CONTROL, S, exec, systemctl suspend
"$mod CONTROL, L, exec, loginctl lock-session" bindrl = $mod CONTROL, L, exec, loginctl lock-session
"$mod CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off" bindrl = $mod CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off
]; bindl = , switch:on:Lid Switch, exec, systemctl suspend
# Repeat + Locked # Control media
bindel = [ bindl = , XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} --ignore-player=brave play-pause
# Adjust volume bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
# Adjust brightness # Adjust brightness
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2%" bindel = , XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2%
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -e set 2%-" bindel = , XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -e set 2%-
];
# Mouse # Screenshot
bindm = [ bind = , Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave output
# Move/resize windows bind = SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} --notify --freeze copysave area
"$mod, mouse:272, movewindow" '';
"$mod, mouse:273, resizewindow"
];
};
}; };
} }