You are not logged in.

#1 2019-01-22 13:18:04

THX1138
Member
Registered: 2019-01-14
Posts: 158

Can i run a program in terminator from OB menu? [SOLVED]

Ok so I have been trying to run chkrootkit (a program that checks for rootkits)
from the openbox menu. To run chkrootkit you have to open a terminal and simply type chkrootkit. That works, but I wish to do this from the OB menu and that just will not work.

I have tried as the command the following
chkrootkit
terminator chkrootkit
terminator -x chkrootkit
/path/to/chkrootkit

You name it I have tried everything I can think of.
I have even tried writing a bash script to start chkrootkit
and it will not work from the OB menu.

I have searched google and still cannot find an answer that works
I have tried to make this work so much that I was thinking of just asking someone to shoot me and put me out of my misery, but I thought I would ask Bunsenlabs if anyone here knows a way to make a terminal open and run a program from the OB menu..

Last edited by THX1138 (2019-01-22 14:29:50)


I did not attend his funeral, but I sent a nice letter saying I approved of it. (Mark Twain)

Offline

#2 2019-01-22 13:35:27

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,661

Re: Can i run a program in terminator from OB menu? [SOLVED]

This

terminator -e 'ls; sleep 6'

seems to work. p.s. This was discussed before, search may help.

Edit: Same example, escaped, in openbox menu may look like

<item label="terminator -e &#39;ls; sleep 6&#39;">
    <action name="Execute">
        <execute>terminator -e &#39;ls; sleep 6&#39;</execute>
    </action>
</item>

p.s. function

# xmlescape and trim whitespace bash 
# https://stackoverflow.com/questions/12873682/short-way-to-escape-html-in-bash
xmlescape () {
    echo "$@" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g; s/^[ \t]*//;s/[ \t]*$//'
}

Last edited by brontosaurusrex (2019-01-22 14:25:07)

Offline

#3 2019-01-22 13:42:13

Bearded_Blunder
Member
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 602

Re: Can i run a program in terminator from OB menu? [SOLVED]

Have a look at the menu config & see how htop is done, you'll get clues for the window title too, and an example right in front of you smile

Last edited by Bearded_Blunder (2019-01-22 13:42:41)


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#4 2019-01-22 14:09:22

THX1138
Member
Registered: 2019-01-14
Posts: 158

Re: Can i run a program in terminator from OB menu? [SOLVED]

Thanks for the help. I actually searched these forums many times looking for the answer but found nothing. I am pretty sure I at least have something of a clue to work on now, thanks

Edited in later
Yes I can now make bash scripts work by using the line

<command>x-terminal-emulator -T 'chkrootkit' -e /home/myusername/scripts/chkrootkit.sh</command>

simply using the following did not work

<command>x-terminal-emulator -T 'chkrootkit' -e chkrootkit</command>

I never tried whether it would start the program if I made a path to that rather than my script I assume it would. I need to experiment more

Thanks a lot for the help I did look through the menu but didnt make the connection between what I wanted to achieve and what was already staring me in the face - DUHHHHH !

Last edited by THX1138 (2019-01-22 14:32:46)


I did not attend his funeral, but I sent a nice letter saying I approved of it. (Mark Twain)

Offline

#5 2019-01-22 15:26:36

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: Can i run a program in terminator from OB menu? [SOLVED]

Sometimes you may need to invoke the $SHELL

xterm -e "bash -c 'echo hello;$SHELL'"

Or with an example command..

xterm -e "bash -c 'nmtui;$SHELL'"

Where nmtui is a curses front end for networkmanager for example.

You would be better of creating a desktop application such as.


[Desktop Entry]
Version=1.0
Name=Test        
Comment=Test the terminal running a command inside it
Exec=x-terminal-emulator -e "bash -c 'chkrootkit.sh;$SHELL'"
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Application;

Put chkrootkit.sh in your $PATH and call the desktop entry application from the OB menu <command>

Last edited by S7.L (2019-01-22 15:29:47)

Offline

#6 2019-01-22 17:00:41

THX1138
Member
Registered: 2019-01-14
Posts: 158

Re: Can i run a program in terminator from OB menu? [SOLVED]

Thanks S7.L, I just added my scripts folder to the environment path


I did not attend his funeral, but I sent a nice letter saying I approved of it. (Mark Twain)

Offline

#7 2019-01-22 17:52:52

THX1138
Member
Registered: 2019-01-14
Posts: 158

Re: Can i run a program in terminator from OB menu? [SOLVED]

Thanks brontosaurus rex


I did not attend his funeral, but I sent a nice letter saying I approved of it. (Mark Twain)

Offline

Board footer

Powered by FluxBB