# ~/.config/hypr/conf.d/40-keybinds.conf

input {
  kb_layout = eu
  #kb_layout = us
  #kb_variant = altgr-intl
  #kb_options = lv3:ralt_switch
}

###################
### KEYBINDINGS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier

# Apps
$terminal = uwsm app -- kitty
$fileManager = uwsm app -- nautilus
$launcher = uwsm app -- sherlock
$uuctl = uwsm app -- uuctl wofi -d
$emote = uwsm app -- emote

$notcenter = uwsm app -- swaync-client -t -sw
$notdnd = uwsm app -- swaync-client -d
$nothide = uwsm app -- swaync-client --hide-latest
$notclose = uwsm app -- swaync-client --close-latest
$notcloseall = uwsm app -- swaync-client --close-all

$lockcmd = hyprlock

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
# Layout Binds
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod SHIFT, J, swapsplit, # dwindle
bind = $mainMod SHIFT, T, togglegroup, # tabbed i3 like
bind = $mainMod, T, changegroupactive, # tabbed change active
bind = $mainMod, F, fullscreen,
bind = $mainMod, V, togglefloating,
bind = $mainMod ALT_L, H, movewindoworgroup, l
bind = $mainMod ALT_L, J, movewindoworgroup, d
bind = $mainMod ALT_L, K, movewindoworgroup, u
bind = $mainMod ALT_L, L, movewindoworgroup, r

# Usability
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod, L, exec, $lockcmd
bind = $mainMod, M, exit,

# App Binds
bind = $mainMod, return, exec, $terminal
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, D, exec, $launcher
bind = $mainMod SHIFT, D, exec, $uuctl
bind = $mainMod, PERIOD, exec, $emote
bind = $mainMod, F12, exec, pkill -SIGUSR2 waybar

# swaync Binds
bind = $mainMod, Grave, exec, $notcenter
bind = $mainMod SHIFT, Grave, exec, $notdnd
bind = $mainMod, A, exec, $nothide
bind = $mainMod SHIFT, A, exec, $notclose
bind = $mainMod CTRL, A, exec, $notcloseall

# Screenshot
#bind = ALT SHIFT, 3, exec, GRIMBLAST_EDITOR="satty -f" grimblast --notify edit output
#bind = ALT SHIFT, 4, exec, GRIMBLAST_EDITOR="satty -f" grimblast --notify edit area

#testing stuff
bind = ALT SHIFT, 3, exec, GRIMBLAST_EDITOR="/home/cnachtigall/data/git/clone/Satty/target/debug/satty -f" grimblast --notify edit output
bind = ALT SHIFT, 4, exec, GRIMBLAST_EDITOR="/home/cnachtigall/data/git/clone/Satty/target/debug/satty -f" grimblast --notify edit area

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, 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

# Switch workspaces with mainMod + [0-9]
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

# Move active window to a workspace with mainMod + SHIFT + [0-9]
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

# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic

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

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

# Media
# Requires playerctl
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
bindl = , XF86AudioNext, exec, playerctl next

# SwayOSD
# Sink volume change
bindel = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise
bindel = , XF86AudioLowerVolume, exec,  swayosd-client --output-volume lower
# Sink volume toggle mute
bindel = , XF86AudioMute, exec, swayosd-client --output-volume mute-toggle
# Source volume toggle mute
bindel = , XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle
# Brightness change
bindel = , XF86MonBrightnessUp, exec, swayosd-client --brightness raise
bindel = , XF86MonBrightnessDown, exec, swayosd-client --brightness lower


