Ubuntu – Commands for quicklists

launcherquicklistsubuntu-tweakunity

I am using Unity. The Quicklists feature is really useful. I added some entries in the nautilus quicklist from Ubuntu Tweak. Those commands were easy to figure out.
But now i do not know how to find the commands that should be used to add a quicklist.
Every app has different way of a command.

For example:

While nautilus commands are like- nautilus /home/username/Music.
Chrome commands are completely different. like this- /opt/google/chrome/google-chrome

Now how do i figure out them for applications which do not have any by default?

Best Answer

it is very easy

[NewIncognito Shortcut Group]
Name=New Incognito Window
Exec=/opt/google/chrome/google-chrome --incognito
TargetEnvironment=Unity

you must add a line like this

X-Ayatana-Desktop-Shortcuts=XXXXX;XXXXX;XXXXX here XXXXX is name in [ ] except Shortcut Group

now for example,

you can give any name in between [ ] like here is NewIncognito Shortcut Group. but you must write Shortcut Group after name. it means that you can give any name in [NewIncognito Shortcut Group] in place of NewIncognito only.

Name= Can be anything but meaningful to know what it does.

Exec= is path to that executable(only if the directory is not in PATH variable) file like Exec=/opt/google/chrome/google-chrome

now the actual thing which is main thing for all this fuzz is parameter passed while opening the executable. here it is --incognito.

You always know which executable you want to start but your main problem is

Which parameter to use? or how do I know to use this one or that one?

just open terminal cd(no need to cd to dir if it's in your PATH variable) to directory where your executable is located.

now write name of your executable file(here is google-chrome) and then write --help. so You would type

google-chrome --help

this will show you different options or parameters which can be passed and other info about them. here is output

OPTIONS
       Google  Chrome has hundreds of undocumented command-line flags that are
       added and removed at the whim of the  developers.   Here,  we  document
       relatively stable flags.

   --user-data-dir=DIR
          Specifies  the directory that user data (your "profile") is kept
          in.  Defaults to ~/.config/google-chrome .   Separate  instances
          of  Google  Chrome  must  use  separate  user  data directories;
          repeated invocations of google-chrome  will  reuse  an  existing
          process for a given user data directory.

   --app=URL
          Runs URL in "app mode": with no browser toolbars.

   --incognito
          Open in incognito mode.

   --version
          Show version information.

this output is very long and i should not paste all here.

google-chrome --help opens manpage actually. but most of the time only text output is given in terminal.

lets take example of banshee

if you run banshee --help it give something like

Usage: banshee [options...] [files|URIs...]

Help Options

  --help                   Show this help
  --help-playback          Show options for controlling playback
  --help-query-track       Show options for querying the playing track
  --help-query-player      Show options for querying the playing engine
  --help-ui                Show options for the user interface
  --help-debug             Show options for developers and debugging
  --help-all               Show all option groups
  --version                Show version information

they have divided help category wise. Now I want to know options for playback so I will type

banshee --help-playback

which shows,

Playback Control Options

  --next                     Play the next track, optionally restarting if the
                             'restart' value is set

  --previous                 Play the previous track, optionally restarting if
                             the 'restart value is set

  --restart-or-previous      If the current song has been played longer than 4
                             seconds then restart it, otherwise the same as
                             --previous

  --play-enqueued            Automatically start playing any tracks enqueued on
                             the command line

  --play                     Start playback
  --pause                    Pause playback
  --toggle-playing           Toggle playback
  --stop                     Completely stop playback
  --stop-when-finished       Enable or disable playback stopping after the
                             currently playing track (value should be either
                             'true' or 'false')

  --set-volume=LEVEL         Set the playback volume (0-100), prefix with +/-
                             for relative values

  --set-position=POS         Seek to a specific point (seconds, float)
  --set-rating=RATING        Set the currently played track's rating (0 to 5)

Now you know how to make it play next or previous or pause. So you can create entries like

Exec=banshee --next for next song

Exec=banshee --pause to pause song

Exec=banshee --previous to Play the previous track

Related Question