| Prev |   1   2   3     4   | Next | Last
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-08-30 01:24

Re: Odds and ends
 
Quote:

Originally Posted by auouymous (Post 1078349)
Anything is possible, just depends on if generic code exists to do it or not.

ASUI creates a hidden window that grabs screen events so it can intercept the first tap that wakes up the screen when not locked. You could pull the blank window code (window_open_blank) out of ASUI's window.c file and have it send a dbus message to launch Xkbd and then quit. When Xkbd quits have it relaunch the blank window. You'd also need a way to tell the blank window to quit when you close roxterm.

I think that I mostly understand what you're saying here in theory. :)

I had it so when I pressed the Enter key, it would run a script to send a Return signal and then close the keyboard.

The thing is, when it sent the Return signal, the script would restart all over again.

Thus giving me the joy of watching a stupid infinite loop of unhappiness. :D

Addison 2011-08-30 01:43

Re: Odds and ends
 
I've changed my mind and decided to never let this thread die. :)

Okay, so I would like to give this a try and see if it will work on Diablo 4.
http://talk.maemo.org/showthread.php?t=76162

Here's the .deb.
http://repository.maemo.org/extras-d...emo2_armel.deb

It's saying that it needs Liblua5.1-0 5.1.3-1.
http://maemo.org/packages/package_in...5.1-0/5.1.3-1/

This needs other junk and those also depend on others as well.

I'd like to save all of the debs on my memory card and do a manual install.

So what are all the debs needed and in what order should they be installed?

Thanks. :)

Addison 2011-08-30 12:42

Re: Odds and ends
 
By the way, auouymous, if you ever decide to make an invisble, 8 directional, virtual D-Pad on the right middle side of the screen to be used for Picodrive and Drnoksnes, that would make my entire year! :D

That way, the hardware keys on the left would be mapped as game buttons and you would have touch screen movement on the right.

Having this would open up a whole world of emulated games that previously wouldn't work well at all on the older N800.

Kind regards.
-James

auouymous 2011-08-30 13:01

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1078979)
By the way, auouymous, if you ever decide to make an invisble, 8 directional, virtual D-Pad on the right middle side of the screen to be used for Picodrive and Drnoksnes, that would make my entire year!

And it could also launch Xkbd when touched outside of the dpad region! Maybe even have a few programmable buttons around the dpad!

I'll get right on that! ;)

Addison 2011-08-30 13:29

Re: Odds and ends
 
^ I'm now going to write a song about you!

Thanks! :D

jstokes 2011-09-01 16:38

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1073326)
Well, since I didn't get a response on how to get a right click on the screen like I was asking, I'll just have the right D-Pad switch to all right clicks and then the left D-Pad to switch it all back again.

Thanks for at least reading my request though. :)

Have you tried holding down the menu key in ScummVM while tapping an item on the screen?

Addison 2011-09-03 04:47

Re: Odds and ends
 
^ Yeah, I've tried this with all of the hardware keys with no such luck on any of them.

Addison 2011-09-04 03:20

Re: Odds and ends
 
Seriously? Will I ever let this thread die?! :D

Okay. Well so far this is very preliminary.

Anyway, while running TinyFugue, there will be at times two keyboards on the screen.

http://img33.imageshack.us/img33/499...1090323001.png

When I press the Enter key, I would like only the top keyboard to close.

If I have two running apps that are the same (both are Xkbd), how can I kill just this specific one?

All I know how to do is
killall xkbd
but that closes them both.

Kind regards! :)

auouymous 2011-09-04 06:09

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1081450)
If I have two running apps that are the same (both are Xkbd), how can I kill just this specific one?

`kill PID` where PID is the process ID.

Addison 2011-09-04 06:26

Re: Odds and ends
 
Yeah, I kinda knew that one already.

How do I get the PID though?

The only way I know of is to type top in Xterm.

Also the PIDs seems to be completely random so there's no way of me possibly guessing as to what it may be each time.

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

auouymous 2011-09-12 01:08

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1086572)
I wish that you just would have said that it's not possible instead.

This ability is actually planned for ASUI. I just need to figure out the best way to handle it. Probably unmap ASUI and open its blank window to grab all keys. Use a simple command language in asui-settings to map keys to dbus calls, ignore them or pass them through. The screen automatically comes on when a key is pressed so I'll probably have a configure the delay before turning it back off. That way it would only remain on for a few seconds instead of for your entire dim/blank timeout.

Thoughts?

Addison 2011-09-12 05:03

Re: Odds and ends
 
Isn't the dim/blank timeout done in milliseconds?

Why not just set it at 1?

Maybe it won't even be noticeable. :)

auouymous 2011-09-12 05:23

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1086614)
Isn't the dim/blank timeout done in milliseconds?

Why not just set it at 1?

Maybe it won't even be noticeable. :)

What if you want to see the screen briefly while pressing the keys? Duration is not a problem since the user would be able to set it.

