1

I've just been through the massive long process this morning of trying to identify a running application. It was for the purpose of reporting a bug this morning, but I ended up posting a question about it to AskUbuntu instead.

I fluked finding the answer this time.

I tried starting gnome-system-monitor (published name: "System Monitor"), but I couldn't work out which was the application I was looking for.

I tried going to the application's menu > About but is doesn't show the actual name of the application there. Here's a screenshot of gnome-software > About, which only shows the published name of "Ubuntu Software". Ubuntu Software > About

I did a web search for "ubuntu software" to see if any search results showed the name of the application. I found a Wikipedia page that says "Development was ended in 2015 and in Ubuntu 16.04 LTS it was replaced with GNOME Software instead". I followed the link to GNOME Software but the name of the application is not shown there either.

Therefore I wasn't able to report the bug, so I came to AskUbuntu. I did a search for "ubuntu software" and saw the name "gnome-software" somewhere.

I opened a terminal, used the command gnome-software, and the correct application started.

I ended up asking a question in AskUbuntu instead of reporting the bug. However, I have had this same problem many times over the last 10 years or so, and I would dearly like to solve it once and for all.

Is there a quick and easy way to identify the actual name of a currently running application?

PS This question was marked as a duplicate "This question already has an answer here: How do I determine an application's process name? 1 answer", which effectively answers "No" to my question "Is there a quick and easy way to identify the actual name of a currently running application?", but in actual fact the answer I received from @waltinator seems to provide a method (via xprop command).

0

3 Answers 3

2

Use xwininfo (see man xwininfo), from the x11-utils package. To demonstrate, I ran xwininfo -all in a terminal window, and following the prompt, clicked on this window. The first part of what it said is:

$ xwininfo -all

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x4600007 "unity - How can I find out what app is running (actual name, not published name)? - Ask Ubuntu"

  Root window id: 0x7d (the root window) "QupZilla"
  Parent window id: 0x2403a37 (has no name)
     1 child:
     0x4600008 (has no name): ()  1x1+-1+-1  +65+51

  Absolute upper-left X:  66
  Absolute upper-left Y:  52
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1696
  Height: 1148
  Depth: 24
...

There are also xlsclients and xprop (see the man page) that may be of use.

1
  • Ah ha! xwininfo doesn't name the process. xlsclients is more useful, giving a list of possible candidates. xprop seems to be what I'm looking for. Oct 9, 2016 at 0:42
2

As far as I know there is no default way to do this.

On the command line you can use xprop to get information about a window (the cursor will change and you are expected to click on the window).

The output usually has a line starting with _NET_WM_PID that contains the PID of the program, and you can use e.g.

ps -o comm -p THE_PID

to find the program's command.

You can put this all together in a shell script and use zenity for a graphical display:

#!/bin/sh
zenity --info --text "$(ps --no-headers -o comm -p $(xprop | awk '/^_NET_WM_PID/ {print $3}'))"

Save this somewhere as a file, make it executable and assign a hotkey to it.

I guess there are some cases where it doesn't work or displays a wrong result but usually it should be at least helpful.

2
  • yuk That's at least a 4-step process Oct 8, 2016 at 3:50
  • I see now that the second sentence of your answer seems to be the answer to my question. Thanks. Oct 9, 2016 at 1:07
1

Try

grep -i "access prompt" /usr/share/applications/*.desktop
/usr/share/applications/gcr-prompter.desktop:Name=Access Prompt

In this example, the application's "common" name is Access Prompt and the name that shows up in the output of something like ps -o pid,ppid,stime,time,command -u $USER is gcr-prompter.

This approach has two limitations:
- it only looks in /usr/share/applications (because that's where most .desktop files are found). But some .desktop files may only be in ~/.local/share/applications.
- depending on how you define a "application", some applications may not have a .desktop file. In such cases, the application's "common" name and actual name will be the same.

1
  • yuk Not all-encompassing enough. ie. it will sometimes work, and sometimes not. Oct 8, 2016 at 3:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .