You are not logged in.

#1 2016-01-24 17:22:46

npinkerton
Member
Registered: 2016-01-24
Posts: 11

[SOLVED] - Change Default Terminal Emulator

This is similar to the issue over here: http://bbs.archbang.org/viewtopic.php?id=5038
But I'm using xdg-menu rather than obmenu.

When I try to launch htop (or any application that runs in a terminal) from my OpenBox menu (auto-generated by xdg-menu), I get an error stating "Failed to execute child process "xterm" (No such file or directory)"

I am using lxterminal as my terminal emulator, and do not have xterm installed (never have had xterm installed).

$ pacman -Q xterm
error: package 'xterm' was not found

~/.config/openbox/menu.xml has no mention of xterm
/usr/share/applications/htop.desktop has no mention of xterm

the only place on my system that xterm seems to turn up is in the environment variables:

$ printenv | grep TERM
TERM=xterm
TERMINAL=lxterminal

Is there somewhere that I am missing that xdg-menu and/or OpenBox has a setting for the default terminal emulator?

Last edited by npinkerton (2016-01-25 22:51:35)

Offline

#2 2016-01-25 00:49:39

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator

Why not change TERM too lxterminal or soft link xterm too lxterminal.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#3 2016-01-25 01:01:34

npinkerton
Member
Registered: 2016-01-24
Posts: 11

Re: [SOLVED] - Change Default Terminal Emulator

Mr Green wrote:

Why not change TERM too lxterminal or soft link xterm too lxterminal.

by "change TERM to lxterminal", do you mean in environment variables?

I did try editing /etc/environment to add

TERM=lxterminal
export TERM

and even tried running

env TERM=lxterminal

neither of those did anything... and I've read elsewhere that TERM is set by the terminal emulator itself and that changing it manually can cause errors elsewhere... so I changed it back.

Is there another way to change it?

as far as soft linking... hadn't thought about that. That might work. Its kind of a hack, but ain't nothing wrong with that, if it works, I suppose.

Offline

#4 2016-01-25 01:28:19

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator

Why not try .bashrc?

export TERM=lxterminal
export TERMINAL=lxterminal
export BROWSER=firefox
# Gtk themes 
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"

alias ls='ls --color=auto'

Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#5 2016-01-25 13:41:00

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#6 2016-01-25 15:10:58

npinkerton
Member
Registered: 2016-01-24
Posts: 11

Re: [SOLVED] - Change Default Terminal Emulator

Yeah... I saw that, and that's why I took my declaration out of /etc/environment

Creating a soft link xterm that points to lxterminal allowed me to launch htop from the menu (thanks for the idea)

I am still curious if there is a way of actually telling the system my preferred terminal emulator... Because this wouldn't work if I did happen to have xterm installed.

Last edited by npinkerton (2016-01-25 15:11:46)

Offline

#7 2016-01-25 22:53:50

npinkerton
Member
Registered: 2016-01-24
Posts: 11

Re: [SOLVED] - Change Default Terminal Emulator

I went ahead and marked this as solved, since the soft link worked for my issue, but would love to hear any further insight or ideas that anyone might have.

Offline

#8 2016-01-26 01:03:53

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator

Not found anything relating to where TERM is set. Wiki does say changing the variable is not a good idea. Linking is one way around the problem. Still wondering where it is set wink


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#9 2016-01-26 01:42:47

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#10 2016-01-26 12:01:06

npinkerton
Member
Registered: 2016-01-24
Posts: 11

Re: [SOLVED] - Change Default Terminal Emulator

yeah, the more I read, the more I think that $TERM is a red herring.

It seems as though "xterm" and "xterm-256" are the only valid values for $TERM... Which begs the question... where does OpenBox (or xdg-menu, as the case may be) look to find out what terminal emulator to use when a CLI app is launched from the menu?

I'm still digging around.

----------------------------------------------------

I piped the output of xdg_menu to a text file... items whose *.desktop file contain "Terminal=True" (such as htop.desktop) are called in the menu with "xterm - <app name>"

So... it seems to be xdg_menu, not OpenBox that is the culprit... when xdg_menu scand that /usr/shar/applications directory to build it's menu, and encounters a *.desktop file that contains "Terminal=True", it assumes xterm is the terminal emulator to use...

but I can't find an option anywhere in the xdg_menu configs that allow me to change that... it is possible that it is hard-coded, I guess... and xdg_menu might be pulling that preference from the WM or shell... but for right now, I'm focussing my search on xdg_menu

Last edited by npinkerton (2016-01-26 12:13:46)

Offline

#11 2016-01-26 12:25:17

npinkerton
Member
Registered: 2016-01-24
Posts: 11

Re: [SOLVED] - Change Default Terminal Emulator

Looking at the xdg_menu perl script, xterm is hard-coded into it.

I think, for now, I'm going to leave it alone and just stick with the soft link solution, rather than changing the perl script, to avoid it breaking when updates happen.

I may look for a different menu generator, though.

Offline

#12 2016-01-26 12:30:04

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: [SOLVED] - Change Default Terminal Emulator

obmenu-generator might help as it is a little more flexible. I dropped it from ArchBang only because its aur just to reduce my workload.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB