1

I have a simple script that basically does "tail -1000f /public/XERlog"

I created a file called log.desktop on the desktop which contains:

Exec= tail -1000f /public/XERlog
Name= XERlog
Path=/tmp/
StartupNotify=true
Terminal=true
Type=Application

The file is on the desktop and when you doouble-click on it, it opens a dialog box that has a few options like "Run in Terminal" and "Run" and "View" etc. I want it to automatically run in a terminal, is there a way to force it so it doesn't give the dialog box each time?

clayton33
  • 111

3 Answers3

3

You could run a terminal emulator not the tail. Each terminal emulator accepts a command to execute as a parameter.

To run a gnome-terminal you can change the Exec line as follows:

Exec=gnome-terminal --window --command "tail -f /var/log/messages"

The exact line changes according to the terminal emulator you choose.

Note that you should change the Terminal line to false

andcoz
  • 17,130
2

Your file is missing the header line:

[Desktop Entry]
Exec=tail -f /var/log/messages
Name=XERlog
Path=/tmp/
StartupNotify=true
Type=Application
Terminal=true
andcoz
  • 17,130
1

You can run it directly from the Terminal. Just open the terminal, find the file and rename it to "somename.sh" and then:

 mv log.desktop somename.sh
 chmod +x somename.sh
./somename.sh

And your script is running .

ValeriRangelov
  • 866
  • 7
  • 14
  • Thanks but what I am looking to do is be able to doubleclick on the file and have it automatically open in a terminal. This is a script that we use often, and I want to avoid having to manually open a terminal each time and type in the script. – clayton33 Dec 16 '15 at 15:59
  • Try with right click and select properties, on the permissions tab ensure 'execute' is checked then double click again you should get your option box to run or edit. If it working I will edit my answer. – ValeriRangelov Dec 16 '15 at 17:02