summaryrefslogtreecommitdiff
path: root/recipes/zaurusd/files/zaurus-hinge.matchbox-portrait
blob: 291617cd023f5cccebb71728dc5ab78f88e073ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

  if [ -x ${ZD_BINDIR}/xrandr ]; then
  	if ! ( xrandr | awk '{print $4}' | grep -q left )
	then
		${ZD_BINDIR}/xrandr -o left 
	fi
  fi
  # just to be extra safe
  sleep 1
      
  echo "panel_user = [$panel_user]"

  if ! test -e "/tmp/gpe-panel.session-$panel_user"
  then
    cp /home/$panel_user/.matchbox/mbdock.session "/tmp/gpe-panel.session-$panel_user"
  else
    rm "/tmp/gpe-panel.session-$panel_user"
  fi
  
  if test -n "$panel_user"
  then
    echo "Running panel as user [$panel_user]"
    ps aux | grep "$panel_user" | grep -q "mbinputmgr " || su $panel_user -c ${ZD_BINDIR}/mbinputmgr &
  else
     # A failsafe can't hurt
     echo "Warning: Running mbinputmgr as root!"
     ps aux | grep -q "mbinputmgr " || ${ZD_BINDIR}/mbinputmgr &
  fi