Score:0

How to determine whether a process is running or not in the current workspace to make a conditional shell script?

us flag

This is more like a follow up of this thread here.

I'm using i3-tiling window manager and I'm trying to figure out if a Firefox instance is running IN A SPECIFIC WORKSPACE or not.

Now,

pgrep -x firefox works flawlessly it really only tells you that if a program is running and not much about where it is running, or in which workspace is it running?

Is there any way for me to do that?

Score:0
cn flag

The second column of the command wmctrl -lx indicates the workspace the window is currently on. The -x switch also shows the window class. This provides you all information needed to determine whether one or more windows of a certain application are open in a specific workspace. Note that wmctrl starts counting from 0 to denote the first workspace.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.