Maximize Window without Window Manager?
Clash Royale CLAN TAG#URR8PPP
If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?
window-manager x-server window
add a comment |
If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?
window-manager x-server window
add a comment |
If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?
window-manager x-server window
If I want to run GUI software on my Linux machine, I can do it without a window manager, but I can not discover a way to maximize the window. Is there a reliable way to maximize a window in an x server without a window manager?
window-manager x-server window
window-manager x-server window
asked Feb 21 '16 at 3:47
motokumotoku
1639
1639
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool
for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.
dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
windowid=…
xdotool windowmove "$windowid" 0 0 windowsize "$dimensions%x*" "$dimensions#*x"
add a comment |
I would like to open all my text files with Sublime Text, but it does not support a --maximize
command line argument, and it either does not remember it window state on Linux and always open unmaximized.
Then, after researching I built this script:
#!/usr/bin/env bash
# run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
eval ""$2" "$3" "$4" "$5" "$6" "$7" "$8" "$@:9""
while [ true ]
do
FocusApp=`xdotool getwindowfocus getwindowname`
if [[ "$FocusApp" == *"$1"* ]];
then
# xdotool key super+Up
wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
break
fi
done
You need to install these two things:
sudo apt-get install wmctrl xdotool
I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.
References:
- How to execute a command on window focus/unfocus?
- How to send keystrokes (F5) from terminal to a GUI program?
- https://superuser.com/questions/382616/detecting-currently-active-window
- https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class
- https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f264684%2fmaximize-window-without-window-manager%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool
for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.
dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
windowid=…
xdotool windowmove "$windowid" 0 0 windowsize "$dimensions%x*" "$dimensions#*x"
add a comment |
X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool
for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.
dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
windowid=…
xdotool windowmove "$windowid" 0 0 windowsize "$dimensions%x*" "$dimensions#*x"
add a comment |
X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool
for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.
dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
windowid=…
xdotool windowmove "$windowid" 0 0 windowsize "$dimensions%x*" "$dimensions#*x"
X servers don't have a notion of “maximized” window. To maximize a window, instruct the application to use a window size that matches the screen size. You can use xdotool
for that, though it may be a little difficult to select the window without a window manager — many ways to enumerate and single out windows rely on a window manager.
dimensions=$(xdpyinfo | sed 's/^ *dimension * : *([0-9]*x[0-9]*).*/1/p')
windowid=…
xdotool windowmove "$windowid" 0 0 windowsize "$dimensions%x*" "$dimensions#*x"
answered Feb 22 '16 at 0:08
GillesGilles
544k12811031620
544k12811031620
add a comment |
add a comment |
I would like to open all my text files with Sublime Text, but it does not support a --maximize
command line argument, and it either does not remember it window state on Linux and always open unmaximized.
Then, after researching I built this script:
#!/usr/bin/env bash
# run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
eval ""$2" "$3" "$4" "$5" "$6" "$7" "$8" "$@:9""
while [ true ]
do
FocusApp=`xdotool getwindowfocus getwindowname`
if [[ "$FocusApp" == *"$1"* ]];
then
# xdotool key super+Up
wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
break
fi
done
You need to install these two things:
sudo apt-get install wmctrl xdotool
I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.
References:
- How to execute a command on window focus/unfocus?
- How to send keystrokes (F5) from terminal to a GUI program?
- https://superuser.com/questions/382616/detecting-currently-active-window
- https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class
- https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal
add a comment |
I would like to open all my text files with Sublime Text, but it does not support a --maximize
command line argument, and it either does not remember it window state on Linux and always open unmaximized.
Then, after researching I built this script:
#!/usr/bin/env bash
# run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
eval ""$2" "$3" "$4" "$5" "$6" "$7" "$8" "$@:9""
while [ true ]
do
FocusApp=`xdotool getwindowfocus getwindowname`
if [[ "$FocusApp" == *"$1"* ]];
then
# xdotool key super+Up
wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
break
fi
done
You need to install these two things:
sudo apt-get install wmctrl xdotool
I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.
References:
- How to execute a command on window focus/unfocus?
- How to send keystrokes (F5) from terminal to a GUI program?
- https://superuser.com/questions/382616/detecting-currently-active-window
- https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class
- https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal
add a comment |
I would like to open all my text files with Sublime Text, but it does not support a --maximize
command line argument, and it either does not remember it window state on Linux and always open unmaximized.
Then, after researching I built this script:
#!/usr/bin/env bash
# run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
eval ""$2" "$3" "$4" "$5" "$6" "$7" "$8" "$@:9""
while [ true ]
do
FocusApp=`xdotool getwindowfocus getwindowname`
if [[ "$FocusApp" == *"$1"* ]];
then
# xdotool key super+Up
wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
break
fi
done
You need to install these two things:
sudo apt-get install wmctrl xdotool
I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.
References:
- How to execute a command on window focus/unfocus?
- How to send keystrokes (F5) from terminal to a GUI program?
- https://superuser.com/questions/382616/detecting-currently-active-window
- https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class
- https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal
I would like to open all my text files with Sublime Text, but it does not support a --maximize
command line argument, and it either does not remember it window state on Linux and always open unmaximized.
Then, after researching I built this script:
#!/usr/bin/env bash
# run it with /home/user/maximize.sh "Sublime Text" /usr/bin/subl -n
eval ""$2" "$3" "$4" "$5" "$6" "$7" "$8" "$@:9""
while [ true ]
do
FocusApp=`xdotool getwindowfocus getwindowname`
if [[ "$FocusApp" == *"$1"* ]];
then
# xdotool key super+Up
wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz
break
fi
done
You need to install these two things:
sudo apt-get install wmctrl xdotool
I am not using ``xdotool` to maximize the window because it seems to be bugging with my XFCE4 and when unmaximizing the window, its default size is set to whole window size, i.e., when maximizing the window, it also changed the window size to the match the whole screen size.
References:
- How to execute a command on window focus/unfocus?
- How to send keystrokes (F5) from terminal to a GUI program?
- https://superuser.com/questions/382616/detecting-currently-active-window
- https://superuser.com/questions/850145/how-to-use-wmctrl-to-activate-window-of-a-given-class
- https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal
edited Feb 28 at 16:49
answered Feb 28 at 3:06
useruser
125110
125110
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f264684%2fmaximize-window-without-window-manager%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