10

Sometimes, I login remotely via ssh to my remote desktop and I would like to call a GUI application through ssh, to remotely display it on my laptop.

However, I do not know what the binary name is, since I usually call applications from the dash using generic terms.

Is there a commande line (CLI) interface where it would be possible, in a terminal, to perform a search in Unity Dash and obtain in the result list the application names and path to their executable commands?

I would like something like:

# dash --search "disks"
Name         Executable
Disks        /usr/bin/gnome-disks

2 Answers2

2

Here is a script that might be helpful:

#!/bin/bash
for desktopFile in $(grep -irl "$1" /usr/share/applications/) ; do 
  grep --color=never 'Name=' "$desktopFile" 
  grep --color=never 'Exec=' "$desktopFile" 
  echo ''
done

Assuming you saved it as "searchapps", this is what it does:

$ searchapps disks
Name=Disk Image Writer
Exec=gnome-disks --restore-disk-image %U

Name=Disks
Exec=gnome-disks

Note that there might be other folders you'd like to search in addition to /usr/share/applications. You'd have to modify the script accordingly.

derHugo
  • 3,356
  • 5
  • 31
  • 51
Thomas W.
  • 480
0

A convenient alternative is to open /usr/share/applications with your favourite file browser (nautilus in standard Ubuntu, pcmanfm in Lubuntu, thunar in Xubuntu ...) and simply double-click on the icons you find there in order to start your program.

nautilus --no-desktop /usr/share/applications &

pcmanfm /usr/share/applications &

thunar /usr/share/applications &

I tested this in a terminal window with remote access via

ssh -X user@IP-adress

and it works for me.

sudodus
  • 46,324
  • 5
  • 88
  • 152