aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/KeyBinds.sh
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-15 12:45:34 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-15 12:45:34 +0900
commitb478eef5f63d237eda06256bd4508c545bc6bcbe (patch)
treea0de45cc15f46d07a6b60fca156f71db1e921505 /config/hypr/scripts/KeyBinds.sh
parent1d714a5ea76fd19d530b9d06ce9b73627d8224d9 (diff)
updated keybinds search & rofi theme selector scripts
Diffstat (limited to 'config/hypr/scripts/KeyBinds.sh')
-rwxr-xr-xconfig/hypr/scripts/KeyBinds.sh40
1 files changed, 22 insertions, 18 deletions
diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh
index 639dd3a1..324a9d00 100755
--- a/config/hypr/scripts/KeyBinds.sh
+++ b/config/hypr/scripts/KeyBinds.sh
@@ -1,36 +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."
+# check for 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 -config "$rofi_theme" -mesg "$msg"
+# 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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage