| Date: Wed, 7 Sep 2011 22:00:18 +0200
Adding the width scaling as a parameter.
Diffstat:
config.def.h | 2 ++
thingmenu-menu.sh | 50 +++++++++++++++++++++++++++++++
thingmenu.c | 8 +++++---
3 files changed, 57 insertions(+), 3 deletions(-)
--- |
| @@ -0,0 +1,50 @@
+#!/bin/sh
+
+POSARGS="-ww 400 -wh 400"
+
+case "$1" in
+ "svkbd")
+ thingmenu $POSARGS -- \
+ "svkbd de" "svkbd-de -wy -16" \
+ "svkbd en" "svkbd-en -wy -16" \
+ "svkbd arrows" "svkbd-arrows -wy -16" \
+ "back" "thinkpad-menu.sh"
+ ;;
+ "conn")
+ thingmenu $POSARGS -- \
+ "WWAN start" "sudo conn -s wwan" \
+ "WWAN stop" "sudo conn -k wwan" \
+ "WiFi start" "sudo conn -s wifi" \
+ "WiFi stop" "sudo conn -k wifi" \
+ "Ethernet start" "sudo conn -s eth" \
+ "Ethernet stop" "sudo conn -k eth" \
+ "back" "thinkpad-menu.sh"
+ ;;
+ "fn")
+ thingmenu $POSARGS -- \
+ "backlight +10%" "xbacklight -inc 10%" \
+ "backlight -10%" "xbacklight -dec 10%" \
+ "battery" "sleep 1; xset dpms force off" \
+ "suspend" "pm-suspend" \
+ "hibernate" "pm-hibernate" \
+ "rotate" "thinkpad-rotate.sh" \
+ "monitor switch" "thinkpad-fn-f7.sh" \
+ "back" "thinkpad-menu.sh"
+ ;;
+ "sound")
+ thingmenu $POSARGS -- \
+ "volume +10%" "amixer set Master 10%+" \
+ "volume -10%" "amixer set Master 10%-" \
+ "toggle mute" "amixer set Master toggle" \
+ "back" "thinkpad-menu.sh"
+ ;;
+ *)
+ thingmenu $POSARGS -- \
+ "svkbd menu" "thinkpad-menu.sh svkbd" \
+ "conn menu" "thinkpad-menu.sh conn" \
+ "fn menu" "thinkpad-menu.sh fn" \
+ "sound menu" "thinkpad-menu.sh sound" \
+ "xkill" "xkill"
+ ;;
+esac
+ |
| @@ -289,8 +289,10 @@ initfont(const char *fontstr)
XFreeFontSet(dpy, dc.font.set);
dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
if(missing) {
- while(n--)
- fprintf(stderr, "svkbd: missing fontset: %s\n", missing[n]);
+ while(n--) {
+ fprintf(stderr, "thingmenu: missing fontset: %s\n",
+ missing[n]);
+ }
XFreeStringList(missing);
}
if(dc.font.set) {
@@ -394,7 +396,7 @@ setup(void)
if (ls > www)
www = ls;
}
- www *= 1.5;
+ www *= widthscaling;
if (ww == 0) {
if (horizontal) { |