xse - program to send X events to a window

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

xse - program to send X events to a window

#1 Post by disciple »

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 :( Any suggestions greatly appreciated :)

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
Attachments
xse.html.bz2
(7.93 KiB) Downloaded 571 times
xse.bz2
(13.08 KiB) Downloaded 563 times
Last edited by disciple on Thu 28 Jan 2010, 09:34, edited 6 times in total.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

That's great! I wanted to do the same thing recently.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

Xautomation looks like a good alternative:
http://hoopajoo.net/projects/xautomation.html
[url]https://bkhome.org/news/[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

Thanks!

#4 Post by disciple »

:D :D :D :D :D :D :D :D :D :D
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.
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 :)!
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#5 Post by MU »

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:
# 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
Attachments
xwindowtool.pet
(2.42 KiB) Downloaded 507 times
Last edited by MU on Fri 25 Jul 2008, 16:06, edited 2 times in total.
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

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: Select all

#!/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
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

newbie314
Posts: 127
Joined: Tue 19 Aug 2008, 05:35

#7 Post by newbie314 »

Using the scripting, how would I click a button such as in the internet wizard?
Thanks

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#8 Post by HairyWill »

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: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

newbie314
Posts: 127
Joined: Tue 19 Aug 2008, 05:35

#9 Post by newbie314 »

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/viewto ... 64&t=32929

What is the rc.local?

Post Reply