# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  #
# This is where you put your own keybinds. Be Mindful to check as well ~/.config/hypr/configs/Keybinds.conf to avoid conflict
# if you think I should replace the Pre-defined Keybinds in ~/.config/hypr/configs/Keybinds.conf , submit an issue or let me know in DC and present me a valid reason as to why, such as conflicting with global shortcuts, etc etc

# See https://wiki.hyprland.org/Configuring/Keywords/ for more settings and variables
# See also Laptops.conf for laptops keybinds 

# /* ---- ✴️ Variables ✴️ ---- */  #
$mainMod = SUPER
$scriptsDir = $HOME/.config/hypr/scripts
$UserScripts = $HOME/.config/hypr/UserScripts
$UserConfigs = $HOME/.config/hypr/UserConfigs

# settings for User defaults apps - set your default terminal and file manager on this file
source= $UserConfigs/01-UserDefaults.conf

# common shortcuts
#bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window # Super Key to Launch rofi menu
bind = $mainMod, R, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window # Main Menu (APP Launcher)
#bind = $mainMod, W, exec, xdg-open "https://"  # default browser
#bind = $mainMod, A, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed)
bind = $mainMod, A, global, quickshell:overviewToggle # desktop overview (if installed)
bind = $mainMod, Return, exec, $term  #terminal
bind = $mainMod, R, exec, $files #file manager
bind = $mainMod, Q, exec, $term
bind = $mainMod, W, exec, flatpak run org.mozilla.firefox


# FEATURES / EXTRAS
bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # help / cheat sheet
bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi
bind = $mainMod, period, exec, $scriptsDir/RofiEmoji.sh # emoji menu
bind = $mainMod, S, exec, $scriptsDir/RofiSearch.sh # Google search using rofi
bind = $mainMod CTRL, S, exec, rofi -show window  # list/switch apps using rofi
bind = $mainMod ALT, O, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings 
bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # Toggle animations ON/OFF
bind = $mainMod ALT, L, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or Dwindle Layout
bind = $mainMod SHIFT, V, exec, $scriptsDir/ClipManager.sh # Clipboard Manager
bind = $mainMod CTRL, R, exec, $scriptsDir/RofiThemeSelector.sh # KooL Rofi Menu Theme Selector
bind = $mainMod CTRL SHIFT, R, exec, pkill rofi || true && $scriptsDir/RofiThemeSelector-modified.sh # modified Rofi Theme Selector

bind = $mainMod SHIFT, F, fullscreen # whole full screen
bind = $mainMod CTRL, F, fullscreen, 1 # fake full screen
bind = $mainMod, SPACE, togglefloating, #Float Mode
bind = $mainMod ALT, SPACE, exec, hyprctl dispatch workspaceopt allfloat #All Float Mode
bind = $mainMod SHIFT, Return, exec, $scriptsDir/Dropterminal.sh $term # Dropdown terminal

# Desktop zooming or magnifier
bind = $mainMod ALT, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')"
bind = $mainMod ALT, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" 

## NOTES for ja (Hyprland version 0.39 (Ubuntu 24.04))
#bind = $mainMod ALT, mouse_down, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')"
#bind = $mainMod ALT, mouse_up, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" 

# Waybar / Bar related
bind = $mainMod CTRL ALT, B, exec, pkill -SIGUSR1 waybar # Toggle hide/show waybar 
bind = $mainMod CTRL, B, exec, $scriptsDir/WaybarStyles.sh # Waybar Styles Menu
bind = $mainMod ALT, B, exec, $scriptsDir/WaybarLayout.sh # Waybar Layout Menu

# Night light toggle (Hyprsunset)
bind = $mainMod, N, exec, $scriptsDir/Hyprsunset.sh toggle

# FEATURES / EXTRAS (UserScripts)
bind = $mainMod SHIFT, M, exec, $UserScripts/RofiBeats.sh # online music using rofi
bind = $mainMod SHIFT, W, exec, $UserScripts/WallpaperSelect.sh # Select wallpaper to apply
bind = $mainMod SHIFT, W, exec, $UserScripts/WallpaperEffects.sh # Wallpaper Effects by imagemagick
bind = CTRL ALT, W, exec, $UserScripts/WallpaperRandom.sh # Random wallpapers
bind = $mainMod CTRL, O, exec, hyprctl setprop active opaque toggle # disable opacity on active window
bind = $mainMod SHIFT, K, exec, $scriptsDir/KeyBinds.sh # search keybinds via rofi
bind = $mainMod SHIFT, A, exec, $scriptsDir/Animations.sh #hyprland animations menu
bind = $mainMod SHIFT, O, exec, $UserScripts/ZshChangeTheme.sh # Change oh-my-zsh theme
bindln = ALT_L, SHIFT_L, exec, $scriptsDir/SwitchKeyboardLayout.sh # Change keyboard layout globally
bindln = SHIFT_L, ALT_L, exec, $scriptsDir/Tak0-Per-Window-Switch.sh # Change keyboard layout locally for each window
bind = $mainMod ALT, C, exec, $UserScripts/RofiCalc.sh # calculator (qalculate)

# Move current workspaces to monitors (left right up or down)
bind = $mainMod CTRL, F9, movecurrentworkspacetomonitor, l #move current workspace to LEFT monitor
bind = $mainMod CTRL, F10, movecurrentworkspacetomonitor, r #move current workspace to RIGHT monitor
bind = $mainMod CTRL, F11, movecurrentworkspacetomonitor, u #move current workspace to UP monitor
bind = $mainMod CTRL, F12, movecurrentworkspacetomonitor, d #move current workspace to DOWN monitor


# For passthrough keyboard into a VM
# bind = $mainMod ALT, P, submap, passthru
#submap = passthru
# to unbind
#bind = $mainMod ALT, P, submap, reset
#submap = reset
