summaryrefslogtreecommitdiff
path: root/recipes/zaurusd/files/zaurus-hinge.matchbox-portrait
blob: e540e66906cb49bfc953e354ec6ab702b2f6ddfb (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 $XRANDR_PORTRAIT )
	then
		${ZD_BINDIR}/xrandr -o $XRANDR_PORTRAIT
	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