Updates
This commit is contained in:
@@ -21,13 +21,29 @@ config_file=${config_file/source=~/}
|
||||
config_file="/home/$USER$config_file"
|
||||
echo "Reading from: $config_file"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Parse keybindings
|
||||
# -----------------------------------------------------
|
||||
keybinds=$(grep -oP '(?<=bind = ).*' $config_file)
|
||||
keybinds=$(echo "$keybinds" | sed 's/$mainMod/SUPER/g'| sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
|
||||
# -----------------------------------------------------
|
||||
# Show keybindings in rofi
|
||||
# -----------------------------------------------------
|
||||
keybinds=""
|
||||
|
||||
# Detect Start String
|
||||
while read -r line
|
||||
do
|
||||
if [[ "$line" == "bind"* ]]; then
|
||||
|
||||
line="$(echo "$line" | sed 's/$mainMod/SUPER/g')"
|
||||
line="$(echo "$line" | sed 's/bind = //g')"
|
||||
line="$(echo "$line" | sed 's/bindm = //g')"
|
||||
|
||||
IFS='#'
|
||||
read -a strarr <<<"$line"
|
||||
kb_str=${strarr[0]}
|
||||
cm_str=${strarr[1]}
|
||||
|
||||
IFS=','
|
||||
read -a kbarr <<<"$kb_str"
|
||||
|
||||
item="${kbarr[0]} + ${kbarr[1]}"$'\r'"${cm_str:1}"
|
||||
keybinds=$keybinds$item$'\n'
|
||||
fi
|
||||
done < "$config_file"
|
||||
|
||||
sleep 0.2
|
||||
rofi -dmenu -i -replace -p "Keybinds" -config ~/dotfiles/rofi/config-compact.rasi <<< "$keybinds"
|
||||
rofi -dmenu -i -markup -eh 2 -replace -p "Keybinds" -config ~/dotfiles/rofi/config-compact.rasi <<< "$keybinds"
|
||||
Reference in New Issue
Block a user