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)
-   -   Odds and ends (https://talk.maemo.org/showthread.php?t=74915)

auouymous 2011-09-05 04:33

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1081512)
How do I get the PID though?

To kill the one with the highest pid:
Code:

kill `pidof -s xkbd`
If you want to kill a specific instance you need to store the PIDs as you launch them, $! is the last backgrounded process.
Code:

xkbd & PID1=$!
xkbd & PID2=$!
kill $PID1

You can also store the PIDs in named files if the launch script is separate from the kill script.

Addison 2011-09-05 05:05

Re: Odds and ends
 
Thanks!

I will definitely give this a try! :)

Addison 2011-09-05 06:55

Re: Odds and ends
 
I'm not seeing what I'm doing wrong on this.

I launch this just once in the beginning. It's the bottom keyboard that will always remain on the screen.
xkbd -geometry +65520+65992 -k /media/mmc2/N800/Keyboards/Med.xkbd & PID1=$! & filterm ascii-ascii cp437-utf8 tf

When pressing the fullscreen key, it brings up the big keyboard.
xkbd -geometry +65507+65536 -k /media/mmc2/N800/Keyboards/Full.xkbd & PID2=$!

When I press Enter on that big keyboard, it executes this.
kill $PID2
xte 'keydown KP_Enter' 'keyup KP_Enter'


It's not killing the big keyboard though.

From what you told me, this should be correct.

maacruz 2011-09-05 20:33

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1082047)
I'm not seeing what I'm doing wrong on this.

I launch this just once in the beginning. It's the bottom keyboard that will always remain on the screen.
xkbd -geometry +65520+65992 -k /media/mmc2/N800/Keyboards/Med.xkbd & PID1=$! & filterm ascii-ascii cp437-utf8 tf

When pressing the fullscreen key, it brings up the big keyboard.
xkbd -geometry +65507+65536 -k /media/mmc2/N800/Keyboards/Full.xkbd & PID2=$!

When I press Enter on that big keyboard, it executes this.
kill $PID2
xte 'keydown KP_Enter' 'keyup KP_Enter'


It's not killing the big keyboard though.

From what you told me, this should be correct.

Probably because each is a different script. Environment variables are local, so they are lost when the script finishes and the next script can't read $PID1. Use a file to store and read the PID
Something like:
Code:

#launch script
xkbd -geometry +65507+65536 -k /media/mmc2/N800/Keyboards/Full.xkbd &
echo $! >/tmp/xkbd2.pid

#kill script
kill $(cat /tmp/xkbd2.pid)
xte 'keydown KP_Enter' 'keyup KP_Enter'


Addison 2011-09-05 21:07

Re: Odds and ends
 
Thank you Mac!

What I ended up doing was making a copy of /usr/bin/xkbd and having another one called xkbd2.

I like your idea better though. :D

auouymous 2011-09-06 13:10

Re: Odds and ends
 
Quote:

Originally Posted by maacruz (Post 1082480)
Code:

kill S(cat /tmp/xkbd2.pid)

I could be wrong but the S should probably be a $. :)

Addison 2011-09-11 05:25

Re: Odds and ends
 
Hey, there's one other thing I wanted to ask.

I love Xmms.

I also love how you can use the zoom in and out keys to change tracks.

The thing is, this doesn't work with the tablet locked so that the screen is turned off to save on battery life.

Is there any possible trick around this?

Also, I usually don't have Xmms on the screen either since it can be graphically intensive.

Is there perhaps a way to focus the zoom keys directly to Xmms even while it's minimized?

Cheers again! :)

auouymous 2011-09-11 06:43

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1085925)
The thing is, this doesn't work with the tablet locked so that the screen is turned off to save on battery life.

Is there any possible trick around this?

Not easily. Write a script that calls MCE's req_tklock_mode_change method with "locked". Then write a '0' to /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_kp to unlock the keys. Replace with /sys/devices/platform/i2c_omap.2/i2c-0/0-0045/disable_kp on the n810. Then you must detect the display on signal and write a '1' to /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts to relock the screen. You also need to listen for the unlock signal and terminate your script.

Each time you press a key the screen will turn on but your script will relock it. The only problem is that all keys will be active, you could of course write an Xlib app that grabs keys you don't want active and ignore them. :)


Quote:

Originally Posted by Addison (Post 1085925)
Also, I usually don't have Xmms on the screen either since it can be graphically intensive.

Is there perhaps a way to focus the zoom keys directly to Xmms even while it's minimized?

You could write an Xlib app that grabs the keys and redirects them to the XMMS window. Or you could figure out if XMMS exposes the those actions to dbus and just call them.

momcilo 2011-09-11 09:19

Re: Odds and ends
 
any thoughts on replacing old buggy cs compiler with upstream 4.4.x or 4.5.x or 4.6.x

Addison 2011-09-12 00:34

Re: Odds and ends
 
Wow auouymous!

Whut?! *lol*

I wish that you just would have said that it's not possible instead.

That I would have understood. :)

Anyway, I'll look into those MCE and DBUS thingies you suggested and see if I can do something without breaking my tablet. :D


All times are GMT. The time now is 12:57.

vBulletin® Version 3.8.8