touchscreen 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. # a simple script for a one click conversion for touch screen
  3. # friendly settings, JWM only at this stage, others soon
  4. # 01micko 131213
  5. # TODO: pinboard
  6. # get wm
  7. CWM=`cat /etc/windowmanager`
  8. # precaution
  9. ps -A | grep -q $CWM
  10. [ "$?" -eq 0 ] || exit 1
  11. case $CWM in
  12. jwm)CDIR=/usr/local/jwmconfig2 ;;
  13. *) exit 0 ;; #TODO, other wm's
  14. esac
  15. touch /tmp/touchscreen$$
  16. # passed params are 24, 32, 40, 48
  17. [ "$1" ] || exit 0
  18. change_it(){
  19. # change the settings
  20. echo "MENHEIGHT=$1" > $HOME/.jwm/menuheights #enlarges menu
  21. $CDIR/taskbarPlace top #moves taskbar
  22. [ "$1" -eq 24 ] && $CDIR/taskbarHeight 28 \
  23. || $CDIR/taskbarHeight $1 #makes taskbar taller
  24. [ "$?" -ne 0 ] && exit 1
  25. fixmenus
  26. jwm -restart
  27. [ "`find /tmp -name 'touchscreen*'`" ] && rm /tmp/touchscreen*
  28. exit 0
  29. }
  30. revert_it(){
  31. [ -f $HOME/.jwm/menuheights ] && rm $HOME/.jwm/menuheights
  32. $CDIR/taskbarPlace bottom
  33. $CDIR/taskbarHeight 28
  34. fixmenus
  35. jwm -restart
  36. [ "`find /tmp -name 'touchscreen*'`" ] && rm /tmp/touchscreen*
  37. exit 0
  38. }
  39. case $1 in
  40. 24) change_it 24;;
  41. 32) change_it 32;;
  42. 40) change_it 40;;
  43. 48) change_it 48;;
  44. revert)revert_it ;;
  45. *)exit 0 ;;
  46. esac
  47. exit 0