Re: New rotate for OpenMoko

2008-10-12 Thread Thomas des Courières
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


accel-rotate
Description: Binary data


rotate.desktop
Description: Binary data
attachment: tapuntap.png___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: New rotate for OpenMoko

2008-09-24 Thread Petr Vanek
On Tue, 23 Sep 2008 10:51:46 +0100
[EMAIL PROTECTED] (VNNGO) wrote:


If you install it via the *.ipk package on the wiki page, you'll get  
an init script to launch the daemon. Then copy the latest binary  
version over the one installed by the package (it is much older).
 From there, all you have to do is to configure the daemon to launch  
at the chosen runlevel (can't remember the specific commands, sorry!).

Citando Robin Paulson
[EMAIL PROTECTED]:
 could someone provide some hints for how to set this to autostart,
 either system-wide or for a specific user?

 for a specific user, would i place a link to it in ~/.xinitrc?

 cheers



I have just created .desktop file and run it if necessary. It wouldn't
be bad to implement a function if it is already running, kill it, so
one could end the application without having to have a second icon (i
might as well just do this through a bash). Anyways, as the window
manager was trying to indicate looong startup of rotate (even with
StartupNotify=false ), i run it now like this and get an excellent
result: Exec=/usr/bin/rotate 


Petr Vaněk
http://biodynamika.cz




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


Re: New rotate for OpenMoko

2008-09-23 Thread Robin Paulson
2008/9/22 Rui Miguel Silva Seabra [EMAIL PROTECTED]:
 As said before, since I'm not entirely happy with the previous version
 of Rotate for OpenMoko, also using it as a way to learn how to write
 programs for it, I'm writing a new version of Rotate for OpenMoko.

 I'm now announcing the first results: release 0.1.0 is out (signature)!
 The tar.gz file contains both source and a binary suited to run on
 Om200x.y (at least 2008.9 should work).

 Be careful, it bytes.. :)

could someone provide some hints for how to set this to autostart,
either system-wide or for a specific user?

for a specific user, would i place a link to it in ~/.xinitrc?

cheers

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


Re: New rotate for OpenMoko

2008-09-23 Thread vasco . nevoa

If you install it via the *.ipk package on the wiki page, you'll get  
an init script to launch the daemon. Then copy the latest binary  
version over the one installed by the package (it is much older).
 From there, all you have to do is to configure the daemon to launch  
at the chosen runlevel (can't remember the specific commands, sorry!).

Citando Robin Paulson [EMAIL PROTECTED]:
 could someone provide some hints for how to set this to autostart,
 either system-wide or for a specific user?

 for a specific user, would i place a link to it in ~/.xinitrc?

 cheers



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


Re: New rotate for OpenMoko

2008-09-22 Thread Thomas Bertani
why not making that pressing aux you could lock/unlock the current rotation
state?

2008/9/21 Rui Miguel Silva Seabra [EMAIL PROTECTED]

 Hi,

 As said before, since I'm not entirely happy with the previous version
 of Rotate for OpenMoko, also using it as a way to learn how to write
 programs for it, I'm writing a new version of Rotate for OpenMoko.

 I'm now announcing the first results: release 0.1.0 is out (signature)!
 The tar.gz file contains both source and a binary suited to run on
 Om200x.y (at least 2008.9 should work).

 Be careful, it bytes.. :)

 $ cat ChangeLog
 2008-09-21 - 0.1.0 - First release.
Current Features:
* makes some rotations

Known Issues:
* reading from the accelerometer hangs after X time/reads
* some heuristic values may need finetunning (specially when
  laying around, turned up)

Near Future:
* don't rotate when screen is locked
* change profile to silent/meeting when phone is turned down
  and revert when it is turned back up


 http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
 http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc

 --
 All Hail Discordia!
 Today is Prickle-Prickle, the 45th day of Bureaucracy in the YOLD 3174
 + No matter how much you do, you never do enough -- unknown
 + Whatever you do will be insignificant,
 | but it is very important that you do it -- Gandhi
 + So let's do it...?

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

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


Re: New rotate for OpenMoko

2008-09-22 Thread Magnus Boman
Silva,

On Mon, 2008-09-22 at 08:02 +0200, Thomas Bertani wrote:
 why not making that pressing aux you could lock/unlock the current
 rotation state?
 
 2008/9/21 Rui Miguel Silva Seabra [EMAIL PROTECTED]
 Hi,
 
 As said before, since I'm not entirely happy with the previous
 version
 of Rotate for OpenMoko, also using it as a way to learn how to
 write
 programs for it, I'm writing a new version of Rotate for
 OpenMoko.
 
 I'm now announcing the first results: release 0.1.0 is out
 (signature)!
 The tar.gz file contains both source and a binary suited to
 run on
 Om200x.y (at least 2008.9 should work).
 
 Be careful, it bytes.. :)
 
 $ cat ChangeLog
 2008-09-21 - 0.1.0 - First release.
Current Features:
* makes some rotations
 
Known Issues:
* reading from the accelerometer hangs after X
 time/reads
* some heuristic values may need finetunning (specially
 when
  laying around, turned up)
 
Near Future:
* don't rotate when screen is locked
* change profile to silent/meeting when phone is turned
 down
  and revert when it is turned back up
 
 
 http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
 http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc

How much CPU does this utility use?
I see that there are no delays in your while loop, hence my question.

Cheers,
Magnus



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


Re: New rotate for OpenMoko

2008-09-22 Thread Rui Miguel Silva Seabra
Yeah, something like that, but how is it done, actually?

BTW, 

http://blog.1407.org/2008/09/22/openmoko-rotate-020/
http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz
http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz.asc

Rui

On Mon, Sep 22, 2008 at 08:02:04AM +0200, Thomas Bertani wrote:
 why not making that pressing aux you could lock/unlock the current rotation
 state?
 
 2008/9/21 Rui Miguel Silva Seabra [EMAIL PROTECTED]
 
  Hi,
 
  As said before, since I'm not entirely happy with the previous version
  of Rotate for OpenMoko, also using it as a way to learn how to write
  programs for it, I'm writing a new version of Rotate for OpenMoko.
 
  I'm now announcing the first results: release 0.1.0 is out (signature)!
  The tar.gz file contains both source and a binary suited to run on
  Om200x.y (at least 2008.9 should work).
 
  Be careful, it bytes.. :)
 
  $ cat ChangeLog
  2008-09-21 - 0.1.0 - First release.
 Current Features:
 * makes some rotations
 
 Known Issues:
 * reading from the accelerometer hangs after X time/reads
 * some heuristic values may need finetunning (specially when
   laying around, turned up)
 
 Near Future:
 * don't rotate when screen is locked
 * change profile to silent/meeting when phone is turned down
   and revert when it is turned back up
 
 
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc

-- 
Pzat!
Today is Setting Orange, the 46th day of Bureaucracy in the YOLD 3174
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?

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


Re: New rotate for OpenMoko

2008-09-22 Thread Rui Miguel Silva Seabra
On Mon, Sep 22, 2008 at 04:26:27PM +0800, Magnus Boman wrote:
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc
 
 How much CPU does this utility use?
 I see that there are no delays in your while loop, hence my question.

Little, but 0.2.1 will have usleep (1sec feels too long and increases
likelyhood of missing packets), as well as an ALRM timer for the
reading from accelerometers hangs after X time problem.

I'm right now testing it, but I gotta work and can't release again until
much later on, today.

Meanwhile, 0.2.0 is out.
  http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz
  http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz.asc

Rui

-- 
Or is it?
Today is Setting Orange, the 46th day of Bureaucracy in the YOLD 3174
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?

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


Re: New rotate for OpenMoko

2008-09-22 Thread Petr Vanek
On Mon, 22 Sep 2008 09:10:28 +0100
Rui Miguel Silva Seabra [EMAIL PROTECTED] (RMSS) wrote:

On Mon, Sep 22, 2008 at 04:26:27PM +0800, Magnus Boman wrote:
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
  http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc
 
 How much CPU does this utility use?
 I see that there are no delays in your while loop, hence my question.

Little, but 0.2.1 will have usleep (1sec feels too long and increases
likelyhood of missing packets), as well as an ALRM timer for the
reading from accelerometers hangs after X time problem.

I'm right now testing it, but I gotta work and can't release again
until much later on, today.

Meanwhile, 0.2.0 is out.
  http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz
  http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz.asc

Rui

-- 
Or is it?
Today is Setting Orange, the 46th day of Bureaucracy in the YOLD 3174
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?


Rui, very nice,

0.2.0 is much better then the initial 0.1.0 release yesterday :) again,
the calibration is out for the upside down state. Except of rare
hickups when is seems to start oscillating kind of, this is already
quite usable :) and not burning so much CPU as the previous incarnation
did.


--
Petr Vaněk
http://biodynamika.cz




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


Re: New rotate for OpenMoko

2008-09-22 Thread Rui Miguel Silva Seabra
On Mon, Sep 22, 2008 at 10:13:30PM +0200, Petr Vanek wrote:
 On Mon, 22 Sep 2008 09:10:28 +0100
 Rui Miguel Silva Seabra [EMAIL PROTECTED] (RMSS) wrote:
 
 On Mon, Sep 22, 2008 at 04:26:27PM +0800, Magnus Boman wrote:
   http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
   http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc
  
  How much CPU does this utility use?
  I see that there are no delays in your while loop, hence my question.
 
 Little, but 0.2.1 will have usleep (1sec feels too long and increases
 likelyhood of missing packets), as well as an ALRM timer for the
 reading from accelerometers hangs after X time problem.
 
 I'm right now testing it, but I gotta work and can't release again
 until much later on, today.
 
 Meanwhile, 0.2.0 is out.
   http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz
   http://files.1407.org/openmoko/rotate/rotate-0.2.0.tar.gz.asc
 
 Rui
 
 -- 
 Or is it?
 Today is Setting Orange, the 46th day of Bureaucracy in the YOLD 3174
 + No matter how much you do, you never do enough -- unknown
 + Whatever you do will be insignificant,
 | but it is very important that you do it -- Gandhi
 + So let's do it...?
 
 
 Rui, very nice,
 
 0.2.0 is much better then the initial 0.1.0 release yesterday :) again,
 the calibration is out for the upside down state. Except of rare
 hickups when is seems to start oscillating kind of, this is already
 quite usable :) and not burning so much CPU as the previous incarnation
 did.

And 0.2.1 adds even more CPU niceness and stability... :)

 http://files.1407.org/openmoko/rotate/rotate-0.2.1.tar.gz
 http://files.1407.org/openmoko/rotate/rotate-0.2.1.tar.gz.asc

If people want to send me patches against these version, they'll have
about two days to send them to me, I'm most likely not going to release
because of birthday dinners on Tuesday and Wednesday, after long days on
ITIL Foundation V3 lessons ... 

Rui

-- 
P'tang!
Today is Setting Orange, the 46th day of Bureaucracy in the YOLD 3174
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?

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


New rotate for OpenMoko

2008-09-21 Thread Rui Miguel Silva Seabra
Hi,

As said before, since I’m not entirely happy with the previous version
of Rotate for OpenMoko, also using it as a way to learn how to write
programs for it, I’m writing a new version of Rotate for OpenMoko.

I’m now announcing the first results: release 0.1.0 is out (signature)!
The tar.gz file contains both source and a binary suited to run on
Om200x.y (at least 2008.9 should work).

Be careful, it bytes.. :)

$ cat ChangeLog
2008-09-21 - 0.1.0 - First release.
Current Features:
* makes some rotations

Known Issues:
* reading from the accelerometer hangs after X time/reads
* some heuristic values may need finetunning (specially when
  laying around, turned up)

Near Future:
* don't rotate when screen is locked
* change profile to silent/meeting when phone is turned down
  and revert when it is turned back up


http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz
http://files.1407.org/openmoko/rotate/rotate-0.1.0.tar.gz.asc

-- 
All Hail Discordia!
Today is Prickle-Prickle, the 45th day of Bureaucracy in the YOLD 3174
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Gandhi
+ So let's do it...?

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