You are not logged in.

#1 2019-08-12 02:19:32

Patolord
Member
Registered: 2019-08-12
Posts: 2

Cant set my enviroment variable at logon

Hello, i just installed arch linux for the first time so im really new to all this.

I managed to get everything working but i cant figure how the profile files work!

I tried setting st as my default terminal, but no change takes effect.

Can someone help me solve this and understand the many diferent profile/startup files ( /xinitrc ,/xprofile , /profile)

I tried creating these files but nothing happened.

.xprofile

 export TERM="st"

.xinitrc

 #!/bin/sh

[ -f ~.xprofile ] && . ~/.xprofile

exec i3

.profile

 #!/bin/sh
export TERM="st"
export BROWSER="firefox"

well after all these files my printenv just gives TERM=rxvt

Its all a mess now x)..

PS: I know i3 has a config option called exec i3-sensible-terminal but i read that i should leave that and change on the profiles..not sure if correct..

Offline

#2 2019-08-12 02:33:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Cant set my enviroment variable at logon

Patolord wrote:

PS: I know i3 has a config option called exec i3-sensible-terminal but i read that i should leave that and change on the profiles..not sure if correct..

Where did you read this?  Do not set TERM ... anywhere.  Remove those settings.

TERM is set by your terminal emulator so other programs can read it to know what terminal they are in.  It has absolutely nothing to do with which terminal emulator is launched by a given key binding or other mechanism.

What is it you are actually trying to do?  Do you want i3 to start st when you press a given key?  If so, add that key binding to your i3 config.

EDIT: the wiki gives two ways of changing the terminal launched by the default key binding - change the binding (which makes the most sense to me) or set a TERMINAL environment variable, this is different than setting TERM.

Last edited by Trilby (2019-08-12 02:35:39)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#3 2019-08-12 07:25:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: Cant set my enviroment variable at logon

Also while we are already at it, this .xinitrc is incomplete, ensure it follows the suggested template (read the blue boxes)

Offline

#4 2019-08-13 01:01:42

Patolord
Member
Registered: 2019-08-12
Posts: 2

Re: Cant set my enviroment variable at logon

Thank you Trilby and V1del.

I thought changing $TERMINAL meant changing TERM my bad.

As you said, I just wanted WIN+Enter to open st and i thought that changing the environment variable was more appropriate.

I ended up changing the binding and it works just fine.

Now, V1del, regarding the xinitrc file, i added the last if statement as the wiki explained.

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

Is that correct?

Just out of curiosy if i was to change the environment variable where is the file i should change?

Thanks again!

Offline

#5 2019-08-13 01:10:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Cant set my enviroment variable at logon

Patolord wrote:

Just out of curiosy if i was to change the environment variable where is the file i should change?

Your shell profile, e.g., ~/.bash_profile would likely be best.  There may be other options depending on exactly how you start X.  For example, some people may use ~/.bashrc - but if you start X automatically from ~/.bash_profile as advised in the wiki, then the TERMINAL setting would not be available for your WM unless it was set above startx in bash_profile.

As an example, my shell rc file has a handful of aliases, a couple functions, and several environment variables that are intended to only be used by interactive shell sessions, but my shell profile sets one environment variable PATH which I want inherited by all X11 processes, then starts X on tty1.

Last edited by Trilby (2019-08-13 01:14:07)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB