Reply
Thread Tools
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#71
In Configuration Editor that I installed, I changed:
apps-->modest-->update_interval from 5 to 1 (thinking this meant in minutes)

The value is changed and saved but it doesn't seem to take since it still updates every 5 minutes.

Perhaps there's a command line for this instead?
 
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#72
Thanks for replying.

Originally Posted by auouymous View Post
Your KP_PATH only works on n800. Need to detect device type and change KP_PATH if you want it to also work on n810.
Yeah, I was being selfish and was assuming that only Addison and I - both N800 owners - would only want such a thing.

Anyway, I've sorted that out. Thanks for providing paths for both the N800 and N810.

The key handling code looks correct, ASUI uses similar code to read the power button but not glib, maybe a problem with glib.
Hope not! I'm using the GLib mainloop because I'm using DBus-GLib so GIOChannels are the easiest way to watch for events on a file descriptor in this case. FWIW MCE appears to use GIOChannels, so I guess I'm doing something off...

Have you tried
Code:
printf("event: time=%f, type=%u, code=%u, value=%d\n", (float)ev.time.tv_sec + (float)ev.time.tv_usec / 1000000.0, ev.type, ev.code, ev.value);
after the ev.value condition? You can then see the time each event occured and its parameters.
Thanks. Calling g_io_channel_set_encoding() before g_io_channel_set_flags() seemed to have fixed it. Looking at the API reference for the g_io_channel_set_encoding() function, it's like a function's drama queen equivalent.

@Addison

If this appeals to you, you can try the binary attached. You will need to gunzip it, and then run it as root.

What it does is, when the tablet is locked and the screen is dimming/off, pressing the zoom in/zoom out key will run a script located at /home/user/xmmskey and then immediately blank the screen. The xmmskey script will be run as the root user, so bear that in mind.

In the xmmskey script, you can have something like the following:
Code:
#!/bin/sh

if [ "$1" = "in" ]; then #run the commands in this branch when the zoom in key is pressed
 ...
elif [ "$1" = "out"; then #run the commands in this branch when the zoom out key is pressed
 ...
fi
Now, I don't use XMMS so I haven't gone any further than making sure that the xmmskey script runs when the program tells it to. I'd start by installing http://p.quinput.eu/debfarm/pool/xmm....9-3_armel.deb and playing with xmmsctrl to find out the next/previous track commands and add them to the script accordingly. Unfortunately I'm not well versed in Debian packaging so I cannot make a deb file and this program will not start on startup; you will have to run it each time, sorry. Have fun!
Attached Files
File Type: gz xmmskey.binary.gz (3.3 KB, 75 views)
File Type: gz xmmskey.source.c.gz (1.9 KB, 76 views)

Last edited by jstokes; 2011-09-14 at 16:36.
 

The Following User Says Thank You to jstokes For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#73
Is this correct so far?



In Xterm I typed:
cd /media/mmc1/
gzip -d file.gz

I then moved it to home/user with what I think are the correct permissions.

In the xmmskey script, you can have something like the following:
I don't get this part though on what to do next.

 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#74
Yeah, sorry, I'm not a programmer and it shows with the way I thought this program out

The xmmskey program can't be in /home/user because that's where the program will look for the xmmskey script file - move the binary to another place and create the xmmskey script in /home/user - the program will call the script

If you get it working and think it works OK, let me know and I'll try my hardest tomorrow to package it up into a deb so that you don't need to keep a X Terminal open all the time with an instance of this program to use it
 

The Following User Says Thank You to jstokes For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#75
So I have to write my own script with this?

Well, I'm completely pooched then.

I was hoping that the F8 and F7 key could still be sent to Xmms while the screen was locked.

I wouldn't have the first idea on how to write such a script.

So I rename /home/user/xmmskey to something like /usr/bin/screenlock?

Couldn't I just launch
screenlock & xmms so there wouldn't be a nagging Xterm on the screen?

Many thanks on doing this for us by the way.
 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#76
Originally Posted by Addison View Post
So I have to write my own script with this?

Well, I'm completely pooched then.

I was hoping that the F8 and F7 key could still be sent to Xmms while the screen was locked.

I wouldn't have the first idea on how to write such a script.

So I rename /home/user/xmmskey to something like /usr/bin/screenlock?

Couldn't I just launch
screenlock & xmms so there wouldn't be a nagging Xterm on the screen?

Many thanks on doing this for us by the way.
The script part is easy, I promise.

Install xmmsctrl from the link I gave before. Create a new file: /home/user/xmmskey. Paste in the template I put up before, the /bin/sh thing wrapped in CODE tags. Now I put in two pairs of elipses (sorry for spelling, typing on a phone), replace the first pair with "xmmsctrl next" (w/o quotes) and replace the second with "xmmsctrl previous". This will run those commands when pressing zoom in and zoom out, respectively.

Regarding renaming the program: Sure, if you wish.

Yes, you could do that (do you launch XMMS through a script already?), just make sure to run "killall xmmskey" (or screenlock, if you renamed it)

No problem. I'll be able to better help when I'm behind a computer
 

The Following User Says Thank You to jstokes For This Useful Post:
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#77
Originally Posted by Addison View Post
So I have to write my own script with this?
You need to download xmmsctrl and the script you write is a very simple shell script that calls xmmsctrl. Think of it like dbus-send, the script receives a single paramter in $1 which is either "in" or "out".

Code:
case $1 in
  in) xmmsctrl blahblah ;;
  out) xmmsctrl blahblah ;;
esac
You just need to read the xmmsctrl man page and figure out the parameters to pass for each key.

And yes, you should be able to put screenlock in the background by appending &. Or better yet, add it to the local start file which might be /etc/rc.local, not sure though. Try creating that file, put "/usr/bin/screenlock &" in it, reboot and see if the program is running.

BTW, where can I find xmms to install it?
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#78
@auouymous

http://talk.maemo.org/showpost.php?p...2&postcount=83

Xmms is by far my favorite player.


Also, don't forget, if you want a very unique skin for this, most of the Winamp skins, which are .wsz files, will work as well.

You can also open the .wsz file with something like unrar or winzip and edit the graphics or even replace them as well.
 

The Following 2 Users Say Thank You to Addison For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#79
Okay. I think this is all set up right from what I can tell.



Inside /home/user/xmmskey I have...

Code:
#!/bin/sh

if [ "$1" = "in" ]; then 'xmmsctrl next'
 ...
elif [ "$1" = "out"; then 'xmmsctrl previous'
 ...
fi
In Xterm:
xmmslock

No errors from this.

I then launch Xmms and can switch tracks with the zoom keys.

When I lock the tablet though the zoom keys don't register.

Still no error in Xterm.

What am I missing on this?

EDIT:
xmms next
does work by command line.

Cheers.

Last edited by Addison; 2011-09-14 at 22:35.
 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#80
Originally Posted by Addison View Post
Xmms is by far my favorite player.
I used xmms on my desktop for about 10 years before I switched to mpd. I do like that xmms starts up faster and uses less memory than canola but is there way to get MP3s decoded with the DSP? 75% of my music is OGG but it would be nice to save a little battery on the few MP3s.


When I lock the tablet though the zoom keys don't register.
Bad news, xmmsctrl has to be run as user to control xmms, I just tried it. The screenlock program is running as root and launches the script that calls xmmsctrl as root and therefore won't control xmms.
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Reply

Tags
nokia n800, volume


 
Forum Jump


All times are GMT. The time now is 08:20.