You are not logged in.

#1 2019-04-16 20:55:48

pikachu64
Member
Registered: 2019-04-16
Posts: 5

[SOLVED] Change xdg_menu / Openbox default terminal emulator

I use Openbox and want to change my default terminal emulator. My menu at ~/.config/openbox/menu.xml looks like this:

menu.xml wrote:

<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">

<menu id="root-menu" label="Openbox 3">
  <menu id="applications" label="Applications" execute="xdg_menu --format openbox3-pipe --root-menu /etc/xdg/menus/arch-applications.menu" />
  <separator />
  <item label="Exit Openbox">
    <action name="Exit">
      <prompt>yes</prompt>
    </action>
  </item>
</menu>

I'm using xdg_menu to automatically generate a menu for my installed applications. This used to be recommended on the "Openbox" Arch Wiki page. Below is an excerpt of the generated xml:

<item label="Htop" icon="/usr/share/pixmaps/htop.png">
       <action name="Execute"><execute>xterm -e htop</execute></action>
     </item>
      <item label="Konsole">
       <action name="Execute"><execute>konsole</execute></action>
     </item>

As you can see it is hardcoding xterm to execute applications that use a terminal emulator. I was wondering if this can be changed. I know there are alternative menu generator like "obmenu-generator" but I haven't ever used them.

Last edited by pikachu64 (2019-04-18 12:15:31)

Offline

#2 2019-04-16 21:07:31

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Change xdg_menu / Openbox default terminal emulator

pikachu64 wrote:

As you can see it is hardcoding xterm to execute applications that use a terminal emulator. I was wondering if this can be changed.

Yes, with a text editor.


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-04-17 08:24:23

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Change xdg_menu / Openbox default terminal emulator

pikachu64 wrote:

As you can see it is hardcoding xterm to execute applications that use a terminal emulator. I was wondering if this can be changed

Yes: use the XDGMENUMAKERTERM environment variable.

For example, to use konsole instead of xterm run

XDGMENUMAKERTERM=konsole xdg_menu --format openbox3 --root-menu /etc/xdg/menus/arch-applications.menu > xdg-menu.xml

See https://github.com/gapan/xdgmenumaker/b … maker#L145

Offline

#4 2019-04-17 17:43:16

pikachu64
Member
Registered: 2019-04-16
Posts: 5

Re: [SOLVED] Change xdg_menu / Openbox default terminal emulator

I have "community/archlinux-xdg-menu" installed instead of the AUR "xdgmenumaker". I would like to use the AUR script because I think Python is cleaner than Perl but it doesn't support Openbox.

USAGE: xdgmenumaker [OPTIONS]

OPTIONS:
    -f, --format         the output format to use.
                         Valid options are blackbox, compizboxmenu, fluxbox,
                         fvwm, twm, icewm, jwm, windowmaker and pekwm

Also there is a build problem with xdgmenumaker currently - it requires the whirlpoolsum binary and you have to manually install "rhash" and create a symbolic link from whirlpool-hash to whirlpoolsum. Thanks for pointing me in the right direction though, I tend to see programs as black boxes until I have the itch to do some research. I copied /usr/bin/xdg_menu and replaced "xterm" with "konsole" on line 1347.

$exec = "konsole -e $exec" if $desktop->{Terminal} eq '1' || $desktop->{Terminal} eq 'true';

Last edited by pikachu64 (2019-04-17 17:44:01)

Offline

Board footer

Powered by FluxBB