Hi Ruis,
just wanted you to know i created a desktop icon in order to
activate/desactivate auto rotate.

It works with 2008.9/FDOM, but should work with other distributions.
I extended the /etc/init.d/accel-rotate to add it a "switch" function, and
used the tap/untap icon for the desktop entry.

Here you got it all.
Greetings

************ /etc/init.d/accel-rotate

#! /bin/sh
#
# accel-rotate
#
# description: this script starts accel-rotate daemon
# processname: accel-rotate

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
NAME=accel-rotate
CMD=`which accel-rotate`

[ -f /etc/default/rcS ] && . /etc/default/rcS

case "$1" in
    start)
        echo -n "Starting accel-rotate daemon: "
        start-stop-daemon --start --pidfile /var/run/${NAME}.pid
--make-pidfile --background -x ${CMD}
        if [ $? = 0 ]; then
            echo "(ok)"
        else
            echo "(failed)"
        fi
        ;;
    stop)
        echo -n "Stopping accel-rotate daemon: "
        start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo
        rm -f /var/run/${NAME}.pid
        echo "(done)"
        ;;
    switch)
        echo "Switching state of accel-rotate daemon: "
        if [ -e "/var/run/${NAME}.pid" ]; then
            /etc/init.d/accel-rotate stop
        else
            /etc/init.d/accel-rotate start
        fi
        ;;
    restart|force-reload)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|switch|force-reload}"
        exit 1
        ;;
esac

exit 0

************ /usr/share/applications/rotate.desktop
[Desktop Entry]
Encoding=UTF-8
Name=.Rotate 0/1
Comment=Autorotate the screen
Exec=/etc/init.d/accel-rotate switch
Icon=tapuntap
Terminal=false
Type=Application
Categories=Office;
MimeType=text/x-vcard;
SingleInstance=true
StartupNotify=false

Attachment: accel-rotate
Description: Binary data

Attachment: rotate.desktop
Description: Binary data

<<attachment: tapuntap.png>>

_______________________________________________
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to