projects
/
grml-quickconfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b0c5765
)
Refactored and cleaned up the wm entry
author
Ulrich Dangel
<uli@spamt.net>
Wed, 31 Mar 2010 20:26:54 +0000
(22:26 +0200)
committer
Ulrich Dangel
<uli@spamt.net>
Wed, 31 Mar 2010 20:26:54 +0000
(22:26 +0200)
quickconfig/030-wm.sh
patch
|
blob
|
history
diff --git
a/quickconfig/030-wm.sh
b/quickconfig/030-wm.sh
index
7bfcaf9
..
a2a34a6
100644
(file)
--- a/
quickconfig/030-wm.sh
+++ b/
quickconfig/030-wm.sh
@@
-10,45
+10,47
@@
display_entry() {
# variable definition {{{
typeset -A wms
typeset -A available
# variable definition {{{
typeset -A wms
typeset -A available
-set -
a
output
+set -
A
output
# }}}
# window manager definition {{{
# }}}
# window manager definition {{{
-wms[a]=awesome
-wms[d]=dwm
-wms[e]=evilwm
-wms[f]=fluxbox
-wms[v]=fvwm
-wms[2]=fvwm2
-wms[c]=fvwm-crystal
-wms[j]=jwm
-wms[o]=openbox
-wms[k]=pekwm
-wms[r]=ratpoison
-wms[t]=twm
-wms[9]=w9wm
-wms[w]=windowlab
-wms[i]=wmii
-wms[n]=wm-ng
+wms=(
+ a awesome
+ d dwm
+ e evilwm
+ f fluxbox
+ v fvwm
+ 2 fvwm2
+ c fvwm-crystal
+ j jwm
+ o openbox
+ k pekwm
+ r ratpoison
+ t twm
+ 9 w9wm
+ w windowlab
+ i wmii
+ n wm-ng
+ )
# }}}
# deteremine installed window managers {{{
print_available_wm() {
. /etc/grml/script-functions
# }}}
# deteremine installed window managers {{{
print_available_wm() {
. /etc/grml/script-functions
- line=""
LEN=0
LEN=0
+ local line
for key value in ${(kv)wms} ; do
if check4progs $value >/dev/null ; then
available[$key]=$value
# test if word could be added to current line
for key value in ${(kv)wms} ; do
if check4progs $value >/dev/null ; then
available[$key]=$value
# test if word could be added to current line
- if [ $[${(c)#key} + $LEN] -lt $MAXLEN ] ; then
- LEN+=${(c)#wm}
- line+="$(highlight_char $value $key) "
- else
+ if [ $((${(c)#value} + $LEN)) -ge $(($MAXLEN-9)) ] ; then
LEN=0
output+="$line"
LEN=0
output+="$line"
+ line=""
fi
fi
+ line+="$(highlight_char $value $key) "
+ LEN=$((${(c)#value} + $LEN))
fi
done
output+="$line"
fi
done
output+="$line"
@@
-68,7
+70,7
@@
wm_heading() {
wm_menu() {
echo
wm_heading
wm_menu() {
echo
wm_heading
- for line in $
output
; do
+ for line in $
{output}
; do
print_line $line
done
print_closing_line
print_line $line
done
print_closing_line