I have created a link to directory on windows partition on Desktop in Ubuntu 14.04. Because this partition will not be automatically mounted at startup the link is marked broken each time I power on computer. So I would like that when I click on a link the command ln -s -f "path1" "path2"
would be executed before the link is "opened". How can this be done?
Other option would be to make a script with icon on Desktop. When double-clicked the script would check if the partition is mounted and mount it if it is not mounted and then open the Directory I want. But I have no idea how to make this? Any sugestion?
You could use a script similar to this one
mount
get list of mounted nodes| grep /dev/...
filter previous output of looking only for target device|| gksu mount /dev/sda5 /path
if previous command fails, it means it is not mounted then mount it. BTW, removegksu
if you don't need superuser power to mount.|| zenity --error --text="Failed to mount"
Raise an error message if previous command fails.The 2nd command, seems simpler then the 1st.