Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (c93d50e85f2f285b4897ea1f2645d2ad4dcbd3e9)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (c93d50e85f2f285b4897ea1f2645d2ad4dcbd3e9)
  • Date: Wed, 6 Feb 2008 15:01:23 -0600

GIT changes to master cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

iso/usr/share/smgl.install/keymap | 135
++++++++++++++++++++++++++++++++++++++
1 files changed, 135 insertions(+)

New commits:
commit c93d50e85f2f285b4897ea1f2645d2ad4dcbd3e9
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

keymap: new script to choose keymap

This script will parse /usr/share/keymaps for all possible keymaps
installed on the system (iso) and present them to the user in a menu
interface. The user can navigate the menus solely with the use of
number keys, so this will help minimize problems where users cannot
select the correct keymap if they don't know how to type in qwerty
(the default).

diff --git a/iso/usr/share/smgl.install/keymap
b/iso/usr/share/smgl.install/keymap
new file mode 100755
index 0000000..2ecbcc9
--- /dev/null
+++ b/iso/usr/share/smgl.install/keymap
@@ -0,0 +1,135 @@
+#!/bin/bash
+
+PREFIX=/usr/share/keymaps
+CHOICES=
+MAX=
+INPUT=
+RESULT=1
+
+function prompt() {
+ echo ""
+ printf "\tPlease enter a number: "
+ read INPUT
+ if [[ -n $INPUT ]]
+ then
+ if [[ $INPUT -lt 0 || $INPUT -gt $MAX ]]
+ then
+ echo "Error: You must enter a number corresponding to one"
+ echo "of the choices in the list above!"
+ return 1
+ fi
+ else
+ return 0
+ fi
+}
+
+function make_list {
+ local list
+
+ #LIST=$(find $PREFIX/$LISTDIR/* -maxdepth 0 -type d -not -name include)
+ list=( $(find $PREFIX/* -maxdepth 0 -type d -not -name include) )
+ MAX=${#list[*]}
+ if [[ $MAX = 0 ]]
+ then
+ #LIST=$(find $PREFIX/$LISTDIR/* -type f -name *.map.gz)
+ list=( $(find $PREFIX/* -type f -name *.map.gz) )
+ MAX=${#list[*]}
+ fi
+ for ((i=0; i < $MAX; i++))
+ do
+ CHOICES[$i]=${list[i]##*/}
+ done
+}
+
+function print_dirs {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ printf "\t\t\t[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | more
+}
+
+function print_files {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ #printf "[%2d] %s" "$i" "${CHOICES[i]%.map.gz}"
+ #printf "%2d %s" "$i" "${CHOICES[i]%.map.gz}"
+ printf "[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | column | more
+}
+
+function print_list {
+ if [[ $MAX -gt 20 ]]
+ then
+ print_files
+ else
+ print_dirs
+ fi
+}
+
+function go_list {
+ local rc=1
+
+ make_list
+ print_list
+ while [[ $rc = 1 ]]
+ do
+ prompt
+ rc="$?"
+ done
+ if [[ $INPUT = 0 ]]
+ then
+ if [[ $PREFIX != "/usr/share/keymaps" ]]
+ then
+ PREFIX=${PREFIX%/[^/]*}
+ fi
+ else
+ (( INPUT -= 1 ))
+ INPUT=${CHOICES[INPUT]}
+ if [[ $INPUT == *.map.gz ]]
+ then
+ PREFIX="$PREFIX/$INPUT"
+ if [[ $(loadkeys $PREFIX) ]]
+ then
+ RESULT=0
+ else
+ RESULT=2
+ fi
+ else
+ PREFIX="$PREFIX/$INPUT"
+ fi
+ fi
+}
+
+echo ""
+cat <<EOF
+Before beginning the isntallation, you should select your keymap. First,
+choose your keyboard's hardware type from the list below. Some hardware
+types will also have a subtype, which will be presented in another menu.
+After you are done choosing your hardware type (and subtype), choose your
+preferred keymapping from the menu you are presented with. You may enter 0
+to go back to a previous menu.
+EOF
+
+while [[ $RESULT = "1" ]]
+do
+ go_list
+ #clear
+done
+
+if [[ $RESULT = "0" ]]
+then
+ exit 0
+else
+ exit 1
+fi
+
+#ls | sed 's/.map.gz$//' | nl -w 2 -s ' ' -nln | column | more
+
+#entries=( dummy $(echo * | sed -n 's/.k\?map\(.gz\)\?$//p') ); for((i=1;
+#i<${#entries[*]}; i++)) ;do printf "%2d %s" "$i" "${entries[i]}"; done |
+#column | more
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai



  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (c93d50e85f2f285b4897ea1f2645d2ad4dcbd3e9), Justin Boffemmyer, 02/06/2008

Archive powered by MHonArc 2.6.24.

Top of Page