How to determine if window is maximised or minimised from bash scriptHow to close, minimize, and maximize a...
What does "enim et" mean?
Closed subgroups of abelian groups
How do you conduct xenoanthropology after first contact?
New order #4: World
Extreme, but not acceptable situation and I can't start the work tomorrow morning
Why does apt-get install python3 with a trailing hyphen remove a lot of packages?
How can I fix this gap between bookcases I made?
How is the relation "the smallest element is the same" reflexive?
how to create a data type and make it available in all Databases?
How to use Pandas to get the count of every combination inclusive
Why is the design of haulage companies so “special”?
declaring a variable twice in IIFE
How to make payment on the internet without leaving a money trail?
Can town administrative "code" overule state laws like those forbidding trespassing?
How does one intimidate enemies without having the capacity for violence?
Email Account under attack (really) - anything I can do?
A function which translates a sentence to title-case
Why is "Reports" in sentence down without "The"
What is GPS' 19 year rollover and does it present a cybersecurity issue?
Why is an old chain unsafe?
Chess with symmetric move-square
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
Non-Jewish family in an Orthodox Jewish Wedding
Why do we use polarized capacitor?
How to determine if window is maximised or minimised from bash script
How to close, minimize, and maximize a specified window from Terminal?Problem with using wmctrl to arrange windows in compizHow to determine status of upstart job in bash script?Bash escape from scriptHow do I use wmctrl to detect if a window is present?How do I permanently change window titles?Executing wmctrl from bashsleep X - won't actually make bash script loop waitSet window size and positionObtain last active time of window from IDFrom a bash script, send commands to a terminal window
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a bash script that moves my windows from the left screen to right screen in dual-screen setup. Currently the way it works is cycling through the window ids that are given by xdotool search --onlyvisible --maxdepth 2 --class ""
and then moves them to the right by the screen width. It already works... unless the window in question is maximises or minimised.
So what is needed is a way to check the current status of the window. I have found an answer that provides the way to add and remove those bits, but where is the way to check if they are set already?
If it is not possible to do via xdotool, it should be possible to reuse the window id provided by the command mentioned above.
bash xdotool wmctrl
add a comment |
I have a bash script that moves my windows from the left screen to right screen in dual-screen setup. Currently the way it works is cycling through the window ids that are given by xdotool search --onlyvisible --maxdepth 2 --class ""
and then moves them to the right by the screen width. It already works... unless the window in question is maximises or minimised.
So what is needed is a way to check the current status of the window. I have found an answer that provides the way to add and remove those bits, but where is the way to check if they are set already?
If it is not possible to do via xdotool, it should be possible to reuse the window id provided by the command mentioned above.
bash xdotool wmctrl
add a comment |
I have a bash script that moves my windows from the left screen to right screen in dual-screen setup. Currently the way it works is cycling through the window ids that are given by xdotool search --onlyvisible --maxdepth 2 --class ""
and then moves them to the right by the screen width. It already works... unless the window in question is maximises or minimised.
So what is needed is a way to check the current status of the window. I have found an answer that provides the way to add and remove those bits, but where is the way to check if they are set already?
If it is not possible to do via xdotool, it should be possible to reuse the window id provided by the command mentioned above.
bash xdotool wmctrl
I have a bash script that moves my windows from the left screen to right screen in dual-screen setup. Currently the way it works is cycling through the window ids that are given by xdotool search --onlyvisible --maxdepth 2 --class ""
and then moves them to the right by the screen width. It already works... unless the window in question is maximises or minimised.
So what is needed is a way to check the current status of the window. I have found an answer that provides the way to add and remove those bits, but where is the way to check if they are set already?
If it is not possible to do via xdotool, it should be possible to reuse the window id provided by the command mentioned above.
bash xdotool wmctrl
bash xdotool wmctrl
asked 1 hour ago
v010dyav010dya
5802728
5802728
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Retrieve info on the window state
You can get the info (and a lot more) from the command:
xprop -id <window_id>
Or for example to get what you are specifically looking for:
xprop -id 0x04c00010 | grep "_NET_WM_STATE(ATOM)"
The output will look like:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_HIDDEN
on a window that is maximized (h + v) and minimized at the same time, or just
_NET_WM_STATE(ATOM) =
(or no output at all) if none of those is the case.
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.
– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1132023%2fhow-to-determine-if-window-is-maximised-or-minimised-from-bash-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Retrieve info on the window state
You can get the info (and a lot more) from the command:
xprop -id <window_id>
Or for example to get what you are specifically looking for:
xprop -id 0x04c00010 | grep "_NET_WM_STATE(ATOM)"
The output will look like:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_HIDDEN
on a window that is maximized (h + v) and minimized at the same time, or just
_NET_WM_STATE(ATOM) =
(or no output at all) if none of those is the case.
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.
– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
add a comment |
Retrieve info on the window state
You can get the info (and a lot more) from the command:
xprop -id <window_id>
Or for example to get what you are specifically looking for:
xprop -id 0x04c00010 | grep "_NET_WM_STATE(ATOM)"
The output will look like:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_HIDDEN
on a window that is maximized (h + v) and minimized at the same time, or just
_NET_WM_STATE(ATOM) =
(or no output at all) if none of those is the case.
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.
– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
add a comment |
Retrieve info on the window state
You can get the info (and a lot more) from the command:
xprop -id <window_id>
Or for example to get what you are specifically looking for:
xprop -id 0x04c00010 | grep "_NET_WM_STATE(ATOM)"
The output will look like:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_HIDDEN
on a window that is maximized (h + v) and minimized at the same time, or just
_NET_WM_STATE(ATOM) =
(or no output at all) if none of those is the case.
Retrieve info on the window state
You can get the info (and a lot more) from the command:
xprop -id <window_id>
Or for example to get what you are specifically looking for:
xprop -id 0x04c00010 | grep "_NET_WM_STATE(ATOM)"
The output will look like:
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_HIDDEN
on a window that is maximized (h + v) and minimized at the same time, or just
_NET_WM_STATE(ATOM) =
(or no output at all) if none of those is the case.
edited 25 mins ago
answered 45 mins ago
Jacob VlijmJacob Vlijm
66.2k9131230
66.2k9131230
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.
– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
add a comment |
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.
– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,
_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.– John1024
33 mins ago
Excellent suggestion +1. As a comment, I tried it (under Linux, X11) and got slightly different results. When a window is neither hidden nor maximized,
_NET_WM_STATE(ATOM)
does not, as shown in the answer, appear with an empty value. Instead, it is not in the output at all.– John1024
33 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
@John1024 Ah, thanks! will add it to the answer.
– Jacob Vlijm
29 mins ago
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1132023%2fhow-to-determine-if-window-is-maximised-or-minimised-from-bash-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown