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
5
  • 5
    Searching through all the .desktop files in /usr/share/applications would be a good start.
    – Byte Commander
    Sep 16, 2016 at 23:23
  • Related: How does Unity's dash index and search work?
    – guntbert
    Sep 17, 2016 at 10:09
  • find <where> -name <what> 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, 2016 at 5:24
  • This question might be a better fit for softwarerecs.stackexchange.com
    – Elder Geek
    Sep 27, 2016 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. Sep 27, 2016 at 16:57

2 Answers 2

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.

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.

You must log in to answer this question.

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