SolydX Window Size and Placement Control

Post your tutorials and howtos here.
Posts: 14
Joined: 22 Jan 2019 02:53

SolydX Window Size and Placement Control

Postby xfce » 31 Jan 2019 16:57

*** This is purely subjective, offered that one may find utility and humor within ***

Transitioning from Windows to a Linux DE presents a myriad of delights and annoyances. The Xfce bottom panel and lanuchers allow me to utilize menu navigation memory which began with Windows 95. The learning curve was virtually non-existent and in many ways, superior to the Microsoft paradigm.

Consistent and repeatable window sizes and placement -- this is not the alpha/omega, but it's a start!

Legacy applications like the terminal, utilize a "--geometry" flag which allows definition of the window X,Y & Z axis - rudimentary, but offers finer granularity. Another approach, Geany editor will save the last window size and placement as a preference (nice user-centric programming). Some may be configurable if you choose to PEEK and POKE in "gsettings" (which has a TI-990 DX10 filesystem vibe to it).

This morning at 00:Dark:30 in the dim confines of the Bat Cave, I clicked the "Package Updater" BAM-POW!! 24-inches of FULL-SCREEN WHITE BACKGROUND! Honestly, it was painful. I can see the logic on a 1366x768 notebook display. On an HD dual monitor setup? Not so much.

The "--help-all" flag and man pages for gpk-update-viewer and gpk-prefs were definitely not as illuminating as the application window itself. ;-)

We can fix that! xdotool is complex so I've added a bash script to cut to the chase for the window managment portion. You may have to tinker with the numbers a bit (I've found placement differences between different DE), but it will work!


As ROOT: apt-get -f wmctrl xdotool

-- wmctrl -- CLI, interact with an Extended Window Manager Hints (EWMH) compatible X Window manager. ... c-1.3.html

-- xdotool -- CLI, X11 automation tool (see use the "WINDOWS COMMANDS" section) ... ool.1.html

I save the script as "xy_update-manager" in the "/home/$USER/bin" subdirectory.

Code: Select all

# xy_update-manager - Package Updater - Monitor #1 CTR -- 01.31.2019
# ==================================================================
# SolydXee XFCE x64
# ** final settings = xy: 569 149 -- sz: 790x791 **
# -------------------------------------------------

sudo /usr/bin/gpk-update-viewer &

xdotool search --sync --name 'Package Updater' windowsize 790 791 windowmove 569 149


Using "wmctrl"
-- 1) To cut down on the visual noise, close ALL the windows on your desktop.
-- 2) Open the application you wish to control, resize and place on your desktop.
-- 3) Open a terminal and run: wmctrl -lG (lower-case L -- upper-case G)

Sample output:
0x00800004 -1 0 1043 1920 37 xfce xfce4-panel
0x00a00003 -1 0 0 3840 1080 xfce Desktop
0x0300010c 0 569 149 790 791 xfce Package Updater
0x03000202 0 714 538 520 128 xfce
0x02800003 0 1931 58 958 1002 xfce Terminal

Compare the blue line in the output with the bash script above to see the correlation.

All you need is to edit the Application Entry in the Whisker Menu to point to the executable script location and there will be the window, sized and positioned where you'd like it!

NOTE: With Firefox, I actually had to use a negative number for the Y axis to get it to move to the top of the screen! :facepalm:

Experiment and Good Luck!
xy_update-manager.jpg (50.1 KiB) Viewed 5105 times

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests