Version

Should be 1.0, it refers to the .desktop file version, not to the program version.

Name

The name that should be displayed on the menu.

Exec

The full path to the executable. No need to use ‘.’, it just means the current dir

Path

The dir that will be set as current when the entry is run. You usually don’t need to set it, but I have added it just in case. It is the same as using ‘cd’ in your command line

Icon

The path to the icon file that will be used for the file, it’s likely that the one that you put doesn’t exists, I have changed it for a generic one. You should change this to the file that you want the icon to use

Mimetype

Specifies the kind of files that this program is able to open. I’ve left it empty.

[Desktop Entry]
Type=Application
Comment=samba restart
Icon=/home/kimathi/Downloads/icons/samba.png
Terminal=true
Hidden=false

Exec=/home/kimathi/Scripts/samba.sh

Name[en_US]=Samba Restart

samba.sh

#!/bin/bash

sudo /etc/init.d/samba restart
Living in Tune with Nature's Beat (Earth, Water, Fire, Air, Space)

Leave a Reply

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