# Set programs that you use
$terminal = alacritty
$fileManager = dolphin
$menu = pgrep -x tofi-drun && pkill -x tofi-drun || tofi-drun --drun-launch=true > ~/.logs/tofi-drun.log 2>&1 &
$clipboard = /home/nathan/.local/bin/clipse
$StartWallpaperTimer = systemctl --user start wallpaper.timer && WallRizz -r -n -d ~/.config/backgrounds
$mainMod = SUPER


bind = CTRL ALT, T, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, F, togglefloating, 
bind = $mainMod, space, exec, $menu
bind = ALT, SPACE, exec, ~/.config/hypr/scripts/search-windows.sh
bind = $mainMod, L, exec, ~/.config/hypr/scripts/lock.sh
bind = $mainMod, H, exec, alacritty --class float -e ~/.config/hypr/scripts/help.py
bind = CTRL ALT, DELETE, exec, hyprpanel t powermenu

#bind = $mainMod, V, exec, [float] alacritty --class clipse -e /home/nathan/.local/bin/clipse
bind = $mainMod, V, exec, [float] kitty --class float-80 -e $clipboard



# Layout
bind = $mainMod, J, togglesplit, # Split direction
bind = $mainMod, code:35, togglesplit, # Split direction
bind = $mainMod SHIFT, J,swapsplit # Swap master and secondary in dwindle

# 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

# Dedicated special workspace for terminal
bind = $mainMod, S, togglespecialworkspace, terminal
bind = $mainMod CTRL, S, movetoworkspace, special:terminal
bind = CTRL ALT, TAB, togglespecialworkspace, terminal

# Screenshots
bind = $mainMod SHIFT, S, exec, hyprshot -m region
bind = $mainMod CTRL SHIFT, S, exec, hyprshot -m window -m active

# Used to use overview:toggle, but that resises the windows
# bind = $mainMod, TAB, overview:toggle
# bind = CTRL ALT, TAB, overview:toggle

# hyprlang noerror true

bind = $mainMod, TAB, hyprexpo:expo, toggle

# hyprlang noerror false



# Media control keys
bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+
bindle=, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-
bindle=, XF86MonBrightnessUp, exec, brightnessctl s +5%
bindle=, XF86MonBrightnessDown, exec, brightnessctl s 5%-
bind=, XF86Search, exec, $menu
# bindl=, XF86AudioMute, exec, amixer set Master toggle
bindl=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindl=, XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindl=, XF86AudioPlay, exec, playerctl play-pause # the stupid key is called play , but it toggles 
bindl=, XF86AudioNext, exec, playerctl next 
bindl=, XF86AudioPrev, exec, playerctl previous

# Other FN keys
bind= $mainMod CTRL, XF86TouchpadToggle, exec, hyprctl notify -1 2000 -1 "TODO Touchpad Toggle"
bind = $mainMod, P, exec, hyprctl notify -1 2000 -1 "TODO Screen Settings"
bindl = , Print, exec, hyprshot -m output -m active
bind = $mainMod, Print, exec, hyprshot -m window -m active
bind = $mainMod CTRL, Print, exec, hyprshot -m region

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

# Mouse wheel tilt
bind = , mouse_left, exec, ydotool key 56:1 105:1 105:0 56:0
bind = , mouse_right, exec, ydotool key 56:1 106:1 106:0 56:0

# Gromit for drawing
bind = SUPER CTRL, P, exec, ~/.config/hypr/scripts/gromit.py

# Emoji
bind = $mainMod, PERIOD, exec, bemoji

# Custom terminal
bind = $mainMod, T, exec, alacritty --config-file ~/dotfiles/.alacritty-nozellij.toml


bind = $mainMod, W, exec, ~/.config/hypr/scripts/wallpaper.sh
bind = $mainMod CTRL, W, exec, $StartWallpaperTimer


# Capslock toggle submap
$caps = VoidSymbol
bind = , $caps, submap, capsmode
submap = capsmode
# Bindings for submap

bind = , 1, exec, hyprctl notify 5 2000 0 "Opening Brave Browser"
bind = , 1, exec, brave --proxy-pac-url="https://pac.cn01.woodburn.au/proxy.pac" --enable-features=UseOzonePlatform --ozone-platform=wayland --use-gl=angle --ignore-gpu-blocklist --enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization,VaapiIgnoreDriverChecks,VaapiVideoDecodeLinuxGL,AcceleratedVideoEncoder --disable-gpu-memory-buffer-video-frames --disable-features=WaylandWpColorManagerV1
bind = , 1, submap, reset

bind = , 2, exec, hyprpanel -q
bind = , 2, exec, hyprpanel
bind = , 2, submap, reset

bind = CTRL, 3, movetoworkspace, special:alternate
bind = CTRL, 3, submap, reset

bind = , 3, togglespecialworkspace, alternate
bind = , 3, submap, reset


bind = , T, exec, hyprctl notify 5 2000 0 "Select text to copy to clipboard..."
bind = , T, exec, ~/.config/OCR4Linux/OCR4Linux.sh --lang eng -r
bind = , T, submap, reset

# Disable errors for this plugin
# hyprlang noerror true
bind = , I, invertactivewindow
bind = , I, submap, reset
# hyprlang noerror false

bind = , V, exec, hyprctl notify 5 2000 0 "Resetting Virtual Desks..."
bind = , V, exec, hyprctl dispatch vdeskreset
bind = , V, submap, reset

bind = , K, exec, hyprctl notify 0 2000 0 "Click To Kill!!!"
bind = , K, exec, hyprctl kill
bind = , K, submap, reset

bind = , O, exec, hyprctl notify 2 2000 0 "Set Opacity..."
bind = , O, submap, opacity

# Help information
bind = , H, exec, alacritty --class float -e ~/.config/hypr/scripts/help.py
bind = , H, submap, reset

bind = , catchall, submap, reset


# Opacity submap
submap = opacity
bind = , 1, exec, ~/.config/hypr/scripts/opacity.py 0.1
bind = , 2, exec, ~/.config/hypr/scripts/opacity.py 0.2
bind = , 3, exec, ~/.config/hypr/scripts/opacity.py 0.3
bind = , 4, exec, ~/.config/hypr/scripts/opacity.py 0.4
bind = , 5, exec, ~/.config/hypr/scripts/opacity.py 0.5
bind = , 6, exec, ~/.config/hypr/scripts/opacity.py 0.6
bind = , 7, exec, ~/.config/hypr/scripts/opacity.py 0.7
bind = , 8, exec, ~/.config/hypr/scripts/opacity.py 0.8
bind = , 9, exec, ~/.config/hypr/scripts/opacity.py 0.9
bind = , 0, exec, ~/.config/hypr/scripts/opacity.py 1
bind = , C, exec, ~/.config/hypr/scripts/opacity.py -1
bind = , code:20, exec, ~/.config/hypr/scripts/opacity.py -1
bind = , catchall, submap, reset


submap = reset
