diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-02-16 11:09:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-16 11:09:08 +0900 |
| commit | 8acfbb16d5ef45960a13cb9768517d3c418771a6 (patch) | |
| tree | 7b618f6cca7942c3d2876740fca3963092b2da21 /config/hypr/scripts/KeyBinds.sh | |
| parent | 349f564bf307ad1ed99c87d028fccdecf7c1bdeb (diff) | |
| parent | 0c53ef536ca2f028672004e909daac5473e6110f (diff) | |
Merge pull request #556 from JaKooLit/development
Development to main feat. Rofi Themes
Diffstat (limited to 'config/hypr/scripts/KeyBinds.sh')
| -rwxr-xr-x | config/hypr/scripts/KeyBinds.sh | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index e2a05ac4..324a9d00 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -1,34 +1,40 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Searchable enabled keybinds using rofi +# searchable enabled keybinds using rofi -# Kill yad to not interfere with this binds +# kill yad to not interfere with this binds pkill yad || true -# Check if rofi is already running +# check if rofi is already running if pidof rofi > /dev/null; then pkill rofi fi -# Define the config files -KEYBINDS_CONF="$HOME/.config/hypr/configs/Keybinds.conf" -USER_KEYBINDS_CONF="$HOME/.config/hypr/UserConfigs/UserKeybinds.conf" -LAPTOP_CONF="$HOME/.config/hypr/UserConfigs/Laptops.conf" +# define the config files +keybinds_conf="$HOME/.config/hypr/configs/Keybinds.conf" +user_keybinds_conf="$HOME/.config/hypr/UserConfigs/UserKeybinds.conf" +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') +# combine the contents of the keybinds files and filter for keybinds +keybinds=$(cat "$keybinds_conf" "$user_keybinds_conf" | grep -E '^bind') -# 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" +# 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 # check for any keybinds to display -if [[ -z "$KEYBINDS" ]]; then - echo "No keybinds found." +if [[ -z "$keybinds" ]]; then + echo "no keybinds found." exit 1 fi -# Use rofi to display the keybinds -echo "$KEYBINDS" | rofi -dmenu -i -p "Keybinds" -config ~/.config/rofi/config-keybinds.rasi
\ No newline at end of file +# replace $mainmod with super in the displayed keybinds for rofi +display_keybinds=$(echo "$keybinds" | sed 's/\$mainMod/SUPER/g') + +# use rofi to display the keybinds with the modified content +echo "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" +s
\ No newline at end of file |
