Is there a linux command to determine the window IDs associated with a given process ID?

Given a process iD of XX, I'd like to have a list of any window id's where _NET_WM_PID = XX. Even better would be the oldest still active window id if possible. I'm very new to linux, but what...

Open applications in different workspaces in Gnome

Given my laziness, I tried to write a bash script that opens at once some daily apps in different desktops. This script should work in Gnome. I've written that so far: #!/bin/bash firefox...

using wmctrl to close windows

Can I close a window using wmctrl that is running in wine on Ubuntu? For context: $ wmctrl -m Name: compiz Class: N/A PID: N/A Window manager's "showing the desktop" mode: OFF Also: $ wmctrl...

Starting a process in Python and retrieving its window ID

Let's say I run: import subprocess; P = subprocess.Popen(['gnome-terminal'); I then get an object P of the class Popen: <subprocess.Popen object at 0xb72a9d0c> How can I then retrieve the...

How to emulate Matlab’s Run command (F5) from within Vim?

I’m using Linux and gVim/Vim as an external editor for Matlab. In Matlab editor you can run a file by pressing F5. I’m trying to reproduce this in Vim (installed from the gvim-gtk Debian...

Cycle through windows of the same application using wmcrtl

I am configuring xbindkeys to change window focus using shortcuts. For example, I managed to create a shortcut to focus on a an application window, let's say a terminator window: wmctrl -xa...

Linux : Get window border height

I try to get in a bash script the maximal size of a window (i.e. the size of the screen minus the panels on the edges of the screen). I am using Kubuntu but if it could work for any linux system...

How to move or resize X11 windows (even if they are maximized)?

I want to change position of a window. My problem is that the window can be maximized, this does not allow to change its size and location (window can belong to any application). I use KDE4. I...

Get number of opened application windows in linux

I want to detect how many instances of a specific application, managed by the window manager, are opened. At the moment, I have this: #!/bin/bash # wmctrl required pids=$(pidof $1) IFS=' ' read...

Programmatically hide/show a window in Linux

I've been searching all over the place for a solution to this. How can I show/hide (or minimize/unminimize if you rather) Linux windows. I'm interested in any solution in any language. I use...

how do you get window ID for xdotool automatically

I am trying to automate testing forms that selenium would take too long (javascript heavy modern forms), and I want to use xdotool and get window IDs. I see you can call xdotool selectwindow and...

Get window list sorted by most recent access bash

I know you can do wmctrl -l to list all open windows with their ids. I would like to have this list sorted by most recent access (the same order as when you do Alt+Tab), is they any way with...

Xvfb - start or attach a window manager to xvfb

For testing purpose, I used Xvfb. Today, I want to do some test with wmctrl commmand. I do some test in python like this : display = ":99" pXvfb = subprocess.Popen(["Xvfb", display,...

java and wmctrl to resize windows

I'm writing a library to cover WMctrl shell program. I have problem with resizing windows: String command = "wmctrl -r \"Calculator\" -e 0,100,100,500,500"; System.out.println(command); String...

Get URL of currently active chromium or chrome tab from external process

How can I get the current chromium tab URL from an external process in linux programmatically? There are many similar questions to this one, but I haven't found any with the following...

wmctrl: moving a fullscreen window

A small shell script should fix my ghosting-screen problem. I'm trying to move each window just 1px in a certain direction and in the following second it should do a move in the other direction...

How to Switch Focus to a Gnome Terminal Tab via Script or Shell Command

I am currently writing a script to open several tabs in gnome-terminal, and set their titles. I can open multiple tabs, but I need to change focus to those tabs (programatically) in order to set...

Google API Python Client: "from six.moves import zip ImportError: No module named moves"

I am trying to use the Google Sheets API in my Python 2.7 code using the googleapiclient but I get the following error: "from six.moves import zip ImportError: No module named moves ". I am using...

How to attach and detach an external app with PyQT5 or dock an external application?

I'm developing an GUI for multi-robot system using ROS, but i'm freezing in the last thing i want in my interface: embedding the RVIZ, GMAPPING or another screen in my application. I already put...

opencv - how to do a template match without scale?

I am trying to match playing cards. I assumed since the cards are all unique a template match might be the right way to go. I have the templates(images) in a folder, these are just the card. Now...

Docker: File (bootstrap.sh) not found in docker image while running container. Although file is present in image

I have created an image to run docker container with chrome. Below is my code. My dockerfile does compile into image. But whenever I try to run container from image I get error "Bootstrap.sh file...

Python can't find tkinter item at coordinates

I have this code: for item in items: print ( "Item: ", item, mycanvas.coords (item) ) print ("Item at 26.0, 188.0 ", mycanvas.find_closest(26.0, 188.0)) print ("Item at 998.0, 594.0 ",...

Linux: Loop that read a url from a file, open it from command line, then wait a specified time, then close web browser

I want to create a bash script that read a URL from a file, open it in a browser, wait a specific time and then close it and repeat the process. Here is the code that I have written but it only...

DjangoCMS TypeError: from_db_value() missing 1 required positional argument: 'context' after upgrade to 3.7.2 w/ Django 3.0.1

I had a working DjangoCMS application running DjangoCMS 3.7.1 and Django 2.2, however after I just bumped the DjangoCMS version to 3.7.2 and with it, Django to 3.0.1, I am now getting a render...

How can I subscribe (line by line) to the output of a blocking shell command in Clojure?

Basically, I want to capture the first line of output (FIFO) of a shell command in some sort of object, whether an atom or a chan. I've looked at core.cache and core.async, but I've yet to find...

Why do multiple windows of some applications share same pid?

Two windows of 'mousepad' (executed by different terminals), for instance, share same pid. There is only one entry in "ps -e | grep mousepad" and "wmctrl -p -l" indicates that the two windows have...

how to list windows per KDE/Plasma5 Activity

I am trying to write a script that launches an app if not running or activates the window if already visible in the current activity. Using xdotool or wmctrl I am able to get the list of windows...

pyproject.toml not found when using Poetry in Tox' parallel execution

I tried to switch a Python package of mine from setuptools to Poetry. Since I use Tox to orchestrate my test suite (with linters), I had to adapt my tox.ini as well. A minimal configuration of Tox...

How can I query the number of the virtual desktop on which the bash script is running in Linux Mint via bash?

Environment: Linux Mint, Cinnamon desktop manager, with multiple workspaces=virtual desktops, e.g. 4. Bash script What is known: How to determine the number of workspaces: wmctrl -d | wc...

How to open a program by bash script direct on a workspace which is not the most active workspace

How to open a program by bash direct on a workspace = virtual desktop, which is specified by number. Environment: Linux Mint, Cinnamon desktop manager bash Program which should be open by bash...