maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   /usr/bin/ script request (https://talk.maemo.org/showthread.php?t=56318)

Addison 2010-06-16 05:48

/usr/bin/ script request
 
Heya gentlemen!

Okay, so I'm trying to have a custom script that will launch Garnet VM from a personal launcher icon on my desktop.

So far, this is what I have.

/usr/bin/gvm/gvm -a lnch -z 1 -O none -L 0x0000,0x0000,0x0000 -f no & xkbd -geometry +65536+66016 -k /media/mmc2/Keyboards/Garnet.xkbd & xkbd -geometry +65536+65536 -k /media/mmc2/Keyboards/Rightleft.xkbd & xkbd -geometry +400+65536 -k /media/mmc2/Keyboards/Updown.xkbd


So two things.

I would like the screen to be rotated first before executing this. Is there such a command?

Second, I need to killall kill xkbd once Garnet closes and then rotate the screen back to normal.

Any chance I could get some help from one of you boys?

Thanks!

qwerty12 2010-06-16 05:55

Re: /usr/bin/ script request
 
Install xrandr: mikie.dy.fi/maemo/dists/diablo/user/binary-armel/xrandr_1.2.2-0_armel.deb

With xrandr, commands to rotate like "xrandr -o right" should work, AFAIK.

killall xkbd?

Addison 2010-06-16 06:21

Re: /usr/bin/ script request
 
Quote:

Originally Posted by qwerty12 (Post 717074)
Install xrandr: mikie.dy.fi/maemo/dists/diablo/user/binary-armel/xrandr_1.2.2-0_armel.deb

With xrandr, commands to rotate like "xrandr -o right" should work, AFAIK.

killall xkbd?

I'm currently using the community SSU which features screen rotation by default without the need for Xrandr. So should I go ahead and install this on top of it?

And yeah, killall kill xkbd works in Xterminal but not in my /usr/bin script.

I'm pretty sure it's because, when executing xkbd, it hangs in the script code so that any later commands never gets reached.

Is there any other possible way around this?

qwerty12 2010-06-16 06:26

Re: /usr/bin/ script request
 
Quote:

Originally Posted by Addison (Post 717096)
I'm currently using the community SSU which features screen rotation by default without the need for Xrandr. So should I go ahead and install this on top of it?

And yeah, killall kill xkbd works in Xterminal but not in my /usr/bin script.

I'm pretty sure it's because, when executing xkbd, it hangs in the script code so that any later commands never gets reached.

Is there any other possible way around this?

The xrandr deb I pointed you to will rotate the screen like Advanced Backl... crap, it won't rotate the keys; xmodmap is required for that. ukki wrote a quick program from the AB source for Knots. I'll try and find it later.

Run xkbd with an '&' (w/out quotes) on the end but run GVM like normal. After the line that runs GVM, add "kill $!" which should stop the last program we backgrounded - i.e. XKBD.

Something (fake) like this:

#!/bin/sh
/usr/share/knots2/rotate 1
xkbd &
xkbd &
gvm
killall xkbd
/usr/share/knots/rotate 0

EDIT:
Found it. Judging by your presence in the Knots thread, I presume you have it installed. :)

Run "/usr/share/knots2/rotate 1" etc. for different orientations.

Wait... you're starting multiple XKBDs...

Addison 2010-06-16 06:36

Re: /usr/bin/ script request
 
Quote:

Originally Posted by qwerty12 (Post 717102)
The xrandr deb I pointed you to will rotate the screen like Advanced Backl... crap, it won't rotate the keys; xmodmap is required for that. ukki wrote a quick program from the AB source for Knots. I'll try and find it later.

Run xkbd with an '&' (w/out quotes) on the end but run GVM like normal. After the line that runs GVM, add "kill $!" which should stop the last program we backgrounded - i.e. XKBD.

Excellent!

I was planning on stopping by to see ukki on Thursday night so I'll talk with him then about the rest of this.

Many thanks qwerty!

Nice to see that you still have a huge brain. :D


All times are GMT. The time now is 16:33.

vBulletin® Version 3.8.8