jstokes 2011-09-13 08:29

Re: Odds and ends
 
Quote:

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

I wrote a hack, but unfortunately it doesn't work correctly: Sometimes, when locking, this program picks up spurious input events making the program think the zoom keys have been pressed, even when they haven't.

The idea behind this program (was supposed to be) is simple: If the zoom in/out keys are pressed are pressed while the tablet is locked and the display is dimmed/off, it will run /home/user/xmmskey and pass which zoom key was pressed by passing it as argv[1] (in a script, you can check if $1 = "in") and you could run xmmsctrl (available from free's debfarm repository) from this script.

If a resident Maemo 4 programmer (I don't know what I'm doing!) knows where I've messed up, I'll fix it, but it seems like auouymous is working on something anyway.

PHP Code:

/* Code taken from Austin Che's powerlaunch and fanoush's evkey */
/* gcc xmmskey.c  $(pkg-config --cflags --libs glib-2.0 dbus-glib-1) -Wall -O2 -o xmmskey */

#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <linux/input.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <dbus/dbus-glib.h>
#include <mce/dbus-names.h>
#include <mce/mode-names.h>

#define INPUT_DEV "/dev/input/event2"
#define KP_PATH "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable_kp"
#define ZOOMIN_KC 65
#define ZOOMOUT_KC 66
#define SCRIPT_TO_RUN "/home/user/xmmskey"

static GMainLoop *loopy NULL;

static 
gint inputfd = -1;
static 
GIOChannel *inputfdchannel NULL;

static 
DBusGConnection *systembus NULL;
static 
DBusGProxy *mceproxy NULL;

static 
void sighandler (gint signo G_GNUC_UNUSED)
{
    if (!
inputfdchannel)
    {
        
g_io_channel_shutdown (inputfdchannelFALSENULL);
        
g_io_channel_unref (inputfdchannel);
        
inputfdchannel NULL;
    }

    if (
inputfd != -1)
    {
        
close (inputfd);
        
inputfd = -1;
    }
    
    if (
mceproxy)
    {
        
g_object_unref (mceproxy);
        
mceproxy NULL;
    }

    if (
loopy)
    {
        
g_main_loop_quit (loopy);
        
g_main_loop_unref (loopy);
        
loopy NULL;
    }
}

static 
void disable_kplock (void)
{
    
FILE *kp g_fopen (KP_PATH"w");
    if (
kp)
    {
        
fputc (0kp);
        
fclose (kp);
    }
}

static 
inline DBusGProxyget_mce_request_proxy (void)
{
    return 
dbus_g_proxy_new_for_name (systembusMCE_SERVICEMCE_REQUEST_PATHMCE_REQUEST_IF);
}

static 
gboolean is_tablet_locked (void)
{
    
gchar *lockmode NULL;
    
gboolean retval FALSE;
    
DBusGProxy *mcereqproxy get_mce_request_proxy();

    
dbus_g_proxy_call (mcereqproxyMCE_TKLOCK_MODE_GETNULLG_TYPE_INVALIDG_TYPE_STRING, &lockmodeG_TYPE_INVALID);
    
g_object_unref (mcereqproxy);
    if (!
lockmode)
        return 
FALSE;

    
retval g_strrstr (lockmodeMCE_TK_UNLOCKED) == NULL;
    
g_free (lockmode);

    return 
retval;
}

static 
void blank_screen (void)
{
    
DBusGProxy *mcereqproxy get_mce_request_proxy();

    
dbus_g_proxy_call_no_reply (mcereqproxyMCE_DISPLAY_OFF_REQG_TYPE_INVALID);
    
g_object_unref (mcereqproxy);
}

static 
void begin_work (gboolean zoomin)
{
    
gchar cmdline[sizeof (SCRIPT_TO_RUN) + 10];
    
g_snprintf (cmdlinesizeof (cmdline), "%s %s"SCRIPT_TO_RUNzoomin "in" "out");
    
g_spawn_command_line_sync (cmdlineNULLNULLNULLNULL);
    
blank_screen();
}

static 
gboolean input_cb (GIOChannel *sourceGIOCondition conditiongpointer data G_GNUC_UNUSED)
{
    if(
condition & (G_IO_IN G_IO_PRI))
    {
        
struct input_event ev;
        
gsize bytes_read;
        
        if (!
is_tablet_locked())
            return 
FALSE;

        if (
g_io_channel_read_chars (source, (gchar*) &evsizeof (struct input_event), &bytes_readNULL) == G_IO_STATUS_NORMAL)
        {
            if (
bytes_read != sizeof (struct input_event))
                goto 
getmeout;

            if (
ev.type != EV_KEY)
                goto 
getmeout;

            if (
ev.value != 0/* Act only on key release */
                
goto getmeout;

            if (
ev.code == ZOOMIN_KC)
                
begin_work (TRUE);
            else if (
ev.code == ZOOMOUT_KC)
                
begin_work (FALSE);
        }
    }

getmeout:
    return 
TRUE;
}

static 
void display_cb (DBusGProxy *proxy G_GNUC_UNUSED, const gchar *dispstategpointer data G_GNUC_UNUSED)
{
    if (!
g_str_equal (dispstateMCE_DISPLAY_ON_STRING) && is_tablet_locked())
    {
        
disable_kplock();
        
g_io_add_watch (inputfdchannelG_IO_IN G_IO_PRIinput_cbinputfdchannel);
    }
}

static 
void tklock_cb (DBusGProxy *proxy G_GNUC_UNUSED, const gchar *modegpointer data G_GNUC_UNUSED)
{
    if (
g_strrstr (modeMCE_TK_UNLOCKED))
    {
        
dbus_g_proxy_disconnect_signal (mceproxyMCE_DISPLAY_SIGG_CALLBACK (display_cb), NULL);
        
GSource *inputfd_watch g_main_context_find_source_by_user_data (NULLinputfdchannel);
        if (
inputfd_watch)
            
g_source_destroy (inputfd_watch);
    }
    else
    {
        
dbus_g_proxy_connect_signal (mceproxyMCE_DISPLAY_SIGG_CALLBACK (display_cb), NULLNULL);
    }
}

int main (void)
{
    
inputfd open (INPUT_DEVO_RDONLY O_NONBLOCK);
    if (
inputfd == -1)
        return 
EXIT_FAILURE;
    
    
signal (SIGTERMsighandler);
    
signal (SIGINTsighandler);
    
signal (SIGQUITsighandler);

    
g_type_init();    
    
systembus dbus_g_bus_get (DBUS_BUS_SYSTEMNULL);
    if (!
systembus)
    {
        
sighandler(0);
        return 
EXIT_FAILURE;
    }

    
inputfdchannel g_io_channel_unix_new (inputfd);
    if (!
inputfdchannel)
    {
        
sighandler(0);
        return 
EXIT_FAILURE;
    }
    
    
g_io_channel_set_flags (inputfdchannelG_IO_FLAG_NONBLOCKNULL);
    
g_io_channel_set_encoding (inputfdchannelNULLNULL);

    
mceproxy dbus_g_proxy_new_for_name (systembusMCE_SERVICEMCE_SIGNAL_PATHMCE_SIGNAL_IF);
    
dbus_g_proxy_add_signal (mceproxyMCE_DISPLAY_SIGG_TYPE_STRINGG_TYPE_INVALID);
    
dbus_g_proxy_add_signal (mceproxyMCE_TKLOCK_MODE_SIGG_TYPE_STRINGG_TYPE_INVALID);
    
dbus_g_proxy_connect_signal (mceproxyMCE_TKLOCK_MODE_SIGG_CALLBACK (tklock_cb), NULLNULL);
    
    
loopy g_main_loop_new (NULLFALSE);
    
g_main_loop_run (loopy);

    return 
EXIT_SUCCESS;



Addison 2011-09-13 10:41

Re: Odds and ends
 
Quote:

Originally Posted by auouymous (Post 1086620)
What if you want to see the screen briefly while pressing the keys? Duration is not a problem since the user would be able to set it.

Okay. So perhaps just have that customizable on the user's side then? :)

auouymous 2011-09-13 20:38

Re: Odds and ends
 
Quote:

Originally Posted by jstokes (Post 1087336)
If a resident Maemo 4 programmer (I don't know what I'm doing!) knows where I've messed up, I'll fix it, but it seems like auouymous is working on something anyway.

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.

The key handling code looks correct, ASUI uses similar code to read the power button but not glib, maybe a problem with glib. 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.

Addison 2011-09-14 01:55

Re: Odds and ends
 
Ooh! Hey!

I finally got around to using the built in Email with my Gmail POP account after all these years.

I love how I can now receive LED notifications. :)

Is there any hack to have it scan for new messages every minute though?

The lowest setting is only at every 5 minutes.

n9ots 2011-09-14 10:44

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1087869)
Is there any hack to have it scan for new messages every minute though?

The lowest setting is only at every 5 minutes.

not sure but you could try setting the 'update interval' with gconf-editor. (apps > modest)

maacruz 2011-09-14 12:27

Re: Odds and ends
 
Quote:

Originally Posted by Addison (Post 1087869)
Ooh! Hey!

I finally got around to using the built in Email with my Gmail POP account after all these years.

I love how I can now receive LED notifications. :)

Is there any hack to have it scan for new messages every minute though?

The lowest setting is only at every 5 minutes.

Isn't it a bit of abuse to scan every minute?
If it comes by email, sure it can wait 5 minutes, can't it?

Addison 2011-09-14 12:42

Re: Odds and ends
 
I only ask because LED notification for Dial Central is still broke with it's latest build.

This would be a simple alternative instead. :)

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.


| Prev |   1   2   3     4   | Next | Last
All times are GMT. The time now is 21:02.

vBulletin® Version 3.8.8