I am having problems with my .desktop files. I have a shell script that constantly watches for a file to be put into the "Downloads" folder. When a file is put into the folder it automatically executes a C program that I wrote in the terminal, and offers me different options for where I would like to move the file.
All is well there. However, I want a desktop shortcut to the program. I tried using the shortcut editor to specify the command to run, and to excecute it in terminal, and to keep terminal running after the execution of the command. All that is in the command is cd ~/Documents/prog/c/learn/inotify-tools && ./notifyscript.sh
However, that won't work. Also, I tried writing a C program that basically told the system the above command, thinking that the shortcut editor was messing up.
INTERESTINGLY, it runs fine when I am in its directory and type ./'Download Manager'
However, I don't want to keep changing to the directory on every reboot and run the program. Instead, I want a .desktop shortcut or, even better, a way to start on reboot automatically. I don't understand why it isn't working. If I don't execute in terminal it doesn't work...
Here is the Desktop File:
[Desktop Entry]
Name=Download Manager
Comment=
Exec=cd ~/Documents/prog/c/learn/inotify-tools && ./notifyscript.sh
Icon=icon name
Terminal=true
Type=Application
StartupNotify=true
X-KeepTerminal=true
Here is the C Source Code and its Desktop file as well, just as another option:
[Desktop Entry]
Name=Download Manager
Comment=
Exec=./'Download Manager'
Icon=icon name
Terminal=true
Type=Application
StartupNotify=true
X-KeepTerminal=true
C Source Code:
/*
desktoplauncher.c Source Code
Written by me
This program is used to launch
the inotify monitor shell script
which in turn launches the
download manager program
whenever a file is placed in the
"Downloads" folder.
*/
#include <stdio.h>
int main()
{
system("cd ~/Documents/prog/c/learn/inotify-tools && ./notifyscript.sh");
}