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
15 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 ...
user avatar
  • 4,311
1 vote
1 answer
140 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 ...
user avatar
3 votes
3 answers
246 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 ...
user avatar
  • 4,311
0 votes
2 answers
34 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"...
user avatar
  • 4,311
0 votes
0 answers
65 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 ...
user avatar
2 votes
2 answers
946 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 ...
user avatar
  • 31
3 votes
1 answer
428 views

How to get the url from current tab of firefox by help of wmctrl?

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 ...
user avatar
1 vote
0 answers
398 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 ...
user avatar
  • 11
0 votes
1 answer
409 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 ...
user avatar
0 votes
1 answer
71 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?
user avatar
1 vote
2 answers
433 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 $(...
user avatar
0 votes
0 answers
92 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 ...
user avatar
  • 11
0 votes
1 answer
336 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), ...
user avatar
1 vote
0 answers
127 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 ...
user avatar
  • 259
0 votes
1 answer
83 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 =...
user avatar
  • 1,614
0 votes
1 answer
260 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
4 votes
2 answers
5k 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 ...
user avatar
  • 399
2 votes
1 answer
100 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 ...
user avatar
1 vote
0 answers
145 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 ...
user avatar
  • 13
2 votes
1 answer
2k 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 │...
user avatar
2 votes
1 answer
1k 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, ...
user avatar
0 votes
1 answer
305 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 ...
user avatar
-1 votes
1 answer
86 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. ...
user avatar
0 votes
0 answers
166 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 ...
user avatar
  • 423
1 vote
0 answers
141 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 ...
user avatar
6 votes
1 answer
615 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 ...
user avatar
  • 161
4 votes
1 answer
300 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 ?
user avatar
2 votes
0 answers
561 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 ...
user avatar
  • 1,458
5 votes
1 answer
953 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 ...
user avatar
15 votes
1 answer
10k 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 ...
user avatar
  • 2,321
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.
user avatar
1 vote
0 answers
196 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 ...
user avatar
  • 11
1 vote
2 answers
130 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 ...
user avatar
0 votes
1 answer
81 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 ...
user avatar
  • 1
2 votes
0 answers
69 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 '...
user avatar
  • 801
1 vote
0 answers
261 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 ...
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 "...
user avatar
  • 149
1 vote
2 answers
233 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 ...
user avatar
8 votes
3 answers
7k 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 ...
user avatar
  • 2,417
3 votes
1 answer
4k 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, ...
user avatar
  • 303
5 votes
1 answer
1k 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 | ...
user avatar
  • 2,271
1 vote
1 answer
826 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 ...
user avatar
1 vote
1 answer
297 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 ...
user avatar
  • 1,709
1 vote
3 answers
2k views

WMCTRL not working after starting xfce4-terminal

If I type these two commands in a terminal: xfce4-terminal --hide-menubar --hide-borders --hide-toolbars --title=dt wmctrl -r dt -e 0,10,10,720,720 I get the desired result (position and resize of ...
user avatar
  • 3,295
7 votes
1 answer
4k views

Resizing a maximized window from the command line

The following script fails to resize an already maximized window: wmctrl -i -r :ACTIVE: -b remove,maximized_vert,maximized_horz xdotool windowunmap --sync xdotool windowmap --sync wmctrl -r :ACTIVE:...
user avatar
  • 1,709
0 votes
1 answer
275 views

Wmctrl Resizing Issue

The following fails to resize my active window (simply nothing happens). Is there something I'm missing? The command I used is: wmctrl -r -e :ACTIVE: 0,100,100,600,400
user avatar
  • 1,709
1 vote
1 answer
886 views

call a script if a zenity window is minimized, resized or moved

I would like to add an event-catcher, if my the zenity window gets minimized, resized or moved. I already call a script if the window is closed or the button is pressed in my typebreak script But I ...
user avatar
  • 24.6k
1 vote
2 answers
463 views

Get report of the gui application processes

I want to list main applications processes report in this format ps -e -o pid,comm,pmem,pcpu,uname To filter main GUI applications wmctrl -pl is the only way I can get processes ids.its great if ...
user avatar
5 votes
1 answer
6k views

How to move a window to a different workspace using its ID, in bash?

Currently I have successfully used wmctrl -r :SELECT: -t 2 but something like wmctrl -r -i 0x03e00003 -t 2 does not work. How should I write the command in order to select the window to be moved ...
user avatar
  • 53