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 Wed 26 Nov 2014, 05:11
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 Posts_count  
Author Message
Argolance


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

PostPosted: Sun 20 Jan 2013, 13:57    Post_subject:  Minimize all or single opened application window(s) [SOLVED]
Sub_title: 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.

_________________


Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
amigo

Joined: 02 Apr 2007
Posts: 2278

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: 1101

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: 887

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: 2278

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: 1101

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: 1847
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_website 
SFR


Joined: 26 Oct 2011
Posts: 1101

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: 1847
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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0634s ][ Queries: 12 (0.0045s) ][ GZIP on ]