PDA

View Full Version : Add an application



PM998
April 13th, 2014, 02:56 PM
Hi everyone,

I just upgrade to 14.04. So far so good. Now I would like to add a couple of script files to the "application" menu in order to have quicker access to these.
But I have not idea how to do this. In the old ubuntu (Gnome2), there are an edit menu option, but I cannot find this 14.04.

Any advice?

Thanks
Peter

grumblebum2
April 13th, 2014, 09:14 PM
You would need to create a .desktop file in ~/.local/share/applications for each script.
May find it easier to create a .desktop file using a quicklist to run scripts you use frequently.

eg this is my MyScripts.desktop file.

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=
Name=MyScripts
Icon=/home/glen/Pictures/icons/Scripts Folder Badged.png

Actions=altyo-fix;Change Cursor;Screensaver;Reset Wallpaper;

[Desktop Action altyo-fix]
Name=altyo-fix
Exec=/home/glen/scripts/altyo-fix.sh
TargetEnvironment=Unity

[Desktop Action Change Cursor]
Name=Change Cursor
Exec=gnome-terminal -e '/home/glen/scripts/change_cursor'
TargetEnvironment=Unity

[Desktop Action Screensaver]
Name=Screensaver ON/OFF
Exec=/home/glen/scripts/toggle_screen_blanking.sh
TargetEnvironment=Unity

[Desktop Action Reset Wallpaper]
Name=Reset Wallpaper
Exec=/home/glen/scripts/background-reset.sh
TargetEnvironment=Unity

You can use this as a template and edit for your own needs.
In a terminal run...

gedit ~/.local/share/applications/MyScripts.desktop
Copy and paste in the above .desktop file and edit for your use.

It's fairly simple.
The
"Actions=altyo-fix;Change Cursor;Screensaver;Reset Wallpaper;"
line lists your actions which correspond to the name used in
[Desktop Action altyo-fix]
Name=altyo-fix # this can be whatever you like and is what is shown in the quicklist menu
Exec=/home/glen/scripts/altyo-fix.sh # path to your script
TargetEnvironment=Unity

Once edited, save and drag and drop ~/.local/share/applications/MyScripts.desktop to the launcher

grumblebum2
April 13th, 2014, 10:01 PM
....or if you can't be bothered with creating .desktops and quicklists you can use the gnome-desktop-item-edit command which
is available when you install gnome-panel.

In the terminal run....

sudo apt-get install --no-install-recommends gnome-panel

Then...

gnome-desktop-item-edit --create-new ~/.local/share/applications/

You will see the old create launcher dialog where you can create a launcher for your script
which will be picked up by the dash.

deadflowr
April 14th, 2014, 04:01 AM
You could install "alacarte", which is the name of what you know as main menu.
Which is what I think you want.


sudo apt-get install alacarte

PM998
April 14th, 2014, 08:03 PM
Thanks grumblebum2. This is exactly what I had in mind. Worked perfectly.