aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/KeyBinds.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/scripts/KeyBinds.sh')
-rwxr-xr-xconfig/hypr/scripts/KeyBinds.sh39
1 files changed, 33 insertions, 6 deletions
diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh
index 69111047..1005e797 100755
--- a/config/hypr/scripts/KeyBinds.sh
+++ b/config/hypr/scripts/KeyBinds.sh
@@ -16,15 +16,42 @@ if pidof rofi > /dev/null; then
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"
+config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
+hypr_dir="$config_home/hypr"
+keybinds_conf="$hypr_dir/configs/Keybinds.conf"
+user_keybinds_conf="$hypr_dir/UserConfigs/UserKeybinds.conf"
+laptop_conf="$hypr_dir/UserConfigs/Laptops.conf"
+lua_keybinds_conf="$hypr_dir/lua/keybinds.lua"
+lua_user_keybinds="$hypr_dir/UserConfigs/user_keybinds.lua"
+lua_system_keybinds="$hypr_dir/configs/system_keybinds.lua"
+lua_legacy_system_keybinds="$hypr_dir/UserConfigs/system_keybinds.lua"
+lua_overrides="$hypr_dir/UserConfigs/user_overrides.lua"
rofi_theme="$HOME/.config/rofi/config-keybinds.rasi"
msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function'
-# collect raw bind lines (strip end-of-line comments) from available files
-files=("$keybinds_conf" "$user_keybinds_conf")
-[[ -f "$laptop_conf" ]] && files+=("$laptop_conf")
+# detect active Hyprland config mode (Lua entrypoint vs legacy .conf includes)
+lua_entry="$hypr_dir/hyprland.lua"
+legacy_lua_entry="$config_home/hyprland.lua"
+if [[ -f "$lua_entry" || -f "$legacy_lua_entry" ]]; then
+ hypr_config_mode="lua"
+else
+ hypr_config_mode="conf"
+fi
+
+# collect raw bind lines from available files
+if [[ "$hypr_config_mode" == "lua" ]]; then
+ files=("$lua_keybinds_conf")
+ if [[ -f "$lua_system_keybinds" ]]; then
+ files+=("$lua_system_keybinds")
+ elif [[ -f "$lua_legacy_system_keybinds" ]]; then
+ files+=("$lua_legacy_system_keybinds")
+ fi
+ [[ -f "$lua_user_keybinds" ]] && files+=("$lua_user_keybinds")
+ [[ -f "$lua_overrides" ]] && files+=("$lua_overrides")
+else
+ files=("$keybinds_conf" "$user_keybinds_conf")
+ [[ -f "$laptop_conf" ]] && files+=("$laptop_conf")
+fi
# Parse binds using the python script for speed
# The last argument must be the user config for override logic to work correctly
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage