LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2012, 05:57 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
[bash] script to find all windows of a program and do somthn with them


To position a "chromium" window I use this line:
Code:
wmctrl -r chromium -e '0,130,0,-1,-1'
But if I have more then one chromium window - this will only work for one. How does "position all chromuim windows" script look like?
 
Old 02-09-2012, 06:44 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Do you see all the chromium windows with:
Code:
wmctrl -l
If yes, maybe a loop like this would work
Code:
for id in $(wmctrl -l | awk '/chromium/ {print $1}'); do
  wmctrl -i -r "$id" -e '0,130,0,-1,-1'
done
It uses the windows id (first column of wmctrl -l output) to identify window
 
1 members found this post helpful.
Old 02-09-2012, 07:15 AM   #3
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Cedrik View Post
Do you see all the chromium windows with:
Code:
wmctrl -l
Yes I can see them. And the script works. Thanks!
 
  


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
[SOLVED] Using 'find' in a bash script Master_Ne0 Linux - Software 6 11-18-2010 01:00 PM
[SOLVED] Run a C program from bash script bvkim Programming 5 05-10-2010 12:35 AM
KDE 4 Autostart Program Bash Script to Write Autostart Bash Scripts for You! jdmcdaniel3 SUSE / openSUSE 1 05-03-2010 06:17 AM
how do you import bash script to a c++ program? jaepi Programming 2 05-02-2007 03:28 AM
Asking a C program to call a bash script sceadu Programming 4 07-28-2005 08:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:09 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