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 01 Aug 2014, 22:53
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Minimize all or single opened application window(s) [SOLVED]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1803
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sun 20 Jan 2013, 13:57    Post subject:  Minimize all or single opened application window(s) [SOLVED]
Subject description: Window manager: JWM
 

Hello,
Is it possible and if yes, how to minimize all opened application windows to the task bar using a command line?
Thank you.

Cordialement.

_________________


Last edited by Argolance on Mon 21 Jan 2013, 10:56; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2226

PostPosted: Sun 20 Jan 2013, 15:07    Post subject:  

wmctrl is the tool -can't remember the options right now.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1047

PostPosted: Sun 20 Jan 2013, 15:20    Post subject:  

Here you go.

Minimize all windows:
Code:
for i in `wmctrl -l | cut -f1 -d ' '`; do wmctrl -i -r $i -b add,hidden; done

Unminimize:
Code:
for i in `wmctrl -l | cut -f1 -d ' '`; do wmctrl -i -r $i -b remove,hidden; done

More:
Code:
wmctrl --help


I've seen some packages in PET'n'Stuff section.
Too bad it's not OOTB in Puppies - it's small yet very powerful...

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Sun 20 Jan 2013, 20:02    Post subject:  

You can also use xdotool-

Code:
for i in $(xdotool search ".*");do xdotool windowminimize $i;done

Available here- http://www.murga-linux.com/puppy/viewtopic.php?t=79573

Cheers,
s
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2226

PostPosted: Mon 21 Jan 2013, 03:42    Post subject:  

sfr, I am quite sure there is a wmctrl option which minimizes all windows at once, without the need for running it multiple times.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1047

PostPosted: Mon 21 Jan 2013, 07:39    Post subject:  

Amigo, yes - I checked it out again and most likely it's:
wmctrl -k on
however it doesn't work in JWM, though eg. Openbox is fine...

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1803
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Mon 21 Jan 2013, 07:49    Post subject:  

Hello,
Thank you for answering.
This is exactly what I was expecting for, though I had to install wmctrl using PPM because it is not present on Puppy Precise 5.4.3.

May I ask a supplementary question, so this will be quite perfect and duly [SOLVED] Cool:
How to minimize a single window? I noticed this command line running wmctrl --help, to close the window "gracefully":
Code:
 wmctrl -c <WIN>.
I presume <WIN> is something like the window ID? I would like to know how to get it?

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1047

PostPosted: Mon 21 Jan 2013, 08:25    Post subject:  

Argolance wrote:
How to minimize a single window? I noticed this command line running wmctrl --help, to close the window "gracefully":
Code:
 wmctrl -c <WIN>.
I presume <WIN> is something like the window ID? I would like to know how to get it?

That one simply closes a window, not minimizes it.

To get names and IDs of opened windows:
Code:
wmctrl -l

Minimize a window by its name:
Code:
wmctrl -r window_name -b add,hidden

Same thing, but by its ID:
Code:
wmctrl -i -r window_ID -b add,hidden


IMHO it's better to use IDs, since if there's more than one window with the same name, only the first match will be considered.

Also, if you're planning more complex actions (eg. to simulate keystrokes, mouse) it's worth to follow Seaside's advice and play with xdotool too, since they (xdotool+wmctrl) complement each other in some extent.

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1803
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Mon 21 Jan 2013, 10:58    Post subject:  

Hello,
Great!
Thank you a lot.

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
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 » Off-Topic Area » Programming
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.0667s ][ Queries: 12 (0.0109s) ][ GZIP on ]