Score:0

Desktop icon not executing bash

in flag

I've created a disktop icon to execute a bash command. They both correct (the icon file and the bash file) as they do run individually. But together, they do not work

[Desktop Entry]
Name=Backup Photos
Comment=Nothing
Exec=/home/guy/Applications/ftpsync-1.2.33/backupGuy.sh
Icon=
Terminal=true
Type=Application
Categories=GNOME;
StartupNotify=true

and my bash file is;

echo copie vers le nuage
./ftpsyncModifiedByGuy.pl -n ~/Images/photo ftp://backupuser:[email protected]/"guy_photos"
echo "copy vers l'ordinateur"
./ftpsyncModifiedByGuy.pl -n ftp://backupuser:[email protected]/"guy_photos" ~/Images/photo

Just to test the icon, I replaced the exec= line with the line from another desktop icon (android studio) and android studio starts. Do the icon is set to execute properly.

The bash file is also set to allow execute. And it does run when I execute it directly in a terminal.

When I double click on the desktop icon, I see nothing at all. It doesn't do the backup.

What is wrong?

jpbrain avatar
ca flag
try "Exec=gnome-terminal -- /home/guy/Applications/ftpsync-1.2.33/backupGuy.sh"
Terrance avatar
id flag
Are your files of the `.pl` files in the same folder as you run the `backupGuy.sh` file from? If so, you might want to add a `cd /home/guy/Applications/ftpsync-1.2.33/` before those lines of the `.pl` files are called.
Terrance avatar
id flag
Or you can add a line that says `Path=/home/guy/Applications/ftpsync-1.2.33/` so that your script starts in that folder.
N0rbert avatar
zw flag
For documentation about desktop-files including `Path` field see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html .
Guytas avatar
in flag
omg... I can't beleive that I didn't think of that by myself. I've done thousands of batch files in Windows. I think I was only thinking about the desktop icon and forgetting about the path. Thanks. it is working now.
Score:0
in flag

I just included the full path in the bash file like this

echo copie vers le nuage
/home/guy/Applications/ftpsync-1.2.33/ftpsyncModifiedByGuy.pl -n ~/Images/photo ftp://backupuser:[email protected]/"guy_photos"
echo "copy vers l'ordinateur"
/home/guy/Applications/ftpsync-1.2.33/ftpsyncModifiedByGuy.pl -n ftp://backupuser:[email protected]/"guy_photos" ~/Images/photo
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.