# general
$mainMod = SUPER


# navigation binds
bind = $mainMod SHIFT, C, killactive
bind = $mainMod SHIFT, M, exit


# window special
bind = $mainMod SHIFT, P, togglefloating
bind = $mainMod, F, fullscreen, 1
bind = $mainMod SHIFT, F, fullscreen, 0

# dwindle
bind = $mainMod, P, pseudo
bind = $mainMod, T, layoutmsg, togglesplit
bind = $mainMod SHIFT, T, layoutmsg, swapsplit


# apps binds
bind = $mainMod, Q, exec, kitty
bind = $mainMod, E, exec, thunar
bind = $mainMod, R, exec, rofi -show drun -no-history -matching prefix -drun-match-fields name -no-tokenize
bind = $mainMod SHIFT, R, exec, .config/rofi/network-manager/run-manager.sh


# copy binds
bind = $mainMod, V, exec, rofi -modi clipboard:/$HOME/.config/rofi/clipboard/cliphist-rofi-img.sh -show clipboard -show-icon -config ~/.config/rofi/clipboard-config.rasi
# -config $HOME/.config/rofi/clipboard-config.rasi
bind = $mainMod SHIFT, S, exec, IMG=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG && wl-copy < $IMG
bind = , PRINT, exec, grim - | wl-copy


# hyprlock bind
bind = $mainMod, code:49, exec, hyprlock


# waybar bind
bindr = $mainMod, w, exec, pkill -9 waybar || uwsm app -- waybar


# multimedia binds
binde = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%;  .config/hypr/scripts/dunst/volume.sh
binde = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5%;  .config/hypr/scripts/dunst/volume-down.sh
bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle; .config/hypr/scripts/dunst/volume-mute.sh
bind = , XF86AudioMicMute, exec, pactl set-source-mute @DEFAULT_SOURCE@ toggle; .config/hypr/scripts/dunst/micro.sh

bind = , XF86AudioStop, exec, playerctl stop
bind = , XF86AudioPause, exec, playerctl pause
bind = , XF86AudioPrev, exec, playerctl previous; .config/hypr/scripts/dunst/trackinfo.sh
bind = , XF86AudioNext, exec, playerctl next; .config/hypr/scripts/dunst/trackinfo.sh
bind = , XF86AudioPlay, exec, playerctl play-pause

# bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +10%
# bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -10%
# bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle


# brightness binds
binde = , XF86MonBrightnessUp , exec, brightnessctl --class='backlight' set 5%+; .config/hypr/scripts/dunst/brightness.sh
binde = , XF86MonBrightnessDown , exec, brightnessctl --class='backlight' set 5%-; .config/hypr/scripts/dunst/brightness-down.sh


# power binds
# bindl = , switch:off:Lid Switch, exec, hyprctl keyword monitor "eDP-1, 1920x1080@120, 0x0, 1, vrr, 1"
# bindl = , switch:on:Lid Switch, exec, .config/hypr/scripts/eDPower.sh
# bind = , XF86PowerOff, exec, .config/hypr/scripts/before-sleep.sh
bind = , XF86PowerOff, exec, systemctl suspend


# Move focus with mainMod + arrow keys
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d

bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d

bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d

bind = ALT, TAB, cyclenext


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


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


# Resize with keyboard
bind = $mainMod CTRL, h, resizeactive, -30 0
bind = $mainMod CTRL, l, resizeactive, 30 0
bind = $mainMod CTRL, j, resizeactive, 0 30
bind = $mainMod CTRL, k, resizeactive, 0 -30


# Switch workspaces
bind = $mainMod, A, exec, .config/hypr/scripts/workspace-handler.sh change previous
bind = $mainMod, D, exec, .config/hypr/scripts/workspace-handler.sh change next
bind = $mainMod CTRL, A, focusworkspaceoncurrentmonitor, r-1
bind = $mainMod CTRL, D, focusworkspaceoncurrentmonitor, r+1


# Move active window between workspaces
bind = $mainMod SHIFT, A, exec, .config/hypr/scripts/workspace-handler.sh move previous
bind = $mainMod SHIFT, D, exec, .config/hypr/scripts/workspace-handler.sh move next
bind = $mainMod CTRL SHIFT, A, movetoworkspace, r-1
bind = $mainMod CTRL SHIFT, D, movetoworkspace, r+1


# Swap worlspaces between monitors
bind = $mainMod, TAB, swapactiveworkspaces, 1 0 
