Xfce Forum

Sub domains
 

You are not logged in.

#1 2008-09-10 17:04:54

gally
Member
Registered: 2007-07-05
Posts: 8

running nano on desktop menu

Hi guys,
I'm trying to run nano (the problem is present with all the programs requiring a terminal) but all what I get is the terminal.
This is the script I'ld like to run, it works from command line
The filename is f_stab

#! /bin/sh
/usr/bin/nano /etc/fstab

Then I created in /usr/share/applications a file with name f_stab.desktop

[Desktop Entry]
Name=F_stab
Comment=
Icon=/usr/share/pixmaps/pbuc.gif
Exec=/root/f_stab
Terminal=true
Type=Application
Categories=Application;GTK;Development;IDE;

I get the same result even if I try to create it via a new item on the panel.

Any idea?
thank you in advance

Offline

#2 2008-09-10 19:01:46

nightmorph
Member
From: SoCal
Registered: 2008-09-10
Posts: 12
Website

Re: running nano on desktop menu

I can think of a few reasons why this might not work.

First, you have the script in /root/ -- this is bad because /root/ is not readable by anyone except the root user, so unless you're running Xfce as root . . . (Bad, bad idea!) A better location would be in, say, /usr/local/bin/, and then make sure that this is in your default path. Try echo $PATH to see if it is.

Second, the actual script itself, the one being called by the .desktop file....make sure you've made it executable: chmod +x f_stab.

Third, you're trying to run a console command without telling Xfce to start up a console. What you really need to do is rewrite your script to do something like this:

#!/bin/bash
/usr/bin/Terminal -e '/usr/bin/nano /etc/fstab' -T f_stab

This spawns a Terminal that then executes (the -e flag) the f_stab script, and then sets the title of the terminal to the name of your script. I use a variant of this to launch irssi from the panel.

Offline

#3 2008-09-10 20:38:50

gally
Member
Registered: 2007-07-05
Posts: 8

Re: running nano on desktop menu

It works, thank you.
After modifying the scritp had to put Terminal=false in *.desktop and voilà! it works!

Thank you again

Offline

Board footer

Powered by FluxBB