Some experimental changes. Mode aware help added. Boosted the original help document so that it contains the keybindings. Fixed super key for rat poison mode, you have to choose super_l or super_r.

This commit is contained in:
Storm Dragon
2025-12-02 00:14:43 -05:00
parent 9999306675
commit 10386114fc
4 changed files with 276 additions and 19 deletions

43
scripts/i38-help-panel.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# This file is part of I38.
# I38 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
# I38 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with I38. If not, see <https://www.gnu.org/licenses/>.
configPath="$(readlink -f "$0")"
configPath="${configPath%/*/*}"
if [[ -f "${configPath}/config" ]]; then
mod="$(grep 'set $mod ' "${configPath}/config" | cut -d ' ' -f3)"
mod="${mod//Mod1/Alt}"
mod="${mod//Mod4/Super}"
mapfile helpText < <(sed -n '/^mode "panel"/,/^}$/p' "${configPath}/config" | \
sed -e '/^mode "panel"/d' \
-e '/^}$/d' \
-e 's/bindsym/Key:/g' \
-e 's/Mod1/Alt/g' \
-e 's/, mode "default"//g' \
-e 's/--no-startup-id //g' \
-e "s/\$mod/$mod/g")
else
exit 1
fi
for i in "${!helpText[@]}" ; do
helpText[$i]="${helpText[$i]//${configPath}\/scripts\//}"
helpText[$i]="${helpText[$i]/.sh/}"
helpText[$i]="${helpText[$i]/.py/}"
done
header="Panel Mode Keybindings\n\nPress Control+Alt+Tab to enter panel mode, then use these shortcuts:\n\n"
helpText=("$header" "${helpText[@]}" "End of panel mode help. Press Control+Home to jump to the beginning.")
echo "${helpText[@]}" | yad --text-info --show-cursor --title "I38 - Panel Mode Help" --button "Close:0" --listen
exit 0