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)

Addison 2011-09-14 13:16

Re: Odds and ends
 
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?

jstokes 2011-09-14 16:33

Re: Odds and ends
 
2 Attachment(s)
Thanks for replying. :)

Quote:

Originally Posted by auouymous (Post 1087756)
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.

Quote:

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...

Quote:

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!

Addison 2011-09-14 19:51

Re: Odds and ends
 
Is this correct so far?

http://img691.imageshack.us/img691/6...1091415393.png

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.

Quote:

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

http://img813.imageshack.us/img813/6...1091415463.png

jstokes 2011-09-14 19:59

Re: Odds and ends
 
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

Addison 2011-09-14 20:15

Re: Odds and ends
 
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. :)

jstokes 2011-09-14 20:47

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1088480)
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

auouymous 2011-09-14 21:01

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1088480)
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?

Addison 2011-09-14 21:47

Re: Odds and ends
 
@auouymous

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

Xmms is by far my favorite player.
http://img32.imageshack.us/img32/953...1062509464.png

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.

Addison 2011-09-14 22:26

Re: Odds and ends
 
Okay. I think this is all set up right from what I can tell.

http://img35.imageshack.us/img35/104...1091418143.png

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. :)

auouymous 2011-09-14 22:57

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1088557)
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. :)


Quote:

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.


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

vBulletin® Version 3.8.8