Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to open a simple text editor in a predesignated position on the screen with specific window dimensions. Maybe I am remembering incorrectly but I though it could be done in X11 with the -geometry option, but it does not seem to be recognized:
Code:
$ pluma --geometry 100x100-1000+1000
Unknown option --geometry
Run 'pluma --help' to see a full list of available command line options.
$ gedit -geometry 100x100-1000+1000
Unknown option -geometry
$ mousepad -geometry 100x100-1000+1000
Running "pluma --help" does not show any relevant options.
The option is -geometry, but not all applications support it (and I don't know what the criteria is - even when it works it's not guaranteed to be in the --help output).
A potential workaround is to use xdotool - e.g. "xdotool getactivewindow windowmove 100 100; getactivewindow windowsize 1000 1000", but of course that needs the application to be started first.
The option is -geometry, but not all applications support it (and I don't know what the criteria is - even when it works it's not guaranteed to be in the --help output).
A potential workaround is to use xdotool - e.g. "xdotool getactivewindow windowmove 100 100; getactivewindow windowsize 1000 1000", but of course that needs the application to be started first.
If you open the window, resize, position and close, won't it open like that again?
I'm always opening and closing windows and whole applications. What I am aiming for is to have a script be able to always open one application's window in a specific place each time it is called.
A quick search of the gedit repository reveals this 2016 commit:
The "deprecation warning" referred to there appears to be nothing more than:
:/
wow, in that case gnome-terminal is buggy, it still supports this option (and other apps too).
Anyway, the solution is to implement a script where you can start gedit and set its size and location with wmctl or xdotool or similar. Or eventually the commit can be reverted.
I'm always opening and closing windows and whole applications. What I am aiming for is to have a script be able to always open one application's window in a specific place each time it is called.
Yes understood, but what I meant was; if your windows remembers size and position, there must be a newly written conf/inf/reg file somewhere for you to manipulate...
I just tried a few applications and the location is not remembered. If I close the program and run it again, it appears in a new location. This is on XFCE4 with the default xfwm Window Manager, if it matters.
That behavior would drive me up the walls. Why would anyone want that??
Because when you start the same app several times it will be always placed next to the previous one. Using the same size and location will be very annoying.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by Turbocapitalist
I would like to open a simple text editor in a predesignated position on the screen with specific window dimensions. Maybe I am remembering incorrectly but I though it could be done in X11 with the -geometry option, but it does not seem to be recognized:
Code:
$ pluma --geometry 100x100-1000+1000
Unknown option --geometry
Run 'pluma --help' to see a full list of available command line options.
$ gedit -geometry 100x100-1000+1000
Unknown option -geometry
$ mousepad -geometry 100x100-1000+1000
[snip]
What is the new way to do it?
I feel your pain. The "-geometry" option -- and other things that I used to put into my .Xresources file -- don't seem to work very reliably any more. It's rather annoying that so many applications have poor support for the traditional X11 CLI switches like `-geometry'.
If you're using KDE, you have the ``Special Windows Settings...'' option:
Right click on the title bar ->
`More Actions' ->
`Configure Special Windows Settings'
which brings up a comprehensive dialog that lets you specify all the things (and many more) that the "-geometry" switch would normally provide.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by EdGr
GTK has been getting rid of the ability for applications to handle absolute screen coordinates.
Yep. For work, I use Oracle VirtualBox VMs with RedHat and the Gnome windowing environment doesn't seem to honor .Xresources at all. It does, though, allow me to write wrapper scripts that include the ``-geometry'' switch to force terminal-based applications to be a specific size. I suspect that even having that workaround is planned for future deprecation. (I just love having to manually resize and move application windows around by hand... just like I have to do when I need to work with Windows applications. \end{sarcasm})
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.