Dmenu - where is "terminal" set?

When i start from dmenu a program in terminal it starts in an ugly terminal, i presume it’s urxwt. I checked a bit and i found this, in /sbin/demenu_recency:

 #!/bin/bash

# Originally based on code by Dieter Plaetinck.
# Pretty much re-written by Mina Nagy (mnzaki)
# Edited by Chrysostomus to create/source .dmenurc

#!/bin/bash

if ! [ -f "$HOME/.dmenurc" ]; then
cp /usr/share/dmenu/dmenurc $HOME/.dmenurc
fi
 . $HOME/.dmenurc

 if [ -z "$TERMINAL_CMD" ]; then
 if [ "$(which terminal)" ]; then
 TERMINAL_CMD="terminal -e"         <-- here!
 elif [ "$(which urxvt)" ]; then
 TERMINAL_CMD="urxvt -e"


   fi
fi

Now, i can change the settings easily in ~/.dmenurc, but i’d like to understand where the terminal in the first line is set. My ~.profile ist different and the gui settings as well.

I’m using i3.

Thanks in advance for any pointer.

1 Like

The first check is if the env $TERMINAL_CMD is set.

So if you set e.g. in your .profile - your favorite terminal - e.g. termite

export TERMINAL_CMD="termite -e"

Then I assume you could solve it.

But I would also check if it is set somewhere in the configs but fails because the command terminal is not found.

grep -rl 'TERMINAL_CMD' ~/

Do you have a $HOME/.dmenurc file?

TERMINAL_CMD=

ETA: Added dmenu tag

2 Likes

terminal is actually an executable!

You can find that out by using which:

$ which terminal
/usr/bin/terminal
$ cat `!!`
cat `which terminal`
#!/bin/sh

urxvtc $@
if [ $? -eq 2 ]; then
  urxvtd -q -o -f
  urxvtc $@
fi

And you can find out which package added that executable to the system like so:

$ pacman -Qo terminal
/usr/bin/terminal is owned by i3-arm-scripts 20200312-1

I am on an ARM based machine, so my terminal executable (which is just a simple shell script actually) comes from i3-arm-scripts, but this is probably different for you

1 Like

Yes :slight_smile:

    ## command for the terminal application to be used:
    TERMINAL_CMD="kitty -e"

I have nearly the same as you, although i’m not on a arm based machine (but an iMac). Only the number of the i3 scripts is different: 20200804-1

??

[Essentially, since i discovered what is possible with the combo kitty + ranger i’d like to set kitty as the all over default terminal, if that is possible/reasonable (??) ]

echo “export TERMINAL=/usr/bin/kitty”>>$HOME/.profile

Note: check to make sure you don’t have 2 TERMINAL exports.

1 Like