Browse Source

updated SwitchKB layout script in line with Settings space

pull/353/head
JaKooLit 2 years ago
parent
commit
6950a11c37
  1. 4
      config/hypr/scripts/SwitchKeyboardLayout.sh

4
config/hypr/scripts/SwitchKeyboardLayout.sh

@ -8,7 +8,7 @@ notif="$HOME/.config/swaync/images/bell.png"
# Check if ~/.cache/kb_layout exists and create it with a default layout from Settings.conf if not found
if [ ! -f "$layout_f" ]; then
default_layout=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2 | cut -d ',' -f 1 2>/dev/null)
default_layout=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2 | cut -d ',' -f 1 2>/dev/null)
if [ -z "$default_layout" ]; then
default_layout="us" # Default to 'us' layout if Settings.conf or 'kb_layout' is not found
fi
@ -19,7 +19,7 @@ current_layout=$(cat "$layout_f")
# Read keyboard layout settings from Settings.conf
if [ -f "$settings_file" ]; then
kb_layout_line=$(grep 'kb_layout=' "$settings_file" | cut -d '=' -f 2)
kb_layout_line=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2)
IFS=',' read -ra layout_mapping <<< "$kb_layout_line"
fi

Loading…
Cancel
Save