dotfiles/.config/hypr/configs/Keybinds.conf
2025-12-15 18:20:18 +01:00

232 lines
14 KiB
Text

# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
# Default Keybinds
# visit https://wiki.hyprland.org/Configuring/Binds/ for more info
# /* ---- ✴️ Variables ✴️ ---- */ #
$mainMod = SUPER
$scriptsDir = $HOME/.config/hypr/scripts
$UserConfigs = $HOME/.config/hypr/UserConfigs
$UserScripts = $HOME/.config/hypr/UserScripts
# settings for User defaults apps - set your default terminal and file manager on this file
source= $UserConfigs/01-UserDefaults.conf
#### STANDAR ####
# Common shortcuts
#bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window # Super Key to Launch rofi menu
bindd = $mainMod, D, app launcher, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window
bindd = $mainMod, B, open default browser, exec, xdg-open "https://"
bindd = $mainMod, A, desktop overview, exec, $scriptsDir/OverviewToggle.sh # toggles quickshell or ags overview (tries QS first, falls back to AGS)
#bindd = $mainMod, A, ags overview, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed)
#bindd = $mainMod, A, Quickshell overview, global, quickshell:overviewToggle # desktop overview (if installed)
bindd = $mainMod, Return, Open terminal, exec, $term
bindd = $mainMod, E, file manager, exec, $files
# FEATURES / EXTRAS
bindd = $mainMod, H, help / cheat sheet, exec, $scriptsDir/KeyHints.sh
bindd = $mainMod ALT, R, refresh bar and menus, exec, $scriptsDir/Refresh.sh
bindd = $mainMod ALT, E, emoji menu, exec, $scriptsDir/RofiEmoji.sh
bindd = $mainMod, S, web search, exec, $scriptsDir/RofiSearch.sh
bindd = $mainMod CTRL, S, window switcher, exec, rofi -show window
bindd = $mainMod ALT, O, toggle blur, exec, $scriptsDir/ChangeBlur.sh
bindd = $mainMod SHIFT, G, toggle game mode, exec, $scriptsDir/GameMode.sh
bindd = $mainMod ALT, L, toggle master/dwindle layout, exec, $scriptsDir/ChangeLayout.sh
bindd = $mainMod ALT, V, clipboard manager, exec, $scriptsDir/ClipManager.sh
bindd = $mainMod CTRL, R, rofi theme selector, exec, $scriptsDir/RofiThemeSelector.sh
bindd = $mainMod CTRL SHIFT, R, rofi theme selector (modified), exec, pkill rofi || true && $scriptsDir/RofiThemeSelector-modified.sh
bindd = $mainMod SHIFT, F, fullscreen, fullscreen
bindd = $mainMod CTRL, F, maximize window, fullscreen, 1
bindd = $mainMod, SPACE, Float current window, togglefloating,
bindd = $mainMod ALT, SPACE, Float all windows, exec, hyprctl dispatch workspaceopt allfloat
bindd = $mainMod SHIFT, Return, DropDown terminal, exec, $scriptsDir/Dropterminal.sh $term
# Desktop zooming or magnifier
bindd = $mainMod ALT, mouse_down, zoom in, 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}')"
bindd = $mainMod ALT, mouse_up, zoom out, 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}')"
# Waybar / Bar related
bindd = $mainMod CTRL ALT, B, toggle waybar on/off, exec, pkill -SIGUSR1 waybar
bindd = $mainMod CTRL, B, waybar styles menu, exec, $scriptsDir/WaybarStyles.sh
bindd = $mainMod ALT, B, waybar layout menu, exec, $scriptsDir/WaybarLayout.sh
# Night light toggle (Hyprsunset)
bindd = $mainMod, N, toggle night light, exec, $scriptsDir/Hyprsunset.sh toggle
# FEATURES / EXTRAS (UserScripts)
bindd = $mainMod SHIFT, M, online music, exec, $UserScripts/RofiBeats.sh
bindd = $mainMod, W, select wallpaper, exec, $UserScripts/WallpaperSelect.sh
bindd = $mainMod SHIFT, W, wallpaper effects, exec, $UserScripts/WallpaperEffects.sh
bindd = CTRL ALT, W, random wallpaper, exec, $UserScripts/WallpaperRandom.sh
bindd = $mainMod CTRL, O, toggle active window opacity, exec, hyprctl setprop active opaque toggle
bindd = $mainMod SHIFT, K, search keybinds, exec, $scriptsDir/KeyBinds.sh
bindd = $mainMod SHIFT, A, animations menu, exec, $scriptsDir/Animations.sh
bindd = $mainMod SHIFT, O, change oh-my-zsh theme, exec, $UserScripts/ZshChangeTheme.sh
bindlnd = ALT_L, SHIFT_L, switch keyboard layout globally, exec, $scriptsDir/SwitchKeyboardLayout.sh
bindlnd = SHIFT_L, ALT_L, switch keyboard layout per-window, exec, $scriptsDir/Tak0-Per-Window-Switch.sh
bindd = $mainMod ALT, C, calculator, exec, $UserScripts/RofiCalc.sh
# Move current workspaces to monitors (left right up or down)
bindd = $mainMod CTRL, F9, move workspace to left monitor, movecurrentworkspacetomonitor, l
bindd = $mainMod CTRL, F10, move workspace to right monitor, movecurrentworkspacetomonitor, r
bindd = $mainMod CTRL, F11, move workspace to up monitor, movecurrentworkspacetomonitor, u
bindd = $mainMod CTRL, F12, move workspace to down monitor, movecurrentworkspacetomonitor, d
#### SYSTEM ####
bindd = CTRL ALT, Delete, exit Hyprland, exec, hyprctl dispatch exit 0
bindd = $mainMod, Q, close active window, killactive,
bindd = $mainMod SHIFT, Q, Terminate active process, exec, $scriptsDir/KillActiveProcess.sh
bindd = CTRL ALT, L, lock screen, exec, $scriptsDir/LockScreen.sh
bindd = CTRL ALT, P, powermenu, exec, $scriptsDir/Wlogout.sh
bindd = $mainMod SHIFT, N, notification panel, exec, swaync-client -t -sw
bindd = $mainMod SHIFT, E, Quick settings menu, exec, $scriptsDir/Kool_Quick_Settings.sh
# Master Layout
bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster
bindd = $mainMod, I, add master, layoutmsg, addmaster
# NOTE: J/K bindings are set dynamically by scripts/KeybindsLayoutInit.sh and scripts/ChangeLayout.sh
# (we intentionally do not bind them statically here to avoid conflicts across layouts)
# bindd = $mainMod, J, cycle next, layoutmsg, cyclenext
# bindd = $mainMod, K, cycle previous, layoutmsg, cycleprev
bindd = $mainMod CTRL, Return, swap with master, layoutmsg, swapwithmaster
# Dwindle Layout
bindd = $mainMod SHIFT, I, toggle split (dwindle), togglesplit
bindd = $mainMod, P, toggle pseudo (dwindle), pseudo,
# Works on either layout (Master or Dwindle)
bindd = $mainMod, M, set split ratio 0.3, exec, hyprctl dispatch splitratio 0.3
# Cycle windows; if floating bring to top
bindd = ALT, tab, cycle next window, cyclenext
bindd = ALT, tab, bring active to top, bringactivetotop
# Special Keys / Hot Keys
bindeld = , xf86audioraisevolume, volume up, exec, $scriptsDir/Volume.sh --inc
bindeld = , xf86audiolowervolume, volume down, exec, $scriptsDir/Volume.sh --dec
bindld = , xf86AudioMicMute, toggle mic mute, exec, $scriptsDir/Volume.sh --toggle-mic
bindld = , xf86audiomute, toggle mute, exec, $scriptsDir/Volume.sh --toggle
bindld = , xf86Sleep, sleep, exec, systemctl suspend
bindld = , xf86Rfkill, airplane mode, exec, $scriptsDir/AirplaneMode.sh
# media controls using keyboards
bindld = , xf86AudioPlayPause, play/pause, exec, $scriptsDir/MediaCtrl.sh --pause
bindld = , xf86AudioPause, pause, exec, $scriptsDir/MediaCtrl.sh --pause
bindld = , xf86AudioPlay, play, exec, $scriptsDir/MediaCtrl.sh --pause
bindld = , xf86AudioNext, next track, exec, $scriptsDir/MediaCtrl.sh --nxt
bindld = , xf86AudioPrev, previous track, exec, $scriptsDir/MediaCtrl.sh --prv
bindld = , xf86audiostop, stop, exec, $scriptsDir/MediaCtrl.sh --stop
# Screenshot keybindings NOTE: You may need to press Fn key as well
bindd = $mainMod, Print, screenshot now, exec, $scriptsDir/ScreenShot.sh --now
bindd = $mainMod SHIFT, Print, screenshot (area), exec, $scriptsDir/ScreenShot.sh --area
bindd = $mainMod CTRL, Print, screenshot in 5s, exec, $scriptsDir/ScreenShot.sh --in5
bindd = $mainMod CTRL SHIFT, Print, screenshot in 10s, exec, $scriptsDir/ScreenShot.sh --in10
bindd = ALT, Print, screenshot active window, exec, $scriptsDir/ScreenShot.sh --active
# screenshot with swappy (another screenshot tool)
bindd = $mainMod SHIFT, S, screenshot (swappy), exec, $scriptsDir/ScreenShot.sh --swappy
# Resize windows
binded = $mainMod SHIFT, left, resize left (-50), resizeactive, -50 0
binded = $mainMod SHIFT, right, resize right (+50), resizeactive, 50 0
binded = $mainMod SHIFT, up, resize up (-50), resizeactive, 0 -50
binded = $mainMod SHIFT, down, resize down (+50), resizeactive, 0 50
# Move windows
bindd = $mainMod CTRL, left, move window left, movewindow, l
bindd = $mainMod CTRL, right, move window right, movewindow, r
bindd = $mainMod CTRL, up, move window up, movewindow, u
bindd = $mainMod CTRL, down, move window down, movewindow, d
# Swap windows
bindd = $mainMod ALT, left, swap window left, swapwindow, l
bindd = $mainMod ALT, right, swap window right, swapwindow, r
bindd = $mainMod ALT, up, swap window up, swapwindow, u
bindd = $mainMod ALT, down, swap window down, swapwindow, d
# group
bindd = $mainMod, G, toggle group, togglegroup
# Navigate within a group
bindd = $mainMod, Tab, Change Group Forward, changegroupactive, f
bindd = $mainMod CTRL, tab, change active in group, changegroupactive
bindd = $mainMod SHIFT, Tab, Change Group Back, changegroupactive, b
# Move window into/out of group
bindd = $mainMod CTRL, K, Move left into group, moveintogroup, l # Move active window left into a group A
bindd = $mainMod CTRL, L, Move Right into group, moveintogroup, r # Move active window right into a group
bindd = $mainMod CTRL, H, Move active out of group, moveoutofgroup # Move active window out of group
# Try to dynamically move in grouped window and when ungrouped
# Not working for me DW 11/26/25 PR: https://github.com/JaKooLit/Hyprland-Dots/pull/872
#bindd = $mainMod, right, focus right, exec, bash -c 'if hyprctl activewindow -j | jq -e "((.grouped | type) == \"boolean\") or (.address == (.grouped[-1] // empty))" >/dev/null 2>&1; then hyprctl dispatch movefocus r; else hyprctl dispatch changegroupactive f; fi'
#bindd = $mainMod, left, focus left, exec, bash -c 'if hyprctl activewindow -j | jq -e "((.grouped | type) == \"boolean\") or (.address == (.grouped[0] // empty))" >/dev/null 2>&1; then hyprctl dispatch movefocus l; else hyprctl dispatch changegroupactive b; fi'
# Move focus with mainMod + arrow keys
bindd = $mainMod, left, focus left, movefocus, l
bindd = $mainMod, right, focus right, movefocus, r
bindd = $mainMod, up, focus up, movefocus, u
bindd = $mainMod, down, focus down, movefocus, d
# Workspaces related
bindd = $mainMod, tab, next workspace, workspace, m+1
bindd = $mainMod SHIFT, tab, previous workspace, workspace, m-1
# Special workspace
bindd = $mainMod SHIFT, U, move to special workspace, movetoworkspace, special
bindd = $mainMod, U, toggle special workspace, togglespecialworkspace,
# The following mappings use the key codes to better support various keyboard layouts
# 1 is code:10, 2 is code 11, etc
# Switch workspaces with mainMod + [0-9]
bindd = $mainMod, code:10, workspace 1, workspace, 1 # NOTE: code:10 = key 1
bindd = $mainMod, code:11, workspace 2, workspace, 2 # NOTE: code:11 = key 2
bindd = $mainMod, code:12, workspace 3, workspace, 3 # NOTE: code:12 = key 3
bindd = $mainMod, code:13, workspace 4, workspace, 4 # NOTE: code:13 = key 4
bindd = $mainMod, code:14, workspace 5, workspace, 5 # NOTE: code:14 = key 5
bindd = $mainMod, code:15, workspace 6, workspace, 6 # NOTE: code:15 = key 6
bindd = $mainMod, code:16, workspace 7, workspace, 7 # NOTE: code:16 = key 7
bindd = $mainMod, code:17, workspace 8, workspace, 8 # NOTE: code:17 = key 8
bindd = $mainMod, code:18, workspace 9, workspace, 9 # NOTE: code:18 = key 9
bindd = $mainMod, code:19, workspace 10, workspace, 10 # NOTE: code:19 = key 0
# Move active window and follow to workspace mainMod + SHIFT [0-9]
bindd = $mainMod SHIFT, code:10, move to workspace 1, movetoworkspace, 1 # NOTE: code:10 = key 1
bindd = $mainMod SHIFT, code:11, move to workspace 2, movetoworkspace, 2 # NOTE: code:11 = key 2
bindd = $mainMod SHIFT, code:12, move to workspace 3, movetoworkspace, 3 # NOTE: code:12 = key 3
bindd = $mainMod SHIFT, code:13, move to workspace 4, movetoworkspace, 4 # NOTE: code:13 = key 4
bindd = $mainMod SHIFT, code:14, move to workspace 5, movetoworkspace, 5 # NOTE: code:14 = key 5
bindd = $mainMod SHIFT, code:15, move to workspace 6, movetoworkspace, 6 # NOTE: code:15 = key 6
bindd = $mainMod SHIFT, code:16, move to workspace 7, movetoworkspace, 7 # NOTE: code:16 = key 7
bindd = $mainMod SHIFT, code:17, move to workspace 8, movetoworkspace, 8 # NOTE: code:17 = key 8
bindd = $mainMod SHIFT, code:18, move to workspace 9, movetoworkspace, 9 # NOTE: code:18 = key 9
bindd = $mainMod SHIFT, code:19, move to workspace 10, movetoworkspace, 10 # NOTE: code:19 = key 0
bindd = $mainMod SHIFT, bracketleft, move to previous workspace, movetoworkspace, -1 # brackets [
bindd = $mainMod SHIFT, bracketright, move to next workspace, movetoworkspace, +1 # brackets ]
# Move active window to a workspace silently mainMod + CTRL [0-9]
bindd = $mainMod CTRL, code:10, move silently to workspace 1, movetoworkspacesilent, 1 # NOTE: code:10 = key 1
bindd = $mainMod CTRL, code:11, move silently to workspace 2, movetoworkspacesilent, 2 # NOTE: code:11 = key 2
bindd = $mainMod CTRL, code:12, move silently to workspace 3, movetoworkspacesilent, 3 # NOTE: code:12 = key 3
bindd = $mainMod CTRL, code:13, move silently to workspace 4, movetoworkspacesilent, 4 # NOTE: code:13 = key 4
bindd = $mainMod CTRL, code:14, move silently to workspace 5, movetoworkspacesilent, 5 # NOTE: code:14 = key 5
bindd = $mainMod CTRL, code:15, move silently to workspace 6, movetoworkspacesilent, 6 # NOTE: code:15 = key 6
bindd = $mainMod CTRL, code:16, move silently to workspace 7, movetoworkspacesilent, 7 # NOTE: code:16 = key 7
bindd = $mainMod CTRL, code:17, move silently to workspace 8, movetoworkspacesilent, 8 # NOTE: code:17 = key 8
bindd = $mainMod CTRL, code:18, move silently to workspace 9, movetoworkspacesilent, 9 # NOTE: code:18 = key 9
bindd = $mainMod CTRL, code:19, move silently to workspace 10, movetoworkspacesilent, 10 # NOTE: code:19 = key 0
bindd = $mainMod CTRL, bracketleft, move silently to previous workspace, movetoworkspacesilent, -1 # brackets [
bindd = $mainMod CTRL, bracketright, move silently to next workspace, movetoworkspacesilent, +1 # brackets ]
# Scroll through existing workspaces with mainMod + scroll
bindd = $mainMod, mouse_down, next workspace, workspace, e+1
bindd = $mainMod, mouse_up, previous workspace, workspace, e-1
bindd = $mainMod, period, next workspace, workspace, e+1
bindd = $mainMod, comma, previous workspace, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindmd = $mainMod, mouse:272, move window, movewindow # NOTE: mouse:272 = left click
bindmd = $mainMod, mouse:273, resize window, resizewindow # NOTE: mouse:272 = right click