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