Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using alacarte/Main menu to launch text file

109 views
Skip to first unread message

Andy Cap

unread,
Jun 1, 2015, 2:30:12 PM6/1/15
to
As per title. I'd like to create a menu item to launch a text file in gedit.

However, if I simply enter gedit into the command: box, gedit opens as
expected. If though I add /home/~/Scripts/Scripts.txt as you would in a
terminal window, nothing happens.

I notice that after entering gedit the OK button is highlighted but
adding the location leaves it greyed-out. It greys-out as soon as you
put a space after gedit.

I've tried various things my limited knowledge allows but to no avail.
Are there any suggestions I could try ?

TIA

Whiskers

unread,
Jun 1, 2015, 6:45:32 PM6/1/15
to
/home/~/... doesn't look like a valid path for a filename.
/home/username/... should work, and ~/... is worth a try, but not both
at once. Make sure you have all your upper and lower case letters
correct too. If the file doesn't exist, gedit should create it (in
which case it will be empty of course) but I've noticed that some
programs don't do that.

Presumably your user has read write and execute permissions for the
file.

--
-- ^^^^^^^^^^
-- Whiskers
-- ~~~~~~~~~~

Andy Cap

unread,
Jun 2, 2015, 1:35:02 AM6/2/15
to
On 01/06/15 23:45, Whiskers wrote:

>
> /home/~/... doesn't look like a valid path for a filename.
> /home/username/... should work, and ~/... is worth a try, but not both
> at once. Make sure you have all your upper and lower case letters
> correct too. If the file doesn't exist, gedit should create it (in
> which case it will be empty of course) but I've noticed that some
> programs don't do that.
>
> Presumably your user has read write and execute permissions for the
> file.
>

Apologies. For some reason I replaced the proper username with a ~.
so the actual path is /home/Andy/Scripts/Scripts.txt

gedit /home/Andy/Scripts/Scripts.txt

If I enter that into Terminal window, the file opens fine.

Thanks

Jim Price

unread,
Jun 2, 2015, 8:50:21 AM6/2/15
to
Without knowing which desktop you are using it's just a guess, but the
chances are that if you just put the correct filename (with full path,
no spaces) into alacarte it will open it with whatever is defined as
your default application for text files. To find out what that is, you
can run xdg-open <filename> and see what it does.

--
╔═╦═╦═════╦═══╗
║ ║ ║ ║ ║
╔═╝ ║ ║ ║ ║ ║ ╔═╝
╚═══╩═╩═╩═╩═╩═╝ -- JimP.

Andy Cap

unread,
Jun 2, 2015, 9:17:49 AM6/2/15
to
On 02/06/15 13:50, Jim Price wrote:

>
> Without knowing which desktop you are using it's just a guess, but the
> chances are that if you just put the correct filename (with full path,
> no spaces) into alacarte it will open it with whatever is defined as
> your default application for text files. To find out what that is, you
> can run xdg-open <filename> and see what it does.
>

I'm using Gnome3

If I put xdg-open /home/Andy/Scripts/Scripts.txt into a terminal window
it opens the file in gedit.

If I just put gedit in the alacarte command: box the OK button is
highlighted and the button opens gedit.

If I put gedit /home/Andy/Scripts/Scripts.txt in the alacarte
command: box the OK button remains greyed-out

Thanks




Jim Price

unread,
Jun 2, 2015, 9:42:14 AM6/2/15
to
On 02/06/15 14:17, Andy Cap wrote:
> On 02/06/15 13:50, Jim Price wrote:

>> put the correct filename (with full path,
>> no spaces) into alacarte

> If I put xdg-open /home/Andy/Scripts/Scripts.txt into a terminal window
> it opens the file in gedit.
>
> If I just put gedit in the alacarte command: box the OK button is
> highlighted and the button opens gedit.
>
> If I put gedit /home/Andy/Scripts/Scripts.txt in the alacarte
> command: box the OK button remains greyed-out

So what happens if you put /home/Andy/Scripts/Scripts.txt in the
alacarte command: box? That is what I meant by my quoted text above.

--
╔═╦═╦═════╦═══╗
║ ║ ║ ║ ║
╔═╝ ║ ║ ║ ║ ║ ╔═╝
╚═══╩═╩═╩═╩═╩═╝ -- JimP.

Andy Cap

unread,
Jun 2, 2015, 9:45:22 AM6/2/15
to
On 02/06/15 13:50, Jim Price wrote:
I missed off that if I simply put the folder i.e.
/home/Andy/Scripts/Scripts.txt in the command: box, then the OK
button remains greyed-out.

Jim Price

unread,
Jun 2, 2015, 10:03:10 AM6/2/15
to
On 02/06/15 14:45, Andy Cap wrote:

> I missed off that if I simply put the folder i.e.
> /home/Andy/Scripts/Scripts.txt in the command: box, then the OK
> button remains greyed-out.

OK, I don't use alacarte because my desktop uses its own menu system.
The quick and dirty fix is to create a script which runs the command
line way of doing what you want. Put it in /home/Andy/bin/Scripts.sh,
make it executable and then alacarte should know it can run it when you
put the full path to it into the new item dialogue box. If you've not
written any scripts before, it's just a text file with the first line:

#! /bin/bash

Run it from the command line first to make sure it works.

--
╔═╦═╦═════╦═══╗
║ ║ ║ ║ ║
╔═╝ ║ ║ ║ ║ ║ ╔═╝
╚═══╩═╩═╩═╩═╩═╝ -- JimP.

Andy Cap

unread,
Jun 2, 2015, 10:36:23 AM6/2/15
to
On 02/06/15 15:03, Jim Price wrote:

>
> OK, I don't use alacarte because my desktop uses its own menu system.
> The quick and dirty fix is to create a script which runs the command
> line way of doing what you want. Put it in /home/Andy/bin/Scripts.sh,
> make it executable and then alacarte should know it can run it when you
> put the full path to it into the new item dialogue box. If you've not
> written any scripts before, it's just a text file with the first line:
>
> #! /bin/bash
>
> Run it from the command line first to make sure it works.
>

Yes that works !!! Thanks for the pointer, much appreciated. :-)
0 new messages