#!/bin/sh

POSARGS="-g 400x400"

case "$1" in
	"svkbd")
		thingmenu $POSARGS -- \
			"svkbd de" "svkbd-de -d -g 0x0+0-16" \
			"svkbd en" "svkbd-en -d -g 0x0+0-16" \
			"svkbd arrows" "svkbd-arrows -d -g 0x0+0-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"
		;;
	"screen")
		thingmenu $POSARGS -- \
			"backlight" "thinkpad-menu.sh backlight" \
			"turn screen off" "screenoff" \
			"rotate" "thinkpad-rotate.sh" \
			"monitor switch" "screen-output" \
			"big monitor switch" "thinkpad-fn-f7-bigscreen.sh" \
			"back" "thinkpad-menu.sh"
		;;
	"backlight")
		thingmenu $POSARGS -- \
			"backlight +10%" "backlight up" \
			"backlight -10%" "backlight down" \
			"backlight 100%" "backlight 100%" \
			"backlight 80%" "backlight 80%" \
			"backlight 60%" "backlight 60%" \
			"backlight 40%" "backlight 40%" \
			"backlight 20%" "backlight 20%" \
			"backlight 0%" "backlight 0%" \
			"back" "thinkpad-menu.sh screen"
		;;
	"sound")
		thingmenu $POSARGS -- \
			"volume +10%" "volume up" \
			"volume -10%" "volume down" \
			"toggle mute" "volume toggle" \
			"back" "thinkpad-menu.sh"
		;;
	"system")
		thingmenu $POSARGS -- \
			"suspend" "sudo pm-suspend" \
			"hibernate" "sudo pm-hibernate" \
			"reboot" "sudo reboot" \
			"poweroff" "sudo poweroff" \
			"back" "thinkpad-menu.sh"
		;;
	*)
		thingmenu $POSARGS -- \
			"svkbd menu" "thinkpad-menu.sh svkbd" \
			"conn menu" "thinkpad-menu.sh conn" \
			"sound menu" "thinkpad-menu.sh sound" \
			"screen menu" "thinkpad-menu.sh screen" \
			"system menu" "thinkpad-menu.sh system" \
			"xkill" "xkill"
		;;
esac

