Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 15 Dec 2017, 04:35
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
xse - program to send X events to a window
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
disciple

Joined: 20 May 2006
Posts: 6770
Location: Auckland, New Zealand

PostPosted: Wed 23 Jul 2008, 02:29    Post subject:  xse - program to send X events to a window
Subject description: Send keystrokes & clicks etc to a window
 

Extract it and put it in /usr/bin or somewhere.
You'll probably need the manual as well, as it doesn't seem to have a --help option.

I was looking for a way of programmatically minimising/restoring a window swallowed by AllTray. When you start a program with alltray you can assign a shortcut key, and I thought I could just send this shortcut key with xse. But that doesn't work as you seem to have to send events to a window, and I don't want to send them anywhere in particular - I just want them picked up by alltray Sad Any suggestions greatly appreciated Smile

EDIT - Barry found xautomation, which is what I wanted.

EDIT - someone found xdotool, which I think is a good alternative to both xse and xautomation and does window manager stuff as well (e.g. sending a window to a specific desktop). It is bundled in the pastecolour http://www.murga-linux.com/puppy/viewtopic.php?t=45477 and pastelist http://www.murga-linux.com/puppy/viewtopic.php?t=45327 packages.
You can get documentation for xdotool here http://www.semicomplete.com/projects/xdotool/xdotool
xse.html.bz2
Description 
bz2

 Download 
Filename  xse.html.bz2 
Filesize  7.93 KB 
Downloaded  468 Time(s) 
xse.bz2
Description 
bz2

 Download 
Filename  xse.bz2 
Filesize  13.08 KB 
Downloaded  446 Time(s) 

_________________
If you have or know of a good gtkdialog application, please post a link here

Classic Puppy quotes

ROOT FOREVER

Last edited by disciple on Thu 28 Jan 2010, 05:34; edited 6 times in total
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8345
Location: Perth, Western Australia

PostPosted: Wed 23 Jul 2008, 23:42    Post subject:  

That's great! I wanted to do the same thing recently.
_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8345
Location: Perth, Western Australia

PostPosted: Wed 23 Jul 2008, 23:54    Post subject:  

Xautomation looks like a good alternative:
http://hoopajoo.net/projects/xautomation.html

_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6770
Location: Auckland, New Zealand

PostPosted: Thu 24 Jul 2008, 06:05    Post subject:  Thanks!  

Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy
Thank you so much Barry.
That lets me do what I've been trying to do for a very long time.

Since I've compiled it, I'll post it in another thread.

Quote:
Xautomation looks like a good alternative

Even though they think it is an alternative, it really does a different (but very similar) thing.
In a way Xautomation is the opposite of xse, as there appears to be no way to send an event to a specific window with it. But that is good for me Smile!

_________________
If you have or know of a good gtkdialog application, please post a link here

Classic Puppy quotes

ROOT FOREVER
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13648
Location: Karlsruhe, Germany

PostPosted: Thu 24 Jul 2008, 06:47    Post subject:  

I am not sure what you want to do exactly.

Here is a utility you can use in shellscripts or from console.
It is an interface to Puppybasics inbuilt Xlib functions.
So you can move and resize windows, or set them fullscreen.

Note:
if you use the --name , the first window with that name is used.
To find out the id of a window in detail, use --mode listwindows.

Mark

usage:
Quote:
# xwindowtool
xwindowtool version 002
usage: xwindowtool (--name name | --id id) --mode mode --values optional values

examples:

xwindowtool --id 0x3200002 --mode info
xwindowtool --name rxvt --mode info

info returns: position X, position Y , Width , Height , iconfied
layer has values 1-3: always at bottom, always normal, always at top

xwindowtool --mode select (choose window with mouse, returns id)
xwindowtool --mode multiselect (choose windows with mouse, returns ids)

xwindowtool --name rxvt --mode getid
xwindowtool --name rxvt --mode iconify
xwindowtool --name rxvt --mode activate
xwindowtool --name rxvt --mode maximize
xwindowtool --name rxvt --mode toggle_fullscreen
xwindowtool --name rxvt --mode move --values 100 100
xwindowtool --name rxvt --mode resize --values 400 300
xwindowtool --name rxvt --mode setlayer --values 1 (-1 0 1)
xwindowtool --name rxvt --mode noborder
xwindowtool --id 0x3200002 --mode useborder (use id here!)
xwindowtool --name rxvt --mode hasborder (returns 0 if no border)
xwindowtool --mode listwindows
xwindowtool --mode listicons
xwindowtool --mode listiconids

The following options are not supported by all windowmanagers:

xwindowtool --mode listiconidsofworkpace --values 2
xwindowtool --mode getmouse (Gtkbasic only, returns X,Y)
xwindowtool --mode screensize (returns Width , Height)
xwindowtool --mode hiddenwindow
(creates invisible window, returns id, use for desktopborder, uses endless loop!)
xwindowtool --name rxvt --mode desktopborder --values 20 30 40 20

xwindowtool.pet
Description 
pet

 Download 
Filename  xwindowtool.pet 
Filesize  2.42 KB 
Downloaded  398 Time(s) 

_________________
my recommended links

Last edited by MU on Fri 25 Jul 2008, 12:06; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13648
Location: Karlsruhe, Germany

PostPosted: Fri 25 Jul 2008, 11:25    Post subject:  

updated to version 002.

Changes:
- corrected the helptext.
- --select and --multiselect now returns "0x" in front of the ID.

- added a bash example "arrange2windows".
It can be run from the utilities-menu.

It lets you select 2 windows with the mouse, then they are resized to cover half of the screen, and arranged side by side.

I already posted such tools in the past, but they were written in PuppyBasic.
This now is an example of a shell-script instead.

Like this it looks like:
arrange2windows
Code:
#!/bin/bash

s=`xwindowtool --mode screensize`
w=`echo $s | sed "s/ .*//"`
h=`echo $s | sed "s/^.* //"`
#echo $w $h
hw=$((${w}/2))

#echo $hw
#exit 0

xmessage -bg green -center -borderless -buttons "" "select 2 windows to arrange them.

Select Window 1 now...
" &

pid=$!

id1=`xwindowtool --mode select`


kill $pid

xmessage -bg green -center -borderless -buttons "" "
Select Window 2 now...
" &

pid=$!

id2=`xwindowtool --mode select`

kill $pid


h2=$((${h}-100))

w1=$((${hw}-3))
x2=$((${hw}+3))

if [ "$id1" != "" ];then
xwindowtool --id $id1 --mode activate
xwindowtool --id $id1 --mode move --values 0 30
xwindowtool --id $id1 --mode resize --values $w1 $h2
xwindowtool --id $id1 --mode move --values 0 30
fi

if [ "$id2" != "" ];then
xwindowtool --id $id2 --mode activate
xwindowtool --id $id2 --mode move --values $x2 30
xwindowtool --id $id2 --mode resize --values $w1 $h2
xwindowtool --id $id2 --mode move --values $x2 30
fi


Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
newbie314

Joined: 19 Aug 2008
Posts: 127

PostPosted: Wed 03 Sep 2008, 02:35    Post subject:  

Using the scripting, how would I click a button such as in the internet wizard?
Thanks
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2946
Location: Southampton, UK

PostPosted: Wed 03 Sep 2008, 04:09    Post subject:  

newbie314 wrote:
Using the scripting, how would I click a button such as in the internet wizard?
Thanks
If you are just trying to automatically setup networking it would be less complicated to write a small script and put it in /etc/rc.d/rc.local. I suggest starting another thread explaining the end goal of what you are trying to do.
_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
newbie314

Joined: 19 Aug 2008
Posts: 127

PostPosted: Fri 05 Sep 2008, 02:06    Post subject:  

Is there info on writing a script and putting it into .rc script in relation to wifi connection?
I tried checking other threads but the scripting didn't work for me.
http://www.murga-linux.com/puppy/viewtopic.php?search_id=659066464&t=32929

What is the rc.local?
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0490s ][ Queries: 13 (0.0056s) ][ GZIP on ]