# Mouse binds
bindm = SUPER, mouse:272, movewindow
bindm = SUPER, mouse:273, resizewindow

# Basic keybinds
bind = SUPER, Q, killactive,
bind = SUPERCTRL, R, exec, pkill waybar || waybar
bind = SUPERCTRL, M, exit
bind = SUPER, A, exec, hyprctl dispatch togglefloating && hyprctl dispatch centerwindow 1
bind = SUPER, P, pseudo
bind = SUPER, F, fullscreen, 0
bind = SUPER, Z, exec, pypr zoom

## Applications
bind = SUPER, W, exec, ~/.config/hypr/scripts/custom_app_launch librewolf
bind = SUPER, O, exec, ~/.config/hypr/scripts/custom_app_launch obsidian
bind = SUPERSHIFT, O, exec, ~/.config/hypr/scripts/custom_app_launch office
bind = SUPERSHIFT, E,exec, ~/.config/hypr/scripts/custom_app_launch nemo
bind = SUPER, RETURN, exec, kitty
bind = SUPERALT, RETURN, exec, kitty --class=center-float-large
bind = SUPERSHIFT, RETURN, exec, ~/.config/hypr/scripts/custom_app_launch kitty
bind = SUPER, BACKSPACE, exec, ~/.config/hypr/scripts/custom_app_launch nvim
bind = SUPERSHIFT, BACKSPACE, exec, ~/.config/hypr/scripts/custom_app_launch neovide

# Launchers
bind = SUPER, 23, exec, rofi -show drun # Tab

# Scratchpads
bind = SUPER, V, exec, pypr toggle volume
bind = SUPER, 51, exec, pypr toggle terminal && hyprctl dispatch bringactivetotop # Backslash
bind = SUPER, B, exec, pypr toggle btop && hyprctl dispatch bringactivetotop
bind = SUPERSHIFT, G, exec, pypr toggle gpt && hyprctl dispatch bringactivetotop
bind = SUPERSHIFT, B, exec, pypr toggle bluetooth && hyprctl dispatch bringactivetotop
bind = SUPER, E, exec, pypr toggle yazi && hyprctl dispatch bringactivetotop
bind = SUPER, D, exec, pypr toggle dots && hyprctl dispatch bringactivetotop

# Screenshotting
bind = SHIFT, INSERT, exec, hyprshot -m output -o ~/Imagenes/Capturas/PC -f captura-$(date +'%Y-%m-%d-%s').png
bind = SUPERSHIFT, INSERT, exec, hyprshot -m window -o ~/Imagenes/Capturas/PC -f captura-$(date +'%Y-%m-%d-%s').png
bind = CTRL, INSERT, exec, hyprshot -m region -o ~/Imagenes/Capturas/PC -f captura-$(date +'%Y-%m-%d-%s').png
bind = ALT, INSERT, exec, ~/.config/hypr/scripts/rofi/screenshots_selection

# Clipboard
bind = SUPER, Y, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy

# Logout menu
bind = SUPER, ESCAPE, exec, wleave

# Color picker
bind = SUPER, INSERT, exec, ~/.config/hypr/scripts/color_picker

# Wallpaper
bind = SUPERSHIFT, W, exec, ~/.config/hypr/scripts/wallpaper select
bind = SUPERCTRL, W, exec, ~/.config/hypr/scripts/wallpaper random

# Keybindings Cheatsheet
bind = SUPER, F1, exec, ~/.config/hypr/scripts/rofi/keybindings

# Recording
bind = SUPERSHIFT, R, exec, ~/.config/hypr/scripts/rofi/recording

## Windows
## Focusing on windows
bind = SUPER, LEFT, movefocus, l
bind = SUPER, RIGHT, movefocus, r
bind = SUPER, UP, movefocus, u
bind = SUPER, DOWN, movefocus, d
# Vim-keybinds
bind = SUPER, H, movefocus, l
bind = SUPER, L, movefocus, r
bind = SUPER, K, movefocus, u
bind = SUPER, J, movefocus, d

## Moving windows
bind = SUPERSHIFT, LEFT, movewindow, l
bind = SUPERSHIFT, RIGHT, movewindow, r
bind = SUPERSHIFT, UP, movewindow, u
bind = SUPERSHIFT, DOWN, movewindow, d
# Vim-keybinds
bind = SUPERSHIFT, H, movewindow, l
bind = SUPERSHIFT, L, movewindow, r
bind = SUPERSHIFT, K, movewindow, u
bind = SUPERSHIFT, J, movewindow, d

# Center and split
bind = SUPER, S, togglesplit
bind = SUPER, C, exec, hyprctl dispatch centerwindow 1

## Workspaces
# Focusing other workspaces
bind = SUPER, 1, exec, hyprsome workspace 1
bind = SUPER, 2, exec, hyprsome workspace 2
bind = SUPER, 3, exec, hyprsome workspace 3
bind = SUPER, 4, exec, hyprsome workspace 4
bind = SUPER, 5, exec, hyprsome workspace 5
bind = SUPER, 6, exec, hyprsome workspace 6
bind = SUPER, 7, exec, hyprsome workspace 7
bind = SUPER, 8, exec, hyprsome workspace 8
bind = SUPER, 9, exec, hyprsome workspace 9
bind = SUPER, 0, exec, hyprsome workspace 10

# Moving windows to other workspaces
bind = SUPERSHIFT, 1, exec, hyprsome movefocus 1
bind = SUPERSHIFT, 2, exec, hyprsome movefocus 2
bind = SUPERSHIFT, 3, exec, hyprsome movefocus 3
bind = SUPERSHIFT, 4, exec, hyprsome movefocus 4
bind = SUPERSHIFT, 5, exec, hyprsome movefocus 5
bind = SUPERSHIFT, 6, exec, hyprsome movefocus 6
bind = SUPERSHIFT, 7, exec, hyprsome movefocus 7
bind = SUPERSHIFT, 8, exec, hyprsome movefocus 8
bind = SUPERSHIFT, 9, exec, hyprsome movefocus 9
bind = SUPERSHIFT, 0, exec, hyprsome movefocus 10

# Moving windows to other workspaces (silent)
bind = SUPERALT, 1, exec, hyprsome move 1
bind = SUPERALT, 2, exec, hyprsome move 2
bind = SUPERALT, 3, exec, hyprsome move 3
bind = SUPERALT, 4, exec, hyprsome move 4
bind = SUPERALT, 5, exec, hyprsome move 5
bind = SUPERALT, 6, exec, hyprsome move 6
bind = SUPERALT, 7, exec, hyprsome move 7
bind = SUPERALT, 8, exec, hyprsome move 8
bind = SUPERALT, 9, exec, hyprsome move 9
bind = SUPERALT, 0, exec, hyprsome move 10

# Moving to other wokspace with mouse control
bind = SUPER, mouse_down, workspace,m-1
bind = SUPER, mouse_up, workspace,m+1

# Moving to other wokspace with keyboard
bind = SUPERCTRL, LEFT, workspace,m-1
bind = SUPERCTRL, RIGHT, workspace,m+1

bind = SUPERCTRL, H, workspace,m-1
bind = SUPERCTRL, L, workspace,m+1

# Group control
bind = SUPERSHIFT, 51, exec, pypr expose # Backslash
bind = SUPERSHIFT, 48, togglespecialworkspace, minimized # Single quote
bind = SUPER, 48, exec, pypr toggle_minimized # Single quote
bind = SUPER, G, togglegroup
bind = ALT, TAB, changegroupactive

# Submap for resizing windows
bind = SUPER, R, submap, resize
submap = resize

binde = , RIGHT, resizeactive, 40 0
binde = , LEFT, resizeactive, -40 0
binde = , UP, resizeactive, 0 -40
binde = , DOWN, resizeactive, 0 40

binde = , L, resizeactive, 40 0
binde = , H, resizeactive, -40 0
binde = , K, resizeactive, 0 -40
binde = , J, resizeactive, 0 40

bind = , escape, submap, reset 

submap = reset

## Audio
bind = SUPERCTRL, V, exec, restartAudio

bindl = SUPERCTRL, mouse:280, exec, swayosd-client --output-volume mute-toggle # Extra Up Button
bindl = , XF86AudioMute, exec, swayosd-client --output-volume mute-toggle
bindl = SUPERCTRL, mouse:281, exec, swayosd-client --input-volume mute-toggle # Extra Down Button
bindl = , XF86AudioMicMute, exec, exec swayosd-client --input-volume mute-toggle

bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = SUPERCTRL, mouse:282, exec, playerctl play-pause # Extra Center Button
bindl = , XF86AudioPrev, exec, playerctl previous
bindl = SUPERCTRL, mouse:275, exec, playerctl previous # Extra Back Button
bindl = , XF86AudioNext, exec, playerctl next
bindl = SUPERCTRL, mouse:276, exec, playerctl next # Extra Forward Button

bindle = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise
bindle = SUPERCTRL, 21, exec, swayosd-client --output-volume raise # Minus key
bindle = , XF86AudioLowerVolume, exec, swayosd-client --output-volume lower
bindle = SUPERCTRL, 20, exec, swayosd-client --output-volume lower # Plus key

bindle = , XF86InputRaiseVolume, exec, swayosd-client --input-volume raise
bindle = SUPERSHIFT, 21, exec, swayosd-client --input-volume raise # Minus key
bindle = , XF86InputLowerVolume, exec, swayosd-client --input-volume lower
bindle = SUPERSHIFT, 20, exec, swayosd-client --input-volume lower # Plus key

# Disable anim, blur, etc
bind = SUPER, F12, exec, ~/.config/hypr/scripts/performance

# Open Wiki
bind = SUPERSHIFT, F1, exec, xdg-open https://wiki.hyprland.org/
bind = SUPERCTRL, F1, exec, xdg-open https://github.com/Matt-FTW/dotfiles/wiki
