##############################################
################## MY APPS ###################
##############################################

# Set programs that you use
$terminal = uwsm app -T
$filemanager = uwsm app -- dolphin
$launcher = uwsm app -- walker
$clipboard = uwsm app -- nwg-clipman
$browser = uwsm app -- zen-browser
$browserprv = uwsm app -- zen-browser --private-window
$editor = uwsm app -T -- vim
$editor0 = uwsm app -- zeditor
$clipman = uwsm app -- nwg-clipman
$taskman = uwsm app -- uuctl walker -d

$lockcmd = loginctl lock-session

##############################################
################## KEYBINDS ##################
##############################################

$mainMod = SUPER

bind = $mainMod, E, exec, $filemanager
bind = $mainMod, W, exec, $browser
bind = $mainMod SHIFT, W, exec, $browserprv
bind = $mainMod Shift, E, exec, $editor
bind = $mainMod Shift ALT_L, E, exec, $editor0
bind = $mainMod, X, exec, $launcher
bind = $mainMod, C, exec, $clipman
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, Escape, exec, $taskman

bind = $mainMod SHIFT, C, exec, hyprctl reload      # reload Hyprland
bind = $mainMod SHIFT, Pause, exit,
bind = $mainMod, Pause, exec, $lockcmd
bind = $mainMod SHIFT, Escape, exec, $lockcmd

bind = $mainMod, I, pin
bind = $mainMod, Q, killactive,
bind = $mainMod, Space, togglefloating,
bind = $mainMod SHIFT, F, fullscreen

bind = $mainMod SHIFT, S, movetoworkspace, special  # move to the special workspace
bind = $mainMod, S, togglespecialworkspace          # show/hide special workspace

#dwindle layout
bind = $mainMod, Tab, swapsplit,
bind = $mainMod SHIFT, Tab, togglesplit,
bind = $mainMod CTRL, Tab, layoutmsg, movetoroot
bind = $mainMod, P, pseudo,

# MOVE FOCUS with mainMod + vim keys
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d

# MOVE WINDOW with mainMod SHIFT + vim keys
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d

# Resize window with mainMod + CTRL + vim keys
bind = $mainMod CTRL, h, resizeactive,-25 0
bind = $mainMod CTRL, l, resizeactive,25 0
bind = $mainMod CTRL, k, resizeactive,0 -25
bind = $mainMod CTRL, j, resizeactive,0 25

# 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

# MOVE/RESIZE WINDOWS with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Laptop multimedia keys for volume and LCD brightness
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-

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

bind = , Print, exec, grimblast --notify copy output
bind = $mainMod, Print, exec, grimblast --notify edit area
