#          ╭──────────────────────────────────────────────────────────╮
#          │                       Keybindings                        │
#          │                          by gh                           │
#          ╰──────────────────────────────────────────────────────────╯

#          ╭──────────────────────────────────────────────────────────╮
#          │                         general                          │
#          ╰──────────────────────────────────────────────────────────╯
# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier

bind = $mainMod, T, exec, $terminal # terminal
bind = $mainMod, Q, killactive, # kill window
bind = $mainMod, E, exec, $fileManager # file manager
bind = $mainMod, V, togglefloating, # toggle float
bind = $mainMod, A, exec, $toggle_menu_cmd # wofi
bind = $mainMod, P, pseudo, # pseudo
bind = $mainMod, DELETE, exit, # pseudo
bind = $mainMod, R, togglesplit, # toggle split
bind = $mainMod CTRL, L, exec, hyprlock # lock screen

#   ────────────────────────── window move focus ────────────────────────
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d

#   ────────────────────────── switch workspaces ────────────────────────
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
binde = $mainMod SHIFT, H, workspace, -1 
binde = $mainMod SHIFT, L, workspace, +1 
binde = $mainMod SHIFT, J, workspace, previous 

#   ─────────────────────── move window to workspace ───────────────────────
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
bind = $mainMod CTRL SHIFT, H, movetoworkspace, -1 
bind = $mainMod CTRL SHIFT, L, movetoworkspace, +1 
bind = $mainMod CTRL SHIFT, J, movetoworkspace, previous 

#   ───────────────────────── workspace/scratchpad ─────────────────────────
bind = , F12, togglespecialworkspace, magic
bind = SHIFT, F12, movetoworkspace, special:magic
bind = $mainMod, M, togglespecialworkspace, music

# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1

#   ──────────────────────────────── copyq ──────────────────────────────
bind = CTRL_ALT, V, exec, copyq toggle

#   ───────────────────────────── screenshots ───────────────────────────
bind = $mainMod SHIFT, S, exec, grimblast copy area --freeze --notify --cursor
bind = , Print, exec, grimblast copy active --freeze --notify --cursor
bind = SHIFT, Print, exec, grimblast copy screen --freeze --notify --cursor

#          ╭──────────────────────────────────────────────────────────╮
#          │                        mediakeys                         │
#          ╰──────────────────────────────────────────────────────────╯

# l -> do stuff even when locked
# e -> repeats when key is held 
bindle=, XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%
bindle=, XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%
bindle=, XF86MonBrightnessUp, exec, brightnessctl set +10%
bindle=, XF86MonBrightnessDown, exec, brightnessctl set 10%-
bindl=, XF86AudioMute, exec, amixer set Master toggle
bindl=, XF86AudioPlay, exec, playerctl play-pause 
bindl=, XF86AudioPause, exec, playerctl play-pause 
bindl=, XF86AudioStop, exec, playerctl play-pause 
bindl=, XF86AudioNext, exec, playerctl next 
bindl=, XF86AudioPrev, exec, playerctl previous
bindl= CTRL ALT SHIFT, H, exec, playerctl previous 
bindl= CTRL ALT SHIFT, L, exec, playerctl next
bindl= CTRL ALT SHIFT, SPACE, exec, playerctl play-pause

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow



