Customize the Ubuntu/Gnome Launchers

Google Chrome has a special “New Incognito Window” in the Gnome launcher. So how hard would it be to edit the launcher buttons to add some customized commands? Apparently not so hard. Here’s what I got:
Customized Quicklist

The file you want to edit should be in ~/.local/share/applications/
If it’s not there, copy the original from /usr/share/applications/

I customized firefox, so the file I edited was ~/.local/share/applications/firefox.desktop

The main key you’re lookgin to edit is X-Ayatana-Desktop-Shortcuts. You should add your Shortcut Group name to that. Here’s an example:

[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
X-Ayatana-Desktop-Shortcuts=NewWindow;CommApp;Private;Safe;ProfileManager
...
[Private Shortcut Group]
Name=Private Mode
Exec=firefox -private -no-remote -P default
TargetEnvironment=Unity

[Safe Shortcut Group]
Name=Safe Mode
Exec=firefox -safe-mode
TargetEnvironment=Unity
...

I later found another way to add Actions. Here’s an example:

[Desktop Entry]
Name=Terminal
Comment=Use the command line
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=utilities-terminal
Type=Application
Categories=GNOME;GTK;Utility;TerminalEmulator;
StartupNotify=true
OnlyShowIn=GNOME;Unity;
Keywords=Run;
Actions=New;Staff
X-Ubuntu-Gettext-Domain=gnome-terminal

[Desktop Action New]
Name=New Terminal
Exec=gnome-terminal
OnlyShowIn=Unity

[Desktop Action Staff]
Name=Staff Window
Exec=gnome-terminal --command='ssh myworkserver' --tab-with-profile-internal-id=work --hide-menubar --geometry=270x38+0-0
OnlyShowIn=Unity

I am guessing the API for that is defined somewhere, I didn’t bother too look a lot though (I got what I came here for). Feel free to comment.

Similar Posts:

Tagged , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *