LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-27-2022, 01:10 AM   #1
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,322
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Starting with a specific window size and position


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.

What is the new way to do it?

This is on Devuan GNU/Linux 5 (daedalus/ceres)
 
Old 02-27-2022, 02:20 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
interesting. I think that should work, but probably removed intentionally (or this is just a bug).
 
Old 02-27-2022, 08:04 AM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,610

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553

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.

 
Old 02-27-2022, 08:14 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
Quote:
Originally Posted by boughtonp View Post
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.

I found an old man page where it was documented, but now gedit does not understand that option.
For example you can check here: https://man.fyi/ubuntu1604/1+gedit and https://man.fyi/ubuntu1804/1+gedit
 
1 members found this post helpful.
Old 02-27-2022, 08:23 AM   #5
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
If you open the window, resize, position and close, won't it open like that again?
 
Old 02-27-2022, 08:25 AM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,610

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by pan64 View Post
I found an old man page where it was documented, but now gedit does not understand that option.
For example you can check here: https://man.fyi/ubuntu1604/1+gedit and https://man.fyi/ubuntu1804/1+gedit
A quick search of the gedit repository reveals this 2016 commit:
Quote:
Originally Posted by https://github.com/GNOME/gedit/commit/1b5d9acb24374f203098ff5f49916c89d3972313
Remove --geometry command line option (deprecated in GTK+)

Geometry handling in GTK+ is deprecated. See the deprecation warning of
gtk_window_parse_geometry().

The "deprecation warning" referred to there appears to be nothing more than:
Quote:
Originally Posted by https://docs.gtk.org/gtk3/method.Window.parse_geometry.html
Deprecated since: 3.20

Geometry handling in GTK is deprecated.
:/

 
1 members found this post helpful.
Old 02-27-2022, 08:25 AM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,322

Original Poster
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Quote:
Originally Posted by Jan K. View Post
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.
 
Old 02-27-2022, 08:41 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
Quote:
Originally Posted by boughtonp View Post
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.
 
Old 02-27-2022, 11:47 AM   #9
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Quote:
Originally Posted by Turbocapitalist View Post
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...
 
Old 02-27-2022, 12:13 PM   #10
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,322

Original Poster
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
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.
 
Old 02-27-2022, 05:35 PM   #11
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Quote:
Originally Posted by Turbocapitalist View Post
...the location is not remembered. If I close the program and run it again, it appears in a new location.
Good grief!

That behavior would drive me up the walls. Why would anyone want that??


Perhaps a request upstream? Or ask them if your intentions are even possible... https://forum.xfce.org/viewforum.php?id=4
 
Old 02-27-2022, 11:56 PM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
Quote:
Originally Posted by Jan K. View Post
Good grief!

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.
 
Old 02-28-2022, 09:56 AM   #13
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Turbocapitalist View Post
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:
  1. Right click on the title bar ->
  2. `More Actions' ->
  3. `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.

HTH...
 
Old 02-28-2022, 10:14 AM   #14
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
GTK has been getting rid of the ability for applications to handle absolute screen coordinates. This functionality is missing entirely from Wayland.

IMO, this is a bad decision. My programs need the ability to save and restore their window positions.

This may or may not be helpful, but you have the source code and can fix the behavior yourself (at least on GTK 3 and X11).
Ed
 
1 members found this post helpful.
Old 02-28-2022, 10:26 AM   #15
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by EdGr View Post
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})
 
  


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] firefox/seamonkey start with specific window size and screen position porphyry5 Linux - Software 2 09-24-2015 02:10 PM
When Centos 6.3 starting,All services starting OK and starting Atd: OK .And stop scr. DeSouffle Linux - General 4 08-29-2013 12:46 AM
LXer: Open the terminal in a specific size and position in Ubuntu/ Linux Mint LXer Syndicated Linux News 0 07-31-2012 09:51 PM
KDE Window Position & Size Sheriff Hobbes Linux - Newbie 1 11-15-2010 06:49 AM
[SOLVED] Starting File System .. Starting File System .. Starting File System .. Starting File rmknox Linux - Newbie 3 08-15-2010 11:30 PM

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

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