Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
0
answers
28
views
Discrepancy in coordinates reported by wmctrl when managing window positions
I'm developing a script using `wmctrl` to restore window positions across different monitors and workspaces. However, I’ve encountered an issue where `wmctrl` reports different coordinates than the ones it was instructed to set. ### Example: Gnome Maps Here is an example using Gnome Maps (`gnome-map...
I'm developing a script using
wmctrl
to restore window positions across different monitors and workspaces. However, I’ve encountered an issue where wmctrl
reports different coordinates than the ones it was instructed to set.
### Example: Gnome Maps
Here is an example using Gnome Maps (gnome-maps
):
boris@E5440-DELL:~$ wmctrl -lG | grep Maps
0x01400004 0 240 420 1800 900 E5440-DELL Maps
boris@E5440-DELL:~$ wmctrl -ir 0x01400004 -e 0,35,80,1900,500
boris@E5440-DELL:~$ wmctrl -lG | grep Maps
0x01400004 0 70 160 1900 542 E5440-DELL Maps
boris@E5440-DELL:~$ wmctrl -ir 0x01400004 -e 0,120,210,1800,900
boris@E5440-DELL:~$ wmctrl -lG | grep Maps
0x01400004 0 240 420 1800 900 E5440-DELL Maps
When setting the window to (x=120, y=210), wmctrl
reports (x=240, y=420). However, xwininfo
confirms the coordinates were correctly set:
boris@E5440-DELL:~$ xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x1400004 "Maps"
Absolute upper-left X: 120
Absolute upper-left Y: 210
Relative upper-left X: 120
Relative upper-left Y: 210
Width: 1800
Height: 900
Depth: 32
Visual: 0xad
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x1400001 (not installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +120+210 -0+210 -0--30 +120--30
-geometry 1800x900-0--30
### Example: Discord
Here’s another example with Discord (com.discordapp.Discord
):
boris@E5440-DELL:~$ wmctrl -lG | grep Discord
0x02c00005 1 364 199 1200 800 E5440-DELL Friends - Discord
boris@E5440-DELL:~$ wmctrl -ir 0x02c00005 -e 0,55,80,1200,800
boris@E5440-DELL:~$ wmctrl -lG | grep Discord
0x02c00005 1 69 129 1200 800 E5440-DELL Friends - Discord
boris@E5440-DELL:~$ wmctrl -ir 0x02c00005 -e 0,350,150,1200,800
boris@E5440-DELL:~$ wmctrl -lG | grep Discord
0x02c00005 1 364 199 1200 800 E5440-DELL Friends - Discord
Again, the set coordinates (x=350, y=150) are confirmed by xwininfo
but wmctrl
reports (x=364, y=199).
boris@E5440-DELL:~$ xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x2c00005 "Friends - Discord"
Absolute upper-left X: 350
Absolute upper-left Y: 150
Relative upper-left X: 14
Relative upper-left Y: 49
Width: 1200
Height: 800
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +350+150 -370+150 -370-130 +350-130
-geometry 1200x800+350+150
### Conclusion
In most cases, the reported window coordinates are off by a factor of 2. For example, when a window is set to (x=20, y=10), wmctrl
reports (x=40, y=20). However, some applications, such as Discord (com.discordapp.Discord
) and GlobalProtect (yuezk/GlobalProtect-openconnect
), exhibit unpredictable behavior where the discrepancy doesn’t follow the factor-of-2 pattern.
If it were simply a factor-of-2 scaling issue, the discrepancy could be resolved mathematically. However, the unpredictable behavior in certain applications complicates things. At first wmctrl
seemed like a suitable tool for this purpose, but these discrepancies make it unreliable for my use case. Any insights would be greatly appreciated!
Is this behavior expected in wmctrl
, or could it be a bug?
Has anyone experienced similar issues with wmctrl
reporting incorrect window coordinates?
Boris L.
(121 rep)
Jan 16, 2025, 06:17 PM
-1
votes
1
answers
141
views
How to set permanent 'always on visible workspace' xfce4's applications windows?
I try to figure out the way to make it permanent: [![enter image description here][1]][1] I know that's the `firefox` default behavior. I have no clue how it's implemented. How to do it? [1]: https://i.sstatic.net/oTHkZt2A.png
I try to figure out the way to make it permanent:
I know that's the

firefox
default behavior. I have no clue how it's implemented.
How to do it?
Gilles Quénot
(36209 rep)
Nov 11, 2024, 06:08 AM
• Last activity: Nov 12, 2024, 12:02 PM
13
votes
2
answers
5743
views
wmctrl-like tool or alternative for kde wayland
A big part of my workflow is based on using shortcuts. Currently I use xbindkeys and wmctrl to run-or-raise an application. E.g: Super + F brings up firefox or run it if not running. Autokey works fine with KDE and I could also use KDE native custom shortcut manager to replace `xbindkeys` but I can'...
A big part of my workflow is based on using shortcuts. Currently I use xbindkeys and wmctrl to run-or-raise an application. E.g: Super+F brings up firefox or run it if not running.
Autokey works fine with KDE and I could also use KDE native custom shortcut manager to replace
xbindkeys
but I can't find (and I googled a lot) a way to determine if a window/application is running and if not, raise it.
I can probably use ps
or a similar command to find if an application is running and if not, launch it, but it goes to the final problem: how to raise (or focus) an existing running window/application programmatically?
There seems to be some kind of gdbus
solution for GNOME but of course this won't work in KDE.
Does anyone have an idea or clue of what can I do?
academo
(199 rep)
Jul 2, 2021, 02:56 PM
• Last activity: Oct 31, 2024, 07:12 PM
2
votes
2
answers
874
views
Fedora 36: wmctrl does not work at all
I have a script that I run on RHEL (currently 8.4, but this has worked on many previous versions). It uses `wmctrl -a` to activate specific windows. I just created a Fedora 36 VM on VirtualBox and there `wmctrl -a` does nothing. Likewise `wmctrl -l` lists nothing. I am using the default window manag...
I have a script that I run on RHEL (currently 8.4, but this has worked on many previous versions). It uses
wmctrl -a
to activate specific windows. I just created a Fedora 36 VM on VirtualBox and there wmctrl -a
does nothing. Likewise wmctrl -l
lists nothing. I am using the default window manager which I believe is Gnome 41. Can anyone assist?
Tom LInk
(21 rep)
Dec 30, 2021, 06:23 PM
• Last activity: Jun 26, 2024, 01:07 AM
2
votes
2
answers
1330
views
Fedora 33 - gnome-terminal doesn't show up in wmctrl
A while ago I wrote a `wmctrl`-based script I used to implement a hotkey to focus into running *gnome-terminal* instance in order to avoid using mouse when I need to run anything in terminal. After an upgrade to Fedora 33 it seems like `wmctrl -l` doesn't list *gnome-terminal* windows anymore. It do...
A while ago I wrote a
wmctrl
-based script I used to implement a hotkey to focus into running *gnome-terminal* instance in order to avoid using mouse when I need to run anything in terminal. After an upgrade to Fedora 33 it seems like wmctrl -l
doesn't list *gnome-terminal* windows anymore. It does list other windows though - like Chrome browser or Electron apps.
mdulko:~/ $ wmctrl -l
0x00a00001 3 fedora The Dandy Warhols - Country Leaver
0x02a0004c 2 fedora release – lower-constraints.txt
0x01c00007 1 fedora Slack | |
0x01000007 0 fedora Chrome/Chromium 85.0.4183.83 regression workaround : swaywm - Brave
This is probably related to usage of Wayland which Fedora defaults to and I use. To script that I'll probably need to call lookingGlass API over gdbus. Is that a good clue?
dulek
(21 rep)
Dec 8, 2020, 04:34 PM
• Last activity: Jun 26, 2024, 01:01 AM
6
votes
2
answers
8373
views
Is there a way to get list of windows on KDE Wayland?
In the era of X11, I could do `wmctrl -l` to list available windows, that I can use in my scripts. ``` $ wmctrl -l 0x01000050 0 my-pc project1 – Readme.md ``` But nowadays most application use Wayland. The above command only shows windows that are running with XWayland. I want to be able to use appl...
In the era of X11, I could do
wmctrl -l
to list available windows, that I can use in my scripts.
$ wmctrl -l
0x01000050 0 my-pc project1 – Readme.md
But nowadays most application use Wayland. The above command only shows windows that are running with XWayland.
I want to be able to use applications in Wayland mode and at the same time be able to list their windows for my scripts. Is that possible? I am using Arch Linux with KDE.
Ashark
(1069 rep)
Jun 16, 2022, 09:36 PM
• Last activity: May 17, 2024, 01:11 AM
2
votes
1
answers
189
views
wmctrl move window to workspace
I am trying to use `wmctrl` to move a window to a workspace. By `wmctrl -l` window is 0x03e00057 9 meer montazo - Google Search — Mozilla Firefox Command and output is /usr/local/bin/wmctrl -v -i 0x03e00057 -t 3 envir_utf8: 0 No window was specified. My understanding is that `-i` points to the hex i...
I am trying to use
wmctrl
to move a window to a workspace.
By wmctrl -l
window is
0x03e00057 9 meer montazo - Google Search — Mozilla Firefox
Command and output is
/usr/local/bin/wmctrl -v -i 0x03e00057 -t 3
envir_utf8: 0
No window was specified.
My understanding is that -i
points to the hex id of the window (first field in the output list?), which in my simple mind i am doing here. Where am I astray?
Stephen Boston
(2526 rep)
Mar 31, 2024, 05:32 PM
• Last activity: Mar 31, 2024, 08:57 PM
5
votes
1
answers
1889
views
Command-line tool to get "click and drag" rectangle coordinates from the screen
I would like to execute a command-line command that activates "click and drag" mouse selection on a single local X11 screen. The goal is to: - get the selected rectangle **X** and **Y** coordinates, - get the rectangle **width** and **height**, - output these values to **stdout**, - (optional) draw...
I would like to execute a command-line command that activates "click and drag" mouse selection on a single local X11 screen.
The goal is to:
- get the selected rectangle **X** and **Y** coordinates,
- get the rectangle **width** and **height**,
- output these values to **stdout**,
- (optional) draw a selection border while dragging the mouse.
user218169
Feb 27, 2017, 10:11 AM
• Last activity: Feb 14, 2024, 04:39 PM
4
votes
2
answers
422
views
How can I monitor in real time the changes to the browser's WM_NAME
I need to check how the browser's WM_NAME (let's say google-chrome) is changing in real time. How can I do that ?
I need to check how the browser's WM_NAME (let's say google-chrome) is changing in real time.
How can I do that ?
Michal Przybylowicz
(471 rep)
Mar 7, 2017, 11:40 PM
• Last activity: Jan 2, 2024, 03:21 PM
9
votes
2
answers
1088
views
wmctrl doesn't move window when snapped or tiled
I'm using Mint 18.1 cinnamon. I'm trying to write a little bash program to move windows around. I have a command that will remove maximized_vert and maximized_horz then move the window. It works fine if the the target window is maximized or just floating, but if the window is snapped into place usin...
I'm using Mint 18.1 cinnamon. I'm trying to write a little bash program to move windows around.
I have a command that will remove maximized_vert and maximized_horz then move the window. It works fine if the the target window is maximized or just floating, but if the window is snapped into place using super [arrow] ( think this is tiling? ) it has no affect. The code is as follows
wmctrl -r "$CHROME" -i -b remove,maximized_vert
wmctrl -r "$CHROME" -i -b remove,maximized_horz
wmctrl -r "$CHROME" -i -e '0,0,0,500,500'
Where "$CHROME" is the hex address or the window.
I repeat it works if the window is maxamized or if it is just floating but does not work when the window is tiled or snapped using super [arrow]
Thanks for the help
Raif
(191 rep)
Mar 22, 2017, 11:02 PM
• Last activity: Sep 15, 2023, 02:17 PM
5
votes
3
answers
2573
views
How to get the url from current tab of firefox, without need to install additional software?
It's possible to get the current tab with xdotool: # set focus to address on browser xdotool search --onlyvisible --classname Navigator windowactivate --sync key F6 # copy address from browser tab to clipboard xdotool search --onlyvisible --classname Navigator windowactivate --sync key Ctrl+c # get...
It's possible to get the current tab with xdotool:
# set focus to address on browser
xdotool search --onlyvisible --classname Navigator windowactivate --sync key F6
# copy address from browser tab to clipboard
xdotool search --onlyvisible --classname Navigator windowactivate --sync key Ctrl+c
# get off the focus from address from browser tab
xdotool search --onlyvisible --classname Navigator windowactivate --sync key F6
# delivery of clipboard content to variable
clipboard=
xclip -o -selection clipboard
# clear clipboard
xsel -bc; xsel -c
# echo URL of active tab of active browser
echo $clipboard
Since xdotool is buggy and sometimes fires keys without stopping with the code above, I need another way to do the same, perhaps with wmctrl.
This is what I tried, using wmctrl on bash; it didn't work for me:
id=$(wmctrl -l | grep -oP "(?<=)(0x\w+)(?=.*Firefox)")
# set focus to address on browser
xdotool key --window $id "ctrl+l"
# copy address from browser tab
xdotool key --window $id "ctrl+c"
# delivery of clipboard content to variable
url=xclip -o -selection clipboard
# clear clipboard
xsel -bc; xsel -c
# echo URL of active tab of active browser
echo $url
Alfred.37
(129 rep)
Jan 16, 2021, 03:12 PM
• Last activity: Apr 7, 2023, 10:53 PM
1
votes
1
answers
525
views
Resize xsane tiny window in Gnome
I am running Ubuntu 21.10 on a Lenovo Thinkpad with Gnome has my desktop. When I run xsane my "Advanced Options" window is tiny (10 pixels wide and not much more high) and I cannot seem to resize it. Thus I do not have access to its functions. When I move my mouse near edges of the window I do not g...
I am running Ubuntu 21.10 on a Lenovo Thinkpad with Gnome has my desktop. When I run xsane my "Advanced Options" window is tiny (10 pixels wide and not much more high) and I cannot seem to resize it. Thus I do not have access to its functions.
When I move my mouse near edges of the window I do not get the resize pointer. When I right click on the title bar, "Maximize" and "Resize" are greyed out and unavailable.
Running
sudo apt purge xsane
sudo apt install xsane
did not fix the problem.
When I run -r 'Advanced options HP Color LaserJet MFP M476dw (3DBC02):HP Color LaserJet MFP M476dw (3DBC02)' -e 0,200,300,300,300
I can move the tiny window around but I cannot affect its size. It remembers this tiny size between sessions so it is being stored in an file somewhere. In the directory ~/.sane/xsane
there are three settings files: .rc
:
"xsane-version"
"0.999"
"xsane-mode"
1
"tmp-path"
"/tmp/"
"working-directory"
"/home/brett"
"filename"
"/media/Shared/Joelle/page0008.png"
"filetype"
".png"
"cms-function"
1
"cms-intent"
0
"cms-bpc"
0
"image-umask"
95
"directory-umask"
23
"fax-project"
"/home/brett/faxproject"
"fax-command"
"sendfax"
"fax-receiver-option"
"-d"
"fax-postscript-option"
""
"fax-normal-option"
"-l"
"fax-fine-option"
"-m"
"fax-viewer"
"ghostscript"
"fax-width"
14135902
"fax-height"
19462666
"fax-left-offset"
0
"fax-bottom-offset"
0
"fax-fine-mode"
1
"fax-ps-flatedecoded"
1
"e-mail-from"
""
"e-mail-reply-to"
""
"e-mail-smtp-server"
""
"e-mail-smtp-port"
25
"e-mail-authentication"
0
"e-mail-auth-user"
""
"e-mail-auth-pass"
""
"e-mail-pop3-server"
""
"e-mail-pop3-port"
110
"e-mail-project"
"/home/brett/emailproject"
"e-mail-filetype"
".png"
"multipage-project"
"/home/brett/tmp/temp"
"multipage-filetype"
".pdf"
"ocr-command"
"gocr"
"ocr-inputfile-option"
"-i"
"ocr-outputfile-options"
"-o"
"ocr-use-gui-pipe"
0
"ocr-gui-outfd-option"
"-x"
"ocr-progress-keyword"
""
"browser"
"/usr/bin/sensible-browser"
"jpeg-quality"
4587520
"png-compression"
458752
"tiff-zip-compression"
393216
"tiff-compression16_nr"
32773
"tiff-compression8_nr"
7
"tiff-compression1_nr"
3
"save-devprefs-at-exit"
1
"overwrite-warning"
1
"skip-existing-numbers"
1
"save-ps-flatedecoded"
1
"save-pdf-flatedecoded"
1
"save-pnm16-as-ascii"
0
"reduce-16bit-to8bit"
0
"filename-counter-step"
1
"filename-counter-len"
4
"adf-pages-max"
1
"show-range-mode"
6
"tool-tips"
1
"show-histogram"
0
"show-gamma"
1
"show-batch-scan"
0
"show-standard-options"
0
"show-advanced-options"
1
"show-resolution-list"
0
"length-unit"
1664614
"main-window-fixed"
1
"display-icm-profile"
""
"custom-proofing-icm-profile"
""
"working-color-space-icm-profile"
""
"preview-own-cmap"
0
"preview-oversampling"
98304
"preview-gamma"
65536
"preview-gamma-red"
65536
"preview-gamma-green"
65536
"preview-gamma-blue"
65536
"disable-gimp-preview-gamma"
1
"preview-gamma-input-bits"
12
"preview-pipette-range"
3
"gamma"
44348
"gamma-red"
65536
"gamma-green"
65536
"gamma-blue"
65536
"brightness"
869672
"brightness-red"
0
"brightness-green"
0
"brightness-blue"
0
"contrast"
1366627
"contrast-red"
0
"contrast-green"
0
"contrast-blue"
0
"rgb-default"
1
"negative"
0
"auto-enhance-gamma"
1
"preselect-scan-area"
1
"auto-correct-colors"
1
"gtk-update-policy"
1
"medium-nr"
0
"paper-orientation"
0
"preset-area-definitions"
17
"printernr"
0
"printerdefinitions"
1
"printer-name"
"new printer"
"printer-command"
"lp"
"printer-copy-number-option"
"-n"
"printer-lineart-resolution"
300
"printer-grayscale-resolution"
150
"printer-color-resolution"
150
"printer-width"
13316912
"printer-height"
19306193
"printer-left-offset"
229716
"printer-bottom-offset"
229716
"printer-gamma"
65536
"printer-gamma-red"
65536
"printer-gamma-green"
65536
"printer-gamma-blue"
65536
"printer-icm-profile"
""
"printer-ps-flatedecoded"
1
"printer-embed-csa"
1
"printer-embed-crd"
0
"printer-cms-bpc"
0
"preset-area-name"
"DIN A3 port."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
19462882
"preset-area-height"
27525120
"preset-area-name"
"DIN A3 land."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
27525120
"preset-area-height"
19462882
"preset-area-name"
"DIN A4 port."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
13762560
"preset-area-height"
19462882
"preset-area-name"
"DIN A4 land."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
19462882
"preset-area-height"
13762560
"preset-area-name"
"DIN A5 port."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
9732096
"preset-area-height"
13762560
"preset-area-name"
"DIN A5 land."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
13762560
"preset-area-height"
9732096
"preset-area-name"
"13cm x 18cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
8519680
"preset-area-height"
11796480
"preset-area-name"
"18cm x 13cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
11796480
"preset-area-height"
8519680
"preset-area-name"
"10cm x 15cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
6553600
"preset-area-height"
9830400
"preset-area-name"
"15cm x 10cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
9830400
"preset-area-height"
6553600
"preset-area-name"
"9cm x 13cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
5898240
"preset-area-height"
8519680
"preset-area-name"
"13cm x 9cm"
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
8519680
"preset-area-height"
5898240
"preset-area-name"
"legal port."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
14149222
"preset-area-height"
23304602
"preset-area-name"
"legal land."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
23304602
"preset-area-height"
14149222
"preset-area-name"
"letter port."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
14149222
"preset-area-height"
18310758
"preset-area-name"
"letter land."
"preset-area-xoffset"
0
"preset-area-yoffset"
0
"preset-area-width"
18310758
"preset-area-height"
14149222
.mdf
:
"MEDIUM_DEFINITIONS"
11
"medium-name"
"Full color range"
"medium-shadow-gray"
0
"medium-shadow-red"
0
"medium-shadow-green"
0
"medium-shadow-blue"
0
"medium-highlight-gray"
6553600
"medium-highlight-red"
6553600
"medium-highlight-green"
6553600
"medium-highlight-blue"
6553600
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
0
"medium-name"
"Slide"
"medium-shadow-gray"
0
"medium-shadow-red"
0
"medium-shadow-green"
0
"medium-shadow-blue"
0
"medium-highlight-gray"
2621440
"medium-highlight-red"
2621440
"medium-highlight-green"
2621440
"medium-highlight-blue"
2621440
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
0
"medium-name"
"Standard negative"
"medium-shadow-gray"
0
"medium-shadow-red"
458752
"medium-shadow-green"
65536
"medium-shadow-blue"
0
"medium-highlight-gray"
4325376
"medium-highlight-red"
4325376
"medium-highlight-green"
2162688
"medium-highlight-blue"
1048576
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
1
"medium-name"
"Agfa negative"
"medium-shadow-gray"
0
"medium-shadow-red"
393216
"medium-shadow-green"
131072
"medium-shadow-blue"
0
"medium-highlight-gray"
2031616
"medium-highlight-red"
3997696
"medium-highlight-green"
1572864
"medium-highlight-blue"
851968
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
1
"medium-name"
"Agfa negative XRG 200-4"
"medium-shadow-gray"
0
"medium-shadow-red"
786432
"medium-shadow-green"
131072
"medium-shadow-blue"
104857
"medium-highlight-gray"
2293760
"medium-highlight-red"
4030464
"medium-highlight-green"
1409024
"medium-highlight-blue"
950272
"medium-gamma-gray"
65536
"medium-gamma-red"
52428
"medium-gamma-green"
43909
"medium-gamma-blue"
39321
"medium-negative"
1
"medium-name"
"Agfa negative HDC 100"
"medium-shadow-gray"
0
"medium-shadow-red"
229376
"medium-shadow-green"
65536
"medium-shadow-blue"
32768
"medium-highlight-gray"
1736704
"medium-highlight-red"
3506176
"medium-highlight-green"
1441792
"medium-highlight-blue"
1114112
"medium-gamma-gray"
65536
"medium-gamma-red"
51773
"medium-gamma-green"
42598
"medium-gamma-blue"
39321
"medium-negative"
1
"medium-name"
"Fuji negative"
"medium-shadow-gray"
0
"medium-shadow-red"
458752
"medium-shadow-green"
65536
"medium-shadow-blue"
0
"medium-highlight-gray"
2097152
"medium-highlight-red"
4194304
"medium-highlight-green"
2162688
"medium-highlight-blue"
1048576
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
1
"medium-name"
"Kodak negative"
"medium-shadow-gray"
0
"medium-shadow-red"
589824
"medium-shadow-green"
131072
"medium-shadow-blue"
0
"medium-highlight-gray"
1769472
"medium-highlight-red"
3538944
"medium-highlight-green"
1179648
"medium-highlight-blue"
786432
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
1
"medium-name"
"Konica negative"
"medium-shadow-gray"
0
"medium-shadow-red"
196608
"medium-shadow-green"
0
"medium-shadow-blue"
0
"medium-highlight-gray"
1638400
"medium-highlight-red"
2490368
"medium-highlight-green"
1376256
"medium-highlight-blue"
917504
"medium-gamma-gray"
65536
"medium-gamma-red"
65536
"medium-gamma-green"
65536
"medium-gamma-blue"
65536
"medium-negative"
1
"medium-name"
"Konica negative VX 100"
"medium-shadow-gray"
0
"medium-shadow-red"
131072
"medium-shadow-green"
0
"medium-shadow-blue"
0
"medium-highlight-gray"
1638400
"medium-highlight-red"
3014656
"medium-highlight-green"
1441792
"medium-highlight-blue"
884736
"medium-gamma-gray"
65536
"medium-gamma-red"
48496
"medium-gamma-green"
36700
"medium-gamma-blue"
34734
"medium-negative"
1
"medium-name"
"Rossmann negative HR 100"
"medium-shadow-gray"
0
"medium-shadow-red"
458752
"medium-shadow-green"
65536
"medium-shadow-blue"
104857
"medium-highlight-gray"
1736704
"medium-highlight-red"
3801088
"medium-highlight-green"
1671168
"medium-highlight-blue"
1245184
"medium-gamma-gray"
65536
"medium-gamma-red"
35389
"medium-gamma-green"
28180
"medium-gamma-blue"
26869
"medium-negative"
1
and :HPColorLaserJetMFPM476dw(3DBC02).drc
:
"XSANE_DEVICE_RC"
"WSD:HP Color LaserJet MFP M476dw (3DBC02)"
"xsane-version"
"0.999"
"resolution"
75
"mode"
"Color"
"source"
"Flatbed"
"tl-x"
0
"tl-y"
0
"br-x"
13761367
"br-y"
19459342
"brightness"
0
"contrast"
0
"shadow"
0
"highlight"
6553600
"analog-gamma"
65536
"negative"
0
"xsane-main-window-x-position"
55
"xsane-main-window-y-position"
88
"xsane-main-window-width"
294
"xsane-main-window-height"
570
"xsane-project-window-x-position"
280
"xsane-project-window-y-position"
425
"xsane-standard-options-window-x-position"
414
"xsane-standard-options-window-y-position"
89
"xsane-advanced-options-window-x-position"
448
"xsane-advanced-options-window-y-position"
640
"xsane-histogram-window-x-position"
100
"xsane-histogram-window-y-position"
50
"xsane-gamma-window-x-position"
280
"xsane-gamma-window-y-position"
420
"xsane-batch-window-x-position"
480
"xsane-batch-window-y-position"
420
"xsane-preview-window-x-position"
940
"xsane-preview-window-y-position"
82
"xsane-preview-window-width"
600
"xsane-preview-window-height"
750
"xsane-gamma"
65536
"xsane-gamma-red"
65536
"xsane-gamma-green"
65536
"xsane-gamma-blue"
65536
"xsane-brightness"
0
"xsane-brightness-red"
0
"xsane-brightness-green"
0
"xsane-brightness-blue"
0
"xsane-contrast"
0
"xsane-contrast-red"
0
"xsane-contrast-green"
0
"xsane-contrast-blue"
0
"xsane-lineart-mode"
0
"xsane-threshold"
3276800
"xsane-threshold-min"
0
"xsane-threshold-max"
6553600
"xsane-threshold-multiplier"
65536
"xsane-threshold-offset"
0
"xsane-grayscale-scanmode"
""
"xsane-enhancement-rgb-default"
1
"xsane-negative"
0
"xsane-show-preview"
1
"xsane-enable-color-management"
0
"xsane-scanner-default-color-icm-profile"
""
"xsane-scanner-default-gray-icm-profile"
""
This third file has a number of settings that control the position and size of windows. For example I can move and resize the preview window by changing -preview-window-x-position
, -preview-window-y-position
, -preview-window-width
and -preview-window-height
. But the advanced options window only has position data and when I added line
"xsane-advanced-options-window-width"
250
it was ignored and removed from the file when I quit xsane. I still don't have an answer but I feel I have made some progress.
brett stevens
(101 rep)
Nov 27, 2021, 05:32 PM
• Last activity: Dec 4, 2022, 01:45 AM
0
votes
1
answers
134
views
Focus the first Window Where pcmanfm is Running
From the command line, what is the best way to locate the first window where `pcmanfm` is running, and then give that window focus? `pcmanfm` does not showcase it's application name on the title bar of the window in which it is running, so you can't focus it using `wmctrl -a pcmanfm` (which works fo...
From the command line, what is the best way to locate the first window where
pcmanfm
is running, and then give that window focus?
pcmanfm
does not showcase it's application name on the title bar of the window in which it is running, so you can't focus it using wmctrl -a pcmanfm
(which works for me in other applications that do indeed showcase their application's name in the window title bar).
This is just one example, but what I'm really looking for is a better method of locating windows that are running a particular command, and then giving that window focus. The title bar method I've been using just isn't always reliable.
Lonnie Best
(5415 rep)
Jan 18, 2022, 11:45 AM
• Last activity: Nov 11, 2022, 02:29 PM
1
votes
0
answers
162
views
List open windows and save to file(wmctrl) for latter recall
I am trying to get the list off open windows and save them to a file. The problem I have is that 'String' and 'List' are not compatible. I have tried various methods of joining the information together but with limited success. The included code has been cobbled together from the internet. ```string...
I am trying to get the list off open windows and save them to a file. The problem I have is that 'String' and 'List' are not compatible. I have tried various methods of joining the information together but with limited success. The included code has been cobbled together from the internet.
=' '.join([str(item) for item in line1])
Is the item that compiles and runs, when my program runs but it produces a single file with '0' in it, It should be like this sample output,
-1 991 1920 0 1920 1080 Main Desktop — Plasma
0x01800011 -1 991 0 0 1920 1080 Main Desktop — Plasma
0x01800019 -1 991 1920 1056 1920 24 Main Plasma
0x00400003 0 1156 880 154 800 600 Main NordPass Password Manager
0x03c0002c 0 1432 2101 56 1529 731 Main List open windows and save to file(wmctrl) for latter recall - Unix & Linux Stack Exchange — Mozilla Firefox
0x03a00003 0 3449 1959 622 1609 724 Main mwin1 - Scripts - Visual Studio Code
0x04c00006 0 4757 1073 608 760 437 Main Scripts — Dolphin
0x03c000a1 0 1432 2115 177 1529 731 Main 1 hidden tab - Workona — Mozilla Firefox
0x04e00007 0 6441 962 55 916 453 Main ~
I wish to write to a file and later read that information back.
from asyncio import create_subprocess_shell
from distutils.file_util import write_file
from fileinput import FileInput
import os
from re import X
import subprocess
def getwin():
line1=[os.system('wmctrl -p -G -l')]
string1=' '.join([str(item) for item in line1])
with open(r'winmove', 'w') as fp:
for i in line1 :
fp.write(string1) #line1
fp.close
if __name__ == '__main__':
getwin()
**I think the line "**
line1=[os.system('wmctrl -p -G -l')]
" **is not functioning right the items-/-are written to the console, however, if one adds lines to print the list to console**
print line1
then the line in the cli is 0.
Data
(11 rep)
Sep 24, 2022, 07:13 AM
• Last activity: Sep 25, 2022, 12:26 PM
2
votes
1
answers
462
views
Detecting when an X Window has been closed
I'm running `Ubuntu 20.04.5 LTS` with the `XFCE4` window manager. I'm looking for a way for a shell script to be fired off when a particular X Window has been closed. I know that I can create a program to run `wmctrl` or `xdotool` over and over again in a loop that checks for the existence of the X...
I'm running
Ubuntu 20.04.5 LTS
with the XFCE4
window manager.
I'm looking for a way for a shell script to be fired off when a particular X Window has been closed.
I know that I can create a program to run wmctrl
or xdotool
over and over again in a loop that checks for the existence of the X Window in question, and then executes a shell script when the presence of that X Window is no longer detected.
But I'm wondering whether there might be some sort of event-based utility that I can run which can do some or all of this for me, instead of my having to write this busy-wait-based program.
Any suggestions?
Thank you in advance.
HippoMan
(737 rep)
Sep 7, 2022, 10:07 PM
• Last activity: Sep 8, 2022, 09:59 AM
4
votes
2
answers
2284
views
Retrieve X11 window ID of a just-launched GUI-program
I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround: myprogram & sleep 1 winID=$(wmctrl -l | awk '/./{line=$0} END{print $1;}') But this relies on three heavy assumptions: - the program will take les...
I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround:
myprogram &
sleep 1
winID=$(wmctrl -l | awk '/./{line=$0} END{print $1;}')
But this relies on three heavy assumptions:
- the program will take less than 1 second to get its window opened (not to mention than 1 second can be far too long)
- the window will be appened at the end of the
wmctrl
list
- no other window will be opened meanwhile
Is there any signal myprogram
will send once it has opened a window? How can I intercept it?
iago-lito
(2931 rep)
Dec 17, 2014, 06:03 PM
• Last activity: Sep 3, 2022, 11:41 AM
0
votes
1
answers
1352
views
wmctrl Cannot get client list properties. (_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
On a fresh Arch Linux install running `ctwm`, if I do a simple `wmctrl -l`, I get Cannot get client list properties. (_NET_CLIENT_LIST or _WIN_CLIENT_LIST) I've done plenty of minimal Arch Linux installs, all basically the same, and I've never had this issue. The output is pretty vague to troublesho...
On a fresh Arch Linux install running
ctwm
, if I do a simple wmctrl -l
, I get
Cannot get client list properties.
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
I've done plenty of minimal Arch Linux installs, all basically the same, and I've never had this issue. The output is pretty vague to troubleshoot what is missing/wrong.
g0Brrrr
(17 rep)
Jun 11, 2022, 10:37 PM
• Last activity: Sep 3, 2022, 07:17 AM
3
votes
3
answers
496
views
AWK - Dealing with spaces in the last column of output from wmctrl
As a first project for learning [awk][1], I wanted to reformat the output of the [wmctrl][2] command, which can be installed like this in Debian 11: sudo apt install wmctrl To list information about all the windows I have open, I run this command: wmctrl -lpG Sample Output: 0x0120002b 4 7 2 157 3836...
As a first project for learning awk , I wanted to reformat the output of the wmctrl command, which can be installed like this in Debian 11:
sudo apt install wmctrl
To list information about all the windows I have open, I run this command:
wmctrl -lpG
Sample Output:
0x0120002b 4 7 2 157 3836 2068 my-pc window - AWK - Dealing with spaces in the last column of output from wmctrl - Unix & Linux Stack Exchange — Firefox
I never can remember what each column means, in the command above, so I wanted to break it apart into name/value pairs, using AWK:
wmctrl -lpG | awk '{print "----------------------\nWindow ID: " $1 "\nDesktop Number: " $2 "\nProcess ID: " $3 "\nx-offset: " $4 "\ny-offset: " $5 "\nwidth: " $6 "\nheight: " $7 "\nMachine Name: " $8 "\nWindow Title: " $9}'
Sample Output:
----------------------
Window ID: 0x0120002b
Desktop Number: 4
Process ID: 7
x-offset: 2
y-offset: 134
width: 3836
height: 2068
Machine Name: my-pc
Window Title: window
Desired Output:
----------------------
Window ID: 0x0120002b
Desktop Number: 4
Process ID: 7
x-offset: 2
y-offset: 134
width: 3836
height: 2068
Machine Name: my-pc
Window Title: window - AWK - Dealing with spaces in the last column of output from wmctrl - Unix & Linux Stack Exchange — Firefox
However, I'm having trouble figuring out how to handle the **9th Column** outputted by
wmctrl -lpG
(because the 9th column contains spaces). Notice that I'm only getting the **first word** of the window title **instead of the whole window title**.
Is there an easy way to remedy this issue?
Lonnie Best
(5415 rep)
Dec 27, 2021, 10:07 PM
• Last activity: Dec 28, 2021, 07:49 PM
0
votes
2
answers
181
views
List Running Commands of All Windows
You can list the process ID of each widow with this command: wmctrl -lp Does there exist a command that shows the `running command` of each window (kind of like htop has a column for "Command")? If not, how could you combine commands to ultimately achieve this?
You can list the process ID of each widow with this command:
wmctrl -lp
Does there exist a command that shows the
running command
of each window (kind of like htop has a column for "Command")?
If not, how could you combine commands to ultimately achieve this?
Lonnie Best
(5415 rep)
Dec 22, 2021, 02:49 PM
• Last activity: Dec 22, 2021, 03:36 PM
5
votes
2
answers
11125
views
How to minimize an application window from command line
I have a startup application that has no option to "start minimized" or "close to system tray" etc. and therefore would like to use a startup script that will first start the application and then minimize its window. Actually, I already have a startup script that closes the window of an application...
I have a startup application that has no option to "start minimized" or "close to system tray" etc. and therefore would like to use a startup script that will first start the application and then minimize its window.
Actually, I already have a startup script that closes the window of an application which luckily has a sort of "close to system tray" option:
wmctrl -ic $(wmctrl -l | grep "AppWindowTitle" | cut -d ' ' -f 1)
I should ideally be able to minimize the window with a command like this:
wmctrl -ir $(wmctrl -l | grep "AppWindowTitle" | cut -d ' ' -f 1) -b toggle,minimized
But there is not such option available in
wmctrl
. Options for the first argument are: add
, remove
, toggle
. And options for the second argument are: modal, sticky, shaded, skip_taskbar, skip_pager, hidden, fullscreen, above, below, maximized_vert, maximized_horz
These seem to work and I would expect the argument hidden
could be the one I need but it's not hiding the window.
I wonder if there's some other way of achieving this...
Sadi
(515 rep)
Jan 22, 2020, 02:29 PM
• Last activity: Jul 22, 2021, 09:48 AM
Showing page 1 of 20 total questions