LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2021, 11:24 PM   #1
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Rep: Reputation: Disabled
xdotool WINDOW STACK


I have debian 11.0.0 (bullseye). I am learning xdotool. To start, as discussed in https://www.linuxquestions.org/quest...on-4175702468/ do some of these codes if needed:
Code:
Edit the file /etc/gdm3/daemon.conf and uncomment the line #WaylandEnable=false. restart.
Code:
sudo chmod a+rwx /etc/gdm3/daemon.conf;
rpl "#WaylandEnable=false" "WaylandEnable=false" /etc/gdm3/daemon.conf;
sudo chmod 544 /etc/gdm3/daemon.conf
systemctrl restart gdm3.service
Code:
sudo sed -i.back '/#WaylandEnable/s/^#//g' /etc/gdm3/daemon.conf
sudo systemctl restart gdm3.service
Code:
sudo apt install -y xdotool
dpkg --listfiles xdotool
dpkg --status xdotool
man /usr/bin/xdotool
xdotool manual talks about a WINDOW STACK. The best definition for WINDOW STACK that I could figure is several open windows on the same monitor at the same time. Is this correct?

I have several graphic files in my Home folder. When I double-click one, an application named Image Viewer opens and loads the image. As I repeat this proces, new windows are opened and the previous ones are not closed. So I am creating a WINDOW STACK? I can not find details about Image Viewer, even from synaptic. Please tell me about Image Viewer.

I can use echo to create many text files, then run gedit text editor to have open only one file at a time. How to create a stack of text documents?

when the gedit application (window) is open and the text file Hello1.txt is loaded into it,
Code:
xdotool search --name Hello1.txt
retutns a number. And that is plenty for one thread. Later, I will study SYNOPSIS, pid, class, class name.
 
Old 11-02-2021, 01:26 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
https://www.linux.org/threads/xdotoo...w-stack.10687/
 
Old 11-02-2021, 05:17 AM   #3
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
I saw that link before I posted this thread. It does not answer any of my questions. Or if it does, I do not understand.
 
Old 11-02-2021, 06:03 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
I guess you can find the correct definition of windows stack there.
This is from the wiki:
Quote:
In computing, a window is a graphical control element. It consists of a visual area containing some of the graphical user interface of the program it belongs to and is framed by a window decoration. It usually has a rectangular shape[1] that can overlap with the area of other windows. It displays the output of and may allow input to one or more processes.
Window stack just means several windows are put onto your display.
You can never create that windows stack, you can only create windows (and they will be put into that stack).
 
Old 11-02-2021, 11:58 AM   #5
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
To: pan64, LQ Guru
Thank you for trying to help. Your wording
Quote:
I guess
does not sound like you are sure of your answer. You also say
Quote:
You can never create that windows stack
but that statement is countradicted twice in this thread. Do you understand my questions? May I please have some better answers?
 
Old 11-02-2021, 01:50 PM   #6
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Try reading the meaning and not literal.
When @pan64 says you cannot create the windows stack he means that literally. The following statement that says you create the windows and they are placed on the stack means that the system manages the stack and adds or removes windows from it as you create them or close them. xdotool is a tool to make use of the data on that stack, and allow manipulating the windows identified by that data, but does not create nor delete its content.

I suggest you read that link in detail and attempt to understand what it says. It is giving you a lot of very good advice in how to use xdotool and almost seems to be a tutorial.

To quote
Code:
Now, let's look at an example. If I have three LibreOffice Writer applications open and I find that the Class name for the Writer is 'libreoffice', then I can perform a search for them by:

xdotool search --class libreoffice

The result is three Window IDs as follows:

14680152
14731975
14733803

Within the same command-line, these IDs will remain in the Window Stack. Once my command ends, the stack is deleted. Chaining is covered in the article Xdotool – Mouse.
That is directly from the linux.org forum and you should be able to get more detailed info there since the author is writing about xdotool and its use in python.

A very quick search gives lots of links available with info about xdotool and its use. I found 227,000 with a search for "what is xdotool"

@pan64 is likely not thoroughly versed in using xdotool so the "I guess" would represent his evaluation of the data available with a quick look.

Last edited by computersavvy; 11-02-2021 at 01:57 PM.
 
Old 11-04-2021, 11:45 PM   #7
b1bb2
Member
 
Registered: Oct 2021
Posts: 90

Original Poster
Rep: Reputation: Disabled
This works.
Code:
echo "bash xdotool1.sh";
echo "# this window must be open.";
ls Hello1.txt
echo "# find number.";
/usr/bin/xdotool search --name "Hello1.txt"
echo "# make focus.";
/usr/bin/xdotool windowfocus --sync 41943288
echo "# at cursor location, type text.";
/usr/bin/xdotool type "Hello world!"
echo "end xdotool1.sh";
This does not work when it is put into my xdotool1.sh. How to create and open text document from bash?
Code:
echo Hello1.txt > Hello1.txt;
gedit Hello1.txt
The above code might work if I used 2 terminals. How to open a second terminal?

This does not work. how to make focus from file name?
Code:
/usr/bin/xdotool windowfocus --sync "Hello1.txt"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xdotool - intercept keystroke for only one window class. Vryali Linux - Newbie 0 07-27-2012 12:07 PM
xdotool, XSendEvent or something like them jovie Linux - Software 1 01-09-2012 10:06 AM
LXer: Trigger keyboard and mouse actions with your voice and xdotool LXer Syndicated Linux News 0 09-06-2011 02:10 AM
single 8K process stack vs 4K process stack and a seperate 4K interrupt stack charvak Linux - Kernel 1 03-17-2010 06:58 PM
how to send with xdotool a window to another Desktop X number? frenchn00b Linux - General 1 10-23-2009 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration