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
Command line
grep ^Name= /usr/share/applications/* | sed 's/:Name=/ /'
grep
searches in all file in /usr/share/applications/
for a line starting with Name=
.
For each line it finds it prints filename:line
, for example
/usr/share/applications/yelp.desktop:Name=Help
To make it look a bit better we use sed 's/:Name=/ /'
to replace :Name=
with
(three spaces)
Quick hack for the list view in Nautilus:
Install the package python-nautilus
, create the folder ~/.local/share/nautilus-python/extensions
and save the following code as ~/.local/share/nautilus-python/extensions/filename-column.py
:
import os
import urllib
from gi.repository import Nautilus, GObject
class FilenameColumn(GObject.GObject, Nautilus.ColumnProvider, Nautilus.InfoProvider):
def __init__(self):
pass
def get_columns(self):
return Nautilus.Column(name="NautilusPython::fd_filename_column",
attribute="fd_filename",
label="file name",
description="file name"),
def update_file_info(self, file):
filename = file.get_name()
file.add_string_attribute('fd_filename', filename)
Run nautilus -q; nautilus&
at the command line to restart Nautilus. Then in the nautilus menu go to Edit -> Preferences -> List Columns and activate the file name
column (you may want to move it up, too). Now you have an additional column in list view that always shows the file name.
Isn't exactly pretty but does it's job.
Best Answer
You can obtain a list of packages that think they own files in the directory using
dpkg -S
e.g.:Then re-install each one:
There are ways to automate that by processing the dpkg output - but doing it by hand will be a reminder to be more careful.