SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-07-12 22:31:59

Beepmode
Member
Registered: 2012-03-15
Posts: 42

Terminal application refusing to launch from Openbox menu

I've added the t todo list manager to my Openbox menu but it won't open. Terminator flashes and then disappears.

This is what I got in menu.xml:

<item label="todo list">
	<action name="Execute">
		<execute>
			terminator --command="t"
		</execute>
	</action>
</item>

And I got this alias in my bashrc:

alias t='python ~/.todo/sjl-t-1c496e933168/t.py --task-dir ~/.todo --list tasks'

Opening t from terminator works fine but something goes wrong when executing it from the Openbox menu. Other terminal applications do open using the same syntax. For instance, newsbeuter happily opens with:

<item label="todo list">
	<action name="Execute">
		<execute>
			terminator --command="newsbeuter"
		</execute>
	</action>
</item>

I've tried adding the -e flag as suggested in this post and tried this solution, to no avail. Any help / suggestions appreciated!

Offline

Help fund CrunchBang, donate to the project!

#2 2013-07-13 02:19:54

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,385

Re: Terminal application refusing to launch from Openbox menu

What exactly is t.py?  Is it a Python program that you created?  If so, why don't you try renaming it to something else?  As you've already demonstrated, the terminator --command="<app name>" works, so it must have something to do with either attempting to use an alias, the name of the Python program, or the program itself.

Perhaps you need super user privileges to run it.  Change terminator --command="t" to gksudo terminator --command="t".

07/12/2013-01 edit:  Also try using the same code for your alias for the terminator command...

terminator --command="python ~/.todo/sjl-t-1c496e933168/t.py --task-dir ~/.todo --list tasks"

Last edited by KrunchTime (2013-07-13 02:24:06)

Offline

#3 2013-07-13 02:25:47

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Terminal application refusing to launch from Openbox menu

If you just want the todolist to open whenever you open a terminal window you can add it to the end of your ~/.bashrc file. I think the problem is that terminator opens, runs the program, then exits when the program does.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#4 2013-07-13 08:15:38

kbmonkey
#! Die Hard
Registered: 2011-01-14
Posts: 839
Website

Re: Terminal application refusing to launch from Openbox menu

I believe you are using the wrong terminator option, try --execute instead:

Apologies, you did try that.

Ah I see the issue: man terminator

-e, --command=COMMAND
              Runs the specified  command  **instead**  of  your  default
              shell or profile specified command

It is not an interactive shell and so does not load your aliases. Try put that command in the file ~/bin/t and make it executable, instead of an alias.

#!/bin/sh
python ~/.todo/sjl-t-1c496e933168/t.py --task-dir ~/.todo --list tasks
chmod 744 ~/bin/t

Note: t seems like a ambiguous name for a command, todo might suit you better?

Last edited by kbmonkey (2013-07-13 08:23:11)

Offline

#5 2013-07-13 08:24:37

DebianJoe
#! Code Whisperer
From: The Bleeding Edge
Registered: 2013-03-13
Posts: 1,207
Website

Re: Terminal application refusing to launch from Openbox menu

annoyingbeggar wrote:

If you just want the todolist to open whenever you open a terminal window you can add it to the end of your ~/.bashrc file. I think the problem is that terminator opens, runs the program, then exits when the program does.

^^I'm pretty certain that annoyingegger has hit the nail on the head.  You ARE running t, just not "holding" it open.  I'm not sure that KB's suggestion will help, but it's worth a shot.  I'd have to test this for myself, but if you run a script that isn't set to hold control of the terminal, it finishes and closes out.  That's how it appears that t is designed.

Offline

#6 2013-07-13 08:52:15

Beepmode
Member
Registered: 2012-03-15
Posts: 42

Re: Terminal application refusing to launch from Openbox menu

Thanks for all your responses!

@KrunchTime, t.py is a Python shell script / simple todo list (see stevelosh.com/projects/t/).

I've tried renaming t.py, using gksudo and executing the full command as you suggested... but the same thing kept happening.

I first suspected the alias was the troublemaker as terminator shows the same behaviour (flash and disappear) when trying to execute a programme that doesn't exist (as a test I tried to execute terminator --command="blablablab"). However, after a bit more testing I think it might be the case that it's just not possible to run the Python script from the Openbox menu. As a test case I tried to execute this script (~/bin/pythontest) from the menu:

#! /usr/bin/env python
print "Hello World"

This script just won't run from the menu, whether I use an alias or call it directly (terminator --command="~/bin/pythontest"). Calling either the alias or the script name directly from within terminator does work.

@kbmonkey, putting the command in ~/bin/t gives the same result again. So, it seems that Python scripts can't be executed from the Openbox menu unless they're able to "hold themselves", as annoyingbeggar and DebianJoe suggested.

Offline

#7 2013-07-13 08:56:28

kbmonkey
#! Die Hard
Registered: 2011-01-14
Posts: 839
Website

Re: Terminal application refusing to launch from Openbox menu

^ annoyingbeggar lol Looking in (default) menu.xml all other terminator commands wait for user interaction before finishing, good call.

Hittin super+t and t [return] would probably be quicker than navigating a menu anyway. Just saying wink

Offline

#8 2013-07-13 17:35:38

fatmac
#! Die Hard
Registered: 2012-11-14
Posts: 1,948

Re: Terminal application refusing to launch from Openbox menu

How I do it :-
I run a script from my menu

keith@eeebox:~$ cat pysol
python PySolFC-2.0/pysol.py &

<item label="PySol">
            <action name="Execute">
                <command>
                    ./pysol
                </command>
            </action>
        </item>


Linux since 1999
Currently:  AntiX, & Crunchbang.
A good general beginners book for Linux :- http://rute.2038bug.com/index.html.gz
A good Debian read :- http://debian-handbook.info/get/now/

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo