One thing to remember about .desktop files in Gnome is that they only work with hard links and system folders. You cannot refer to an image in your home folder, if you want the same .desktop file to work in someone else's account or on another machine.
If you create a custom icon, the best place is /usr/share/icons.
So let's say you've created your very own Gnome Menu item called cheetahballs.desktop file and you've put it in:
/media/DATA/Settings/cheetahballs.desktop
And you've got your very own icon:
/usr/share/icons/cheetahballs.png
If you re-install Ubuntu in your root partition and have /media/DATA mounted, then all you need to do is this:
sudo cp /media/DATA/Setting/cheetahballs.desktop /usr/share/applications/cheetahballs.desktop
If you want to have it on your desktop:
cp /media/DATA/Setting/cheetahballs.desktop $HOME/Desktop/cheetahballs.desktop
chmod +x $HOME/Desktop/cheetahballs.desktop
And of course, you could automate this by turning it into a BASH script:
gedit /media/DATA/Documents/bin/restore-desktop-files.sh
#!/bin/bash
#restore-desktop-files.sh
#Restore Gnome Menu item
cp /media/DATA/Setting/cheetahballs.desktop $HOME/Desktop/cheetahballs.desktop
chmod +x $HOME/Desktop/cheetahballs.desktop
#Create desktop shortcut
sudo cp /media/DATA/Setting/cheetahballs.desktop /usr/share/applications/cheetahballs.desktop
exit
No comments:
Post a Comment