diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2024-09-20 19:02:39 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-20 19:02:39 +0900 |
| commit | 2b715deacefc61247ca15ed8527730c0537407f1 (patch) | |
| tree | 17cb1dbbba207b5b22d647853fd0d8945a487560 /config/hypr/scripts/KeyBinds.sh | |
| parent | 50d110bf76233350c9478bb6b107c67758fcb234 (diff) | |
| parent | e1e8a5d54a47d04488d42e9141d414874cf83838 (diff) | |
Merge pull request #453 from JaKooLit/development
Development to Main
Diffstat (limited to 'config/hypr/scripts/KeyBinds.sh')
| -rwxr-xr-x | config/hypr/scripts/KeyBinds.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh new file mode 100755 index 00000000..ccbb18a8 --- /dev/null +++ b/config/hypr/scripts/KeyBinds.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Searchable enabled keybinds using rofi + +# Kill yad to not interfere with this binds +pkill yad || true + + +# 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/Laptop.conf" + +# Combine the contents of the keybinds files and filter for keybinds +KEYBINDS=$(cat "$KEYBINDS_CONF" "$USER_KEYBINDS_CONF" | grep -E '^(bind|bindl|binde|bindm)') + +# Check if Laptop.conf exists and add its keybinds if present +if [[ -f "$LAPTOP_CONF" ]]; then + LAPTOP_BINDS=$(grep -E '^(bind|bindl|binde|bindm)' "$LAPTOP_CONF") + KEYBINDS+=$'\n'"$LAPTOP_BINDS" +fi + +# Check if we have any keybinds to display +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 |
