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)
-   -   Simple script request (https://talk.maemo.org/showthread.php?t=71717)

Addison 2011-04-01 22:18

Simple script request
 
Hey all.

I'm looking for an easy executable file that will send a CTRL-r signal to the tablet.

How could this be written?

Thank you!

marxian 2011-04-01 23:32

Re: Simple script request
 
I'm not sure if xautomation is available for the N810, but a simple script would be

Code:

#!/bin/sh
# Simple script to send a CTRL-R command

xte 'keydown Control_L' 'key r' 'keyup Control_L'

You would need to install xautomation first, then you just save the above script as (for example) controlplusr.sh and make this file executable by entering

Code:

chmod +x /path/to/file/controlplusr.sh
This needs to be performed as root.

There may be easier ways of achieving what you want. I'm not familiar with the N810, but there may already be a program available that will issue a custom command.

Addison 2011-04-03 19:34

Re: Simple script request
 
Joy!

That worked!

Eep! :D

Addison 2011-04-22 22:35

Re: Simple script request
 
Okay. Last question.

What would the script look like that will automatically type this on the screen?

search
<Return Key>

Thanks again marxian!

maacruz 2011-04-23 10:56

Re: Simple script request
 
Oh, c'mon, don't be so lazy :D
Just extrapolate the script:
xte 'key s'
xte 'key e'
....
:P

Addison 2011-04-23 11:19

Re: Simple script request
 
Wow.

My brain must seriously be leaking to not have seen that! *lol*

maacruz 2011-04-25 21:14

Re: Simple script request
 
Nice thing xautomation
I have uploaded the xautomation package to extras-devel, so there is no need to search binaries around the forum
apt-get install xautomation

Addison 2011-04-25 21:20

Re: Simple script request
 
Thanks Mac!

Yeah, I really like xautomation.

It makes running macro scripts super easy.

I think I'm going to try using this with Tiny Fugue later this week and see how all that goes. :)

Addison 2011-09-03 10:22

Re: Simple script request
 
One more question... How can I do a super long string with this?

I have it as

[1|user@Nokia-N800-43-7|~]xte 'str "test"'
""X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 132 (XTEST)
Minor opcode of failed request: 2 (X_XTestFakeInput)
Value in failed request: 0x0
Serial number of failed request: 17
Current serial number in output stream: 32

I take it that I'm not using the format correctly?

Anyway, I would like xte to rifle off all of this at once:

javascript:isIE=/*@cc_on!@*/false;isIE ? swfHTML=document.getElementById('movie_player').ge tElementsByTagName('param')[1].value:swfHTML=document.getElementById("movie_play er").getAttribute("flashvars");w=swfHTML.split("&" );for(i=0;i<=w.length-1;i++)if(w[i].split("=")[0] == "url_encoded_fmt_stream_map"){links=unescape(w[i].split("=")[1]);break;}abc = links.split(",url=");for(i=0;i<=abc.length-1;i++){fmt=abc[i].split("|")[0];if ((fmt.indexOf("flv") > 0) && (fmt.indexOf("large") <= 0) && (fmt.indexOf("medium") <= 0)){if (fmt.indexOf("rl=") > 0){url = fmt.substring(4,fmt.indexOf("fallback_host")-1);url = unescape(unescape(url));break;}else{url = fmt.substring(0,fmt.indexOf("fallback_host")-1);url = unescape(unescape(url));break;}}}combineurl = url;combineurl = combineurl + '&title=' + ((((document.title.replace('#',' ')).replace('@',' ')).replace('*',' ')).replace('|',' ')).replace(':',' ');window.location.href = combineurl.substring(0, 2000);




Cheers!

maacruz 2011-09-03 10:59

Re: Simple script request
 
Quote:

Originally Posted by Addison (Post 1081048)
One more question... How can I do a super long string with this?

I have it as

[1|user@Nokia-N800-43-7|~]xte 'str "test"'
""X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 132 (XTEST)
Minor opcode of failed request: 2 (X_XTestFakeInput)
Value in failed request: 0x0
Serial number of failed request: 17
Current serial number in output stream: 32

I take it that I'm not using the format correctly?

Anyway, I would like xte to rifle off all of this at once:

javascript:isIE=/*@cc_on!@*/false;isIE ? .....

xte "str 'test'" works for me, it throws the same error but it works, so the error can be ignored.
But.... xte "str test1" shows testq as result, because the "1" key is really the "q" key.
The correct command to get test1 is xte "str test" "keydown ISO_Level·_Shift" "str 1" "keyup ISO_Level3_Shift"
So you know now what task is to get that huge string :eek:


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

vBulletin® Version 3.8.8