Skip to main content

Questions tagged [wmctrl]

wmctrl is a command for EWMH- and NetWM-compatible X Window managers on Linux systems. It can be used to control windows by their characteristics on workspaces and on external displays.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

`wmctrl -d` fails immediatly after login? (Gnome, Wayland)

I'm using wmctrl -d in my scripts, to open vim servers specific to each desktop. I noticed that it fails: > wmctrl -d Cannot get current desktop properties. (_NET_CURRENT_DESKTOP or _WIN_WORKSPACE ...
Rmano's user avatar
  • 3,425
2 votes
1 answer
42 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 ...
Stephen Boston's user avatar
1 vote
0 answers
137 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 ...
Data's user avatar
  • 11
2 votes
1 answer
242 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 ...
HippoMan's user avatar
  • 627
5 votes
2 answers
5k 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 ...
Ashark's user avatar
  • 959
0 votes
1 answer
934 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 ...
g0Brrrr's user avatar
  • 17
0 votes
1 answer
100 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 ...
Lonnie Best's user avatar
  • 5,165
2 votes
1 answer
614 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 ...
Tom LInk's user avatar
3 votes
3 answers
446 views

AWK - Dealing with spaces in the last column of output from wmctrl

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 ...
Lonnie Best's user avatar
  • 5,165
0 votes
2 answers
163 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"...
Lonnie Best's user avatar
  • 5,165
1 vote
1 answer
405 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 ...
brett stevens's user avatar
11 votes
2 answers
4k 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 ...
academo's user avatar
  • 169
5 votes
3 answers
2k 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 ...
Alfred.37's user avatar
  • 118
1 vote
1 answer
1k 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 ...
dulek's user avatar
  • 11
0 votes
1 answer
771 views

Ubuntu: XFCE: Is there a workaround for swiching to IntelliJ IDEA with wmctrl after IDEA removed "IntelliJ" from the `window title`?

I have shortcut keys setup that take the focus to a certain application in my Xubuntu setup. So e.g.: START+1 takes me to my main web browser window START+2 takes me to my main Sublime window START+3 ...
Michał Lepczyński's user avatar
0 votes
1 answer
225 views

How to use I3 instances

I know I can use assign with instance like this: assign [instance="main terminal"] $ws2 But, how can I start an application and assign it a certain instance name?
Adrian Lopez's user avatar
1 vote
2 answers
1k views

How can I use wmctrl to check if a certain WM_ICON_NAME(STRING) exists?

I'm using I3 and I use WM_ICON_NAME(STRING) to identify my windows. I'm looking for something similar to this, but with WM_ICON_NAME(STRING). It is possible to achieve this? Thank you. if test $(...
Adrian Lopez's user avatar
0 votes
0 answers
287 views

Read text of a open window in a linux shell

i have a little script that runs commands depending on the title of opened windows. I read that titles using wmctrl -l Some of the window titles are very general. Can i read the window text using the ...
o. kahn's user avatar
  • 21
0 votes
1 answer
643 views

how to let xterm have geometry of 80x1 after disabling decorations?

I use this to toggle-decorations: https://gist.github.com/muktupavels/d03bb14ea6042b779df89b4c87df975d if I start xterm -geometry 80x1 it will have 1 height (in xterm TEXT lines, not in screen dots), ...
VeganEye's user avatar
2 votes
0 answers
204 views

Xfce: launching a program on another desktop without wmctrl

Running in Xfce with several desktops defined, I want to launch a program and have it start in a desktop that's different from the one which has the current focus. I know how to write script which ...
HippoMan's user avatar
  • 627
0 votes
1 answer
291 views

Open and position (duplicative) windows within GNOME from a script

This question shows how one can address a window by it's title, and then position/resize it around. Now to address a window there are five options: - The window's ID: Changes on application restart =...
confetti's user avatar
  • 2,004
0 votes
1 answer
501 views

Inconsistent behavior of wmctrl in maximizing terminal from .bashrc

I've got this wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz inside my .bashrc in order to maximize my terminal upon opening. The odd thing is that it seems to work only randomly, sometimes ...
user avatar
5 votes
2 answers
9k 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 ...
Sadi's user avatar
  • 495
2 votes
1 answer
289 views

FvwmCommand WindowList - get layer information

I'm trying to get information about running windows with all the information that is shown in the menu of "FvwmCommand WindowList" output. (Redhat Linux 7) The problem with this command is that it ...
Aakash Rayate's user avatar
2 votes
0 answers
304 views

wmctrl showing and hiding tray programs

Hello there im trying to make my onboard hide/show with a keyboard shortcut (i know ironic, please don't ask why) however i couldn't find a way to do it in their manual, it only shows programs that ...
Y. Sasy's user avatar
  • 23
3 votes
1 answer
6k views

How to resize and move a window by its PID using `wmctrl`?

I am using a 21:9 Monitor and wrote a script to tile/align my windows to the left, centre and right side of the monitor, using keyboard-shortcuts: ┌─────────┬─────────┬─────────┐ │ window1 │ window2 │...
PatrickSteiner's user avatar
3 votes
1 answer
2k views

Is it possible to move window out of the screen border?

So I'm currently moving application Windows with wmctrl but I can't move a window outside the screen's border. Not talking about moving outside top left corner which we can't even acheive it by mouse, ...
Andrew.Wolphoe's user avatar
0 votes
1 answer
454 views

How to activate most recently focused app window in xfce4/xfwm4?

I use my function keys for specific applications (F1 chrome, F2 terminal, etc). I have a script bound to a shortcut key to activate the right application, and that works, but it doesn't activate the ...
Peter Lyons's user avatar
-1 votes
1 answer
98 views

Constantly update .txt file with title of a window in Linux?

I have an application with a window title that, every second, I want to update a .txt file with that window title. I have been trying to pull this off in bash with wmctrl -l, but I can't get anywhere. ...
RobotUnderscore's user avatar
0 votes
0 answers
193 views

move from one xterm and back again using wmctrl

I'm running fvwm and have multiple virtual desktops open. I'd like to be able to write a bash script that would take me from one xterm to another---this part is easy, using wmctrl -a ---and then back ...
Leo Simon's user avatar
  • 453
1 vote
0 answers
182 views

How to superimpose window on panel bar

Fullscreen mode allows a window to cover the whole screen (hence its name), even over the panel bar. How can this be done for a window without entering the fullscreen mode? Assuming a panel bar on ...
nightcod3r's user avatar
9 votes
2 answers
919 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 ...
Raif's user avatar
  • 191
4 votes
2 answers
394 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 ?
Michal Przybylowicz's user avatar
2 votes
0 answers
1k views

How to launch an application as a dock on openbox

If i do obxprop|grep dock and click on gnome-panel for example, my result is : _OB_APP_TYPE(UTF8_STRING) = "dock" For the rest, it's : _OB_APP_TYPE(UTF8_STRING) = "normal" How can i force a ...
bob dylan's user avatar
  • 1,892
5 votes
1 answer
2k views

Command-line tool to get "click and drag" rectangle coordinates from the screen [duplicate]

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, ...
user avatar
2 votes
5 answers
2k views

Getting just the application name from wmctrl -l

I am trying to just get the application name out of this code: wmctrl -l but I don't know how to do it! If you could please explain how I could do this, that would be great. EDIT: The output of ...
MaliciouZzHD's user avatar
16 votes
1 answer
13k views

How to customize window tiling zones/grid?

In Cinnamon, pressing super+arrow keys (or other similar shortcut) resizes current window into a tile (snaps to grid). How can I customize this grid? For example I would like to split screen into 3 ...
Jan Warchoł's user avatar
  • 3,141
1 vote
1 answer
1k views

Sending key with wmctrl

Is it possible using wmctrl to send keystrokes to a window? I know it's possible by using xdotool. Both tools are very similar, so maybe I missed something when I read the man pages for wmctrl.
Hölderlin's user avatar
  • 1,186
1 vote
0 answers
290 views

How to run program from specific viewport (not how to move it there)

Is there a way to run a program from a specific viewport (monitor)? All explanations I found, were about moving a window after it has been created, which is not what I am trying to do. Why: I have ...
Armin's user avatar
  • 11
1 vote
2 answers
146 views

How to move windows of dimension range to Workspace 2?

I have many figures of widthxheight (550-570)x(465-486) at the southwest logically set there by Matlab's movegui() function. I would like to open all those southwest windows of the size range in an ...
Léo Léopold Hertz 준영's user avatar
0 votes
1 answer
87 views

Creating a specific chrome window and use it as drop-down search window

I am using a simple script runs as "toggle.sh process1" which toggles visibility of process1 if it exists and if it doesn't exist then it launches process1. It is really simple but useful. I use it ...
ilker's user avatar
  • 1
2 votes
0 answers
72 views

stopping terminal command gnome-open from opening files as maximised

when I use the terminal command 'gnome-open' for opening files it causes them to always open as maximised, this is a problem because in its maximised form I can't change its position and size using '...
Giles's user avatar
  • 887
1 vote
0 answers
403 views

Simplest way to tell if a GTK application (e.g. Firefox) is fully loaded and ready, in order to maximize it

In Linux kiosks, in order to reset some applications'state "behind the scenes" (while the screensaver blanks the screen), I use a BASH script which among other things calls wmctrl, with the task of ...
Edgar Grill's user avatar
2 votes
0 answers
1k views

How to change title of active window using wmctrl

I'm using fluxbox window manager and recently I've added "always on top" shortcut to my "keys" file. Mod1 a :ExecCommand wmctrl -r :ACTIVE: -b toggle,above But I'd like to know if window state is "...
gosu94's user avatar
  • 149
1 vote
2 answers
449 views

How are window-ids given out by MATE window manager?

While trying to write a script involving wmctrl ( since MATE on LMDE 2 doesn't offer as many advanced features as other WM configurations involving Compiz, which I don't have on LMDE 2), I came across ...
polynomial_donut's user avatar
8 votes
3 answers
8k views

How can I automate window tiling with a custom width? (Cinnamon)

I am running Linux Mint 17 Cinnamon 2.4.8. I really like xdotool, but it conflicts with Cinnamon's awesome snapping/tiling feature. If I run the following command, it does NOT work if the current ...
TuxForLife's user avatar
  • 2,959
3 votes
1 answer
5k views

Stretch window over two monitors with "gap" in between

I have a dual monitor setup with Compiz as window manager on Ubuntu 14.04. I can resize a window to stretch over both windows. However, while the physical display panels are a few centimeters apart, ...
Thomas W.'s user avatar
  • 323
4 votes
2 answers
2k 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 | ...
iago-lito's user avatar
  • 2,811
1 vote
1 answer
901 views

how to determine in what viewport (compiz/unity) a window is placed?

I am writing a script that requires determining in what viewport a window is placed. My desktop is 2x2 (4 viewports); it is usually thought as being 4 virtual desktops but on compiz/unity, it is ...
Aquarius Power's user avatar
1 vote
1 answer
399 views

Opening a window in a specific workspace?

In Ubuntu 14.04, is it possible (perhaps using wmctrl?) to activate an instance of a window in a specific workspace? Example: Suppose I'm in workspace 1, and I have a google-chrome window open in ...
George's user avatar
  • 1,809