LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-20-2017, 02:16 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Rep: Reputation: 255Reputation: 255Reputation: 255
Minimize the current window with WMCTRL ?


Hello,

xdotool can do everything but it is not installed everywhere at schools.
wmctrl is a standard that is available everywhere.

How can one minimize the current Window with wmctrl ?

To maximize, easy:
Code:
"  wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz   "

But minimize?

Thank you in advance
 
Old 02-21-2017, 03:49 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by man wmctrl
ACTIONS

-b ( add | remove | toggle),prop1 [,prop2 ]
Add, remove, or toggle up to two window properties simultaneously. The window that
is being modified must be identified with a -r action. The property change is
achived by using the EWMH _NET_WM_STATE request. The supported property names (for
prop1 and prop2) are modal, sticky, maximized_vert, maximized_horz, shaded,
skip_taskbar, skip_pager, hidden, fullscreen, above and below. Two properties are
supported to allow operations like maximizing a window to full screen mode. Note
that this action is made up of exactly two shell command line arguments.
???
 
Old 02-24-2017, 01:06 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by ondoho View Post
???
I meant to minimize ....

it is not easy, believe me, since wmctrl to get the current win for minimize is not made.. by default.
 
Old 02-24-2017, 10:51 AM   #4
rholt
LQ Newbie
 
Registered: Dec 2003
Location: Venezuela
Distribution: MX Linux
Posts: 13

Rep: Reputation: 11
I tried using hidden but it didn't work nor complain.
 
Old 02-24-2017, 03:40 PM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by rholt View Post
I tried using hidden but it didn't work nor complain.
I think that it is possibel with this first idea ...


Code:
WMCX=$( wmctrl -l )
CURRENTAPP=` xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2 | awk ' { gsub("0x" , "0x0" ); print $0  } '`
CURRENTDESKTOP=` echo "$WMCX" | grep  "$CURRENTAPP" | awk ' {  print $2 } ' `
 
Old 02-24-2017, 04:41 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Keep in mind that wayland is approaching - for some is already the default. wmctrl is yet another that doesn't work.
 
Old 02-25-2017, 01:53 AM   #7
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,658

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by syg00 View Post
Keep in mind that wayland is approaching - for some is already the default. wmctrl is yet another that doesn't work.

it is really bad that nothing never works in LINUX.
 
Old 02-25-2017, 12:11 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
it seems indeed that wmctrl cannot do it.
here'a an interesting article:
https://askubuntu.com/questions/4876...e-command-line

however:
Quote:
Originally Posted by Xeratul View Post
xdotool can do everything but it is not installed everywhere at schools.
wmctrl is a standard that is available everywhere.
i'm not sure i agree that wmctrl is "the standard everywhere". i would rather expect the X utilites to be that.

i was always under the impression that wmctrl is a very handy, but increasingly outdated program, but if you're a bit more proficient you can achieve the same (and more) with xwininfo, xprop and such.

Last edited by ondoho; 02-25-2017 at 12:14 PM.
 
  


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
How to maximize window through command,wmctrl is not working santosh vyduyla Linux - Newbie 1 05-28-2013 09:25 AM
wmctrl: moving current window up/down/left/right? Xeratul Linux - Desktop 9 03-29-2013 01:50 AM
Making screenshot of current window using Wmctrl ... Xeratul Programming 0 01-07-2013 09:45 AM
wmctrl to place a window on top / bottom layer ? Xeratul Linux - General 0 05-19-2012 05:00 AM
LXer: Take charge of your window manager with WMCTRL and Devil's Pie LXer Syndicated Linux News 0 12-21-2007 05:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:37 PM.

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