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
Hans Deragon
  • 383
  • 1
  • 3
  • 16
  • 5
    Searching through all the `.desktop` files in `/usr/share/applications` would be a good start. – Byte Commander Sep 16 '16 at 23:23
  • Related: [How does Unity's dash index and search work?](http://askubuntu.com/q/37814/117103) – guntbert Sep 17 '16 at 10:09
  • `find -name ` for example `find /etc -name libgtk`. I think there is also a locate program but that may need to be installed before you can use (sorry I'm not at my *nix box right now) – GrannySez Sep 20 '16 at 05:24
  • This question might be a better fit for http://softwarerecs.stackexchange.com/ – Elder Geek Sep 27 '16 at 13:34
  • Elder Geek, I am not asking for an alternative for Dash, I am asking if a specific feature exists within it. It is thus not related to software recommendation. – Hans Deragon Sep 27 '16 at 16:57

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,306
  • 5
  • 30
  • 49
Thomas W.
  • 430
  • 5
  • 21
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
  • 45,126
  • 5
  • 87
  • 151