From 758b466c5f2030188d46511b20ad39c6d8b46a0d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Tue, 28 Oct 2025 17:30:59 -0400 Subject: Changed /usr/bin/bash to /usr/bin/env bash On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: Distro-Hyprland.sh modified: config/hypr/UserScripts/RainbowBorders.sh modified: config/hypr/UserScripts/RofiBeats.sh modified: config/hypr/UserScripts/RofiCalc.sh modified: config/hypr/UserScripts/Tak0-Autodispatch.sh modified: config/hypr/UserScripts/WallpaperAutoChange.sh modified: config/hypr/UserScripts/WallpaperEffects.sh modified: config/hypr/UserScripts/WallpaperRandom.sh modified: config/hypr/UserScripts/WallpaperSelect.sh modified: config/hypr/UserScripts/Weather.sh modified: config/hypr/UserScripts/WeatherWrap.sh modified: config/hypr/UserScripts/ZshChangeTheme.sh new file: config/hypr/configs/Startup_Apps.conf new file: config/hypr/configs/WindowRules.conf modified: config/hypr/hyprland.conf modified: config/hypr/initial-boot.sh modified: config/hypr/scripts/AirplaneMode.sh modified: config/hypr/scripts/Animations.sh modified: config/hypr/scripts/Battery.sh modified: config/hypr/scripts/Brightness.sh modified: config/hypr/scripts/BrightnessKbd.sh modified: config/hypr/scripts/ChangeBlur.sh modified: config/hypr/scripts/ChangeLayout.sh modified: config/hypr/scripts/ClipManager.sh new file: config/hypr/scripts/ComposeHyprConfigs.sh modified: config/hypr/scripts/DarkLight.sh modified: config/hypr/scripts/Distro_update.sh modified: config/hypr/scripts/Dropterminal.sh modified: config/hypr/scripts/GameMode.sh modified: config/hypr/scripts/Hypridle.sh modified: config/hypr/scripts/KeyBinds.sh modified: config/hypr/scripts/KeyHints.sh modified: config/hypr/scripts/KillActiveProcess.sh modified: config/hypr/scripts/Kitty_themes.sh modified: config/hypr/scripts/KooLsDotsUpdate.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh modified: config/hypr/scripts/LockScreen.sh modified: config/hypr/scripts/MediaCtrl.sh modified: config/hypr/scripts/MonitorProfiles.sh modified: config/hypr/scripts/Polkit-NixOS.sh modified: config/hypr/scripts/Polkit.sh modified: config/hypr/scripts/PortalHyprland.sh modified: config/hypr/scripts/Refresh.sh modified: config/hypr/scripts/RefreshNoWaybar.sh modified: config/hypr/scripts/RofiEmoji.sh modified: config/hypr/scripts/RofiSearch.sh modified: config/hypr/scripts/RofiThemeSelector-modified.sh modified: config/hypr/scripts/RofiThemeSelector.sh modified: config/hypr/scripts/ScreenShot.sh modified: config/hypr/scripts/Sounds.sh modified: config/hypr/scripts/SwitchKeyboardLayout.sh modified: config/hypr/scripts/Tak0-Autodispatch.sh modified: config/hypr/scripts/TouchPad.sh modified: config/hypr/scripts/Volume.sh modified: config/hypr/scripts/WallustSwww.sh modified: config/hypr/scripts/WaybarLayout.sh modified: config/hypr/scripts/WaybarScripts.sh modified: config/hypr/scripts/WaybarStyles.sh modified: config/hypr/scripts/Wlogout.sh modified: config/hypr/scripts/sddm_wallpaper.sh modified: copy.sh modified: release.sh modified: upgrade.sh --- config/hypr/scripts/KeyBinds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts/KeyBinds.sh') diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index 9c6b5ab7..3a19390f 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # searchable enabled keybinds using rofi -- cgit v1.2.3 From 70cb1f313d04558da9ab4e4f9ca5eecd373acb45 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Thu, 30 Oct 2025 22:39:02 -0400 Subject: refactor(keybinds): use bindd with descriptions across configs - Convert binds to description form (bindd/bindld/binded/bindmd/bindlnd) - Keep naming as powermenu for shutdown/reboot/logout/suspend - Update KeyBinds.sh to parse and display descriptions - Update CHANGELOG --- CHANGELOG.md | 8 ++ config/hypr/UserConfigs/UserKeybinds.conf | 82 ++++++------- config/hypr/configs/Keybinds.conf | 196 +++++++++++++++--------------- config/hypr/scripts/KeyBinds.sh | 69 +++++++++-- 4 files changed, 203 insertions(+), 152 deletions(-) (limited to 'config/hypr/scripts/KeyBinds.sh') diff --git a/CHANGELOG.md b/CHANGELOG.md index 623e697c..dd01997b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## October 2025 +### ⌨️ Keybinds + +- Convert Hyprland keybinds to description form (`bindd`, `bindld`, `binded`, + `bindmd`, `bindlnd`) in `config/hypr/...`. +- Add concise descriptions for each keybind; keep the name "powermenu". +- Update `config/hypr/scripts/KeyBinds.sh` to parse and display descriptions + as: MODS+KEY — DESCRIPTION — DISPATCHER [PARAMS]. + ### 🐛 Fixes - Updated `/bin/bash` to `/usr/bin/env bash` diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 338bf0d1..5b257b33 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -16,67 +16,67 @@ 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, D, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window # Main Menu (APP Launcher) -bind = $mainMod, B, exec, xdg-open "https://" # default browser +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://" #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, E, exec, $files #file manager +bindd = $mainMod, Return, terminal, exec, $term +bindd = $mainMod, E, file manager, exec, $files # 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 ALT, E, 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 ALT, 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 +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 -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 +bindd = $mainMod SHIFT, F, fullscreen, fullscreen +bindd = $mainMod CTRL, F, fake fullscreen, fullscreen, 1 +bindd = $mainMod, SPACE, toggle floating, togglefloating, +bindd = $mainMod ALT, SPACE, all float mode, exec, hyprctl dispatch workspaceopt allfloat +bindd = $mainMod SHIFT, Return, dropdown terminal, exec, $scriptsDir/Dropterminal.sh $term # 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}')" +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}')" ## 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 +bindd = $mainMod CTRL ALT, B, toggle waybar, 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) -bind = $mainMod, N, exec, $scriptsDir/Hyprsunset.sh toggle +bindd = $mainMod, N, toggle night light, exec, $scriptsDir/Hyprsunset.sh toggle # FEATURES / EXTRAS (UserScripts) -bind = $mainMod SHIFT, M, exec, $UserScripts/RofiBeats.sh # online music using rofi -bind = $mainMod, 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) +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) -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 +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 # For passthrough keyboard into a VM diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index c2ba9681..0fa250b7 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -8,142 +8,142 @@ $scriptsDir = $HOME/.config/hypr/scripts $UserConfigs = $HOME/.config/hypr/UserConfigs $UserScripts = $HOME/.config/hypr/UserScripts -bind = CTRL ALT, Delete, exec, hyprctl dispatch exit 0 # exit Hyprland -bind = $mainMod, Q, killactive, # close active (not kill) -bind = $mainMod SHIFT, Q, exec, $scriptsDir/KillActiveProcess.sh # Kill active process -bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh # screen lock -bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh # power menu -bind = $mainMod SHIFT, N, exec, swaync-client -t -sw # swayNC notification panel -bind = $mainMod SHIFT, E, exec, $scriptsDir/Kool_Quick_Settings.sh # Settings Menu KooL Hyprland Settings +bindd = CTRL ALT, Delete, exit Hyprland, exec, hyprctl dispatch exit 0 +bindd = $mainMod, Q, close active window, killactive, +bindd = $mainMod SHIFT, Q, kill 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, settings menu, exec, $scriptsDir/Kool_Quick_Settings.sh # Master Layout -bind = $mainMod CTRL, D, layoutmsg, removemaster -bind = $mainMod, I, layoutmsg, addmaster -bind = $mainMod, J, layoutmsg, cyclenext -bind = $mainMod, K, layoutmsg, cycleprev -bind = $mainMod CTRL, Return, layoutmsg, swapwithmaster +bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster +bindd = $mainMod, I, add master, layoutmsg, addmaster +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 -bind = $mainMod SHIFT, I, togglesplit # only works on dwindle layout -bind = $mainMod, P, pseudo, # dwindle +bindd = $mainMod SHIFT, I, toggle split (dwindle), togglesplit +bindd = $mainMod, P, toggle pseudo (dwindle), pseudo, # Works on either layout (Master or Dwindle) -bind = $mainMod, M, exec, hyprctl dispatch splitratio 0.3 +bindd = $mainMod, M, set split ratio 0.3, exec, hyprctl dispatch splitratio 0.3 # group -bind = $mainMod, G, togglegroup # toggle group -bind = $mainMod CTRL, tab, changegroupactive # change focus to another window +bindd = $mainMod, G, toggle group, togglegroup +bindd = $mainMod CTRL, tab, change active in group, changegroupactive - # Cycle windows if floating bring to top -bind = ALT, tab, cyclenext -bind = ALT, tab, bringactivetotop +# 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 -bindel = , xf86audioraisevolume, exec, $scriptsDir/Volume.sh --inc # volume up -bindel = , xf86audiolowervolume, exec, $scriptsDir/Volume.sh --dec # volume down -bindl = , xf86AudioMicMute, exec, $scriptsDir/Volume.sh --toggle-mic # mic mute -bindl = , xf86audiomute, exec, $scriptsDir/Volume.sh --toggle # mute -bindl = , xf86Sleep, exec, systemctl suspend # sleep button -bindl = , xf86Rfkill, exec, $scriptsDir/AirplaneMode.sh # Airplane mode +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 -bindl = , xf86AudioPlayPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPlay, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioNext, exec, $scriptsDir/MediaCtrl.sh --nxt -bindl = , xf86AudioPrev, exec, $scriptsDir/MediaCtrl.sh --prv -bindl = , xf86audiostop, exec, $scriptsDir/MediaCtrl.sh --stop +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 -bind = $mainMod, Print, exec, $scriptsDir/ScreenShot.sh --now # screenshot -bind = $mainMod SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --area # screenshot (area) -bind = $mainMod CTRL, Print, exec, $scriptsDir/ScreenShot.sh --in5 # screenshot (5 secs delay) -bind = $mainMod CTRL SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --in10 # screenshot (10 secs delay) -bind = ALT, Print, exec, $scriptsDir/ScreenShot.sh --active # screenshot (active window only) +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) -bind = $mainMod SHIFT, S, exec, $scriptsDir/ScreenShot.sh --swappy #screenshot (swappy) +bindd = $mainMod SHIFT, S, screenshot (swappy), exec, $scriptsDir/ScreenShot.sh --swappy # Resize windows -binde = $mainMod SHIFT, left, resizeactive,-50 0 -binde = $mainMod SHIFT, right, resizeactive,50 0 -binde = $mainMod SHIFT, up, resizeactive,0 -50 -binde = $mainMod SHIFT, down, resizeactive,0 50 +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 -bind = $mainMod CTRL, left, movewindow, l -bind = $mainMod CTRL, right, movewindow, r -bind = $mainMod CTRL, up, movewindow, u -bind = $mainMod CTRL, down, movewindow, d +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 -bind = $mainMod ALT, left, swapwindow, l -bind = $mainMod ALT, right, swapwindow, r -bind = $mainMod ALT, up, swapwindow, u -bind = $mainMod ALT, down, swapwindow, d +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 # 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 +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 -bind = $mainMod, tab, workspace, m+1 -bind = $mainMod SHIFT, tab, workspace, m-1 +bindd = $mainMod, tab, next workspace, workspace, m+1 +bindd = $mainMod SHIFT, tab, previous workspace, workspace, m-1 # Special workspace -bind = $mainMod SHIFT, U, movetoworkspace, special -bind = $mainMod, U, togglespecialworkspace, +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] -bind = $mainMod, code:10, workspace, 1 # NOTE: code:10 = key 1 -bind = $mainMod, code:11, workspace, 2 # NOTE: code:11 = key 2 -bind = $mainMod, code:12, workspace, 3 # NOTE: code:12 = key 3 -bind = $mainMod, code:13, workspace, 4 # NOTE: code:13 = key 4 -bind = $mainMod, code:14, workspace, 5 # NOTE: code:14 = key 5 -bind = $mainMod, code:15, workspace, 6 # NOTE: code:15 = key 6 -bind = $mainMod, code:16, workspace, 7 # NOTE: code:16 = key 7 -bind = $mainMod, code:17, workspace, 8 # NOTE: code:17 = key 8 -bind = $mainMod, code:18, workspace, 9 # NOTE: code:18 = key 9 -bind = $mainMod, code:19, workspace, 10 # NOTE: code:19 = key 0 +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] -bind = $mainMod SHIFT, code:10, movetoworkspace, 1 # NOTE: code:10 = key 1 -bind = $mainMod SHIFT, code:11, movetoworkspace, 2 # NOTE: code:11 = key 2 -bind = $mainMod SHIFT, code:12, movetoworkspace, 3 # NOTE: code:12 = key 3 -bind = $mainMod SHIFT, code:13, movetoworkspace, 4 # NOTE: code:13 = key 4 -bind = $mainMod SHIFT, code:14, movetoworkspace, 5 # NOTE: code:14 = key 5 -bind = $mainMod SHIFT, code:15, movetoworkspace, 6 # NOTE: code:15 = key 6 -bind = $mainMod SHIFT, code:16, movetoworkspace, 7 # NOTE: code:16 = key 7 -bind = $mainMod SHIFT, code:17, movetoworkspace, 8 # NOTE: code:17 = key 8 -bind = $mainMod SHIFT, code:18, movetoworkspace, 9 # NOTE: code:18 = key 9 -bind = $mainMod SHIFT, code:19, movetoworkspace, 10 # NOTE: code:19 = key 0 -bind = $mainMod SHIFT, bracketleft, movetoworkspace, -1 # brackets [ -bind = $mainMod SHIFT, bracketright, movetoworkspace, +1 # brackets ] +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] -bind = $mainMod CTRL, code:10, movetoworkspacesilent, 1 # NOTE: code:10 = key 1 -bind = $mainMod CTRL, code:11, movetoworkspacesilent, 2 # NOTE: code:11 = key 2 -bind = $mainMod CTRL, code:12, movetoworkspacesilent, 3 # NOTE: code:12 = key 3 -bind = $mainMod CTRL, code:13, movetoworkspacesilent, 4 # NOTE: code:13 = key 4 -bind = $mainMod CTRL, code:14, movetoworkspacesilent, 5 # NOTE: code:14 = key 5 -bind = $mainMod CTRL, code:15, movetoworkspacesilent, 6 # NOTE: code:15 = key 6 -bind = $mainMod CTRL, code:16, movetoworkspacesilent, 7 # NOTE: code:16 = key 7 -bind = $mainMod CTRL, code:17, movetoworkspacesilent, 8 # NOTE: code:17 = key 8 -bind = $mainMod CTRL, code:18, movetoworkspacesilent, 9 # NOTE: code:18 = key 9 -bind = $mainMod CTRL, code:19, movetoworkspacesilent, 10 # NOTE: code:19 = key 0 -bind = $mainMod CTRL, bracketleft, movetoworkspacesilent, -1 # brackets [ -bind = $mainMod CTRL, bracketright, movetoworkspacesilent, +1 # brackets ] +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 -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 -bind = $mainMod, period, workspace, e+1 -bind = $mainMod, comma, workspace, e-1 +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 -bindm = $mainMod, mouse:272, movewindow # NOTE: mouse:272 = left click -bindm = $mainMod, mouse:273, resizewindow # NOTE: mouse:272 = right click \ No newline at end of file +bindmd = $mainMod, mouse:272, move window, movewindow # NOTE: mouse:272 = left click +bindmd = $mainMod, mouse:273, resize window, resizewindow # NOTE: mouse:272 = right click diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index 3a19390f..46953cc5 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# searchable enabled keybinds using rofi +# searchable enabled keybinds using rofi (supports bindd descriptions) # kill yad to not interfere with this binds pkill yad || true @@ -17,23 +17,66 @@ laptop_conf="$HOME/.config/hypr/UserConfigs/Laptops.conf" rofi_theme="$HOME/.config/rofi/config-keybinds.rasi" msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function' -# combine the contents of the keybinds files and filter for keybinds -keybinds=$(cat "$keybinds_conf" "$user_keybinds_conf" | grep -E '^bind') +# collect raw bind lines (strip end-of-line comments) from available files +files=("$keybinds_conf" "$user_keybinds_conf") +[[ -f "$laptop_conf" ]] && files+=("$laptop_conf") -# check if laptop.conf exists and add its keybinds if present -if [[ -f "$laptop_conf" ]]; then - laptop_binds=$(grep -E '^bind' "$laptop_conf") - keybinds+=$'\n'"$laptop_binds" -fi +raw_keybinds=$(cat "${files[@]}" 2>/dev/null \ + | grep -E '^[[:space:]]*bind' \ + | sed -E 's/[[:space:]]+#.*$//') # check for any keybinds to display -if [[ -z "$keybinds" ]]; then +if [[ -z "$raw_keybinds" ]]; then echo "no keybinds found." exit 1 fi -# replace $mainmod with super in the displayed keybinds for rofi -display_keybinds=$(echo "$keybinds" | sed 's/\$mainMod/SUPER/g') +# transform into a readable list: MODS+KEY — DESCRIPTION — DISPATCHER [PARAMS] +display_keybinds=$(echo "$raw_keybinds" | awk -F'=' ' + function trim(s){ gsub(/^[ \t]+|[ \t]+$/,"",s); return s } + /^[[:space:]]*bind/ { + binder=$1; gsub(/[ \t]/, "", binder); + hasdesc = (index(binder, "d")>0); + + rhs=$2; rhs=trim(rhs); + n=split(rhs, a, /[ \t]*,[ \t]*/); + + mods=trim(a[1]); key=(n>=2?trim(a[2]):""); + desc=""; dispatcher=""; params=""; + + if (hasdesc) { + desc=(n>=3?trim(a[3]):""); + dispatcher=(n>=4?trim(a[4]):""); + start=5; + } else { + dispatcher=(n>=3?trim(a[3]):""); + start=4; + } + + for(i=start;i<=n;i++){ if(length(a[i])){ p=trim(a[i]); if(p!="") params = (params?params", ":"") p } } + + gsub(/\$mainMod/,"SUPER",mods); + gsub(/[ \t]+/,"+",mods); + + combo = (mods && key) ? mods "+" key : (key?key:mods); + + if (desc != "") { + if (dispatcher != "" && params != "") + print combo, " — ", desc, " — ", dispatcher, " ", params; + else if (dispatcher != "") + print combo, " — ", desc, " — ", dispatcher; + else + print combo, " — ", desc; + } else { + if (dispatcher != "" && params != "") + print combo, " — ", dispatcher, " ", params; + else if (dispatcher != "") + print combo, " — ", dispatcher; + else + print combo; + } + } +') -# use rofi to display the keybinds with the modified content -echo "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" \ No newline at end of file +# use rofi to display the keybinds +printf '%s\n' "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" -- cgit v1.2.3