You are not logged in.

#1 2020-11-30 21:11:49

webcapcha
Member
Registered: 2019-02-14
Posts: 167

echo $LS_COLORS in tty2 is empty

I downloaded dir_colors from https://github.com/seebi/dircolors-solarized
And it works inside konsole terminal but not for tty (ctrl+alt+f2)

I have pretty much customization in .bashrc file which is available with link http://ix.io/2G4W

Guessing that some of that settings conflict with tty LS_COLORS environment variable, because if I try to do echo $LS_COLORS there it returning no results.


Ukrainian

Offline

#2 2020-11-30 21:54:06

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

Re: echo $LS_COLORS in tty2 is empty

if [[ "$TERM" != "linux" && -f "$XDG_CONFIG_HOME/dircolors.ansi.dark" ]]; then


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-11-30 21:59:07

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

wait but later is elif section

elif [[ -f "$XDG_CONFIG_HOME/dircolors" ]]; then

Ukrainian

Offline

#4 2020-12-01 00:17:38

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

Re: echo $LS_COLORS in tty2 is empty

And do you have such a file?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-12-01 05:56:08

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

of course


Ukrainian

Offline

#6 2020-12-01 06:41:05

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: echo $LS_COLORS in tty2 is empty

Please go over your whole bashrc and debug it:

if [ -e $HOME/.bash_functions ]; then
    source $HOME/.bash_functions
fi

if [ -e $HOME/.bash_variables ]; then
    source $HOME/.bash_functions
fi

If it's still broken afterwards, debug all the files you source.

Offline

#7 2020-12-01 09:09:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,687

Re: echo $LS_COLORS in tty2 is empty

I'd esp. also look into $XDG_CONFIG_HOME …

Offline

#8 2020-12-01 09:18:26

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

Awebb wrote:

If it's still broken afterwards, debug all the files you source.

Thanks for pointing me a mistype, bash_variables it's a leftover. It was empty. I removed it.

I'd esp. also look into $XDG_CONFIG_HOME …

cat $XDG_CONFIG_HOME/dircolors.ansi.dark

Gives me output, so no mistypes here. And properly file dircolors.ansi.dark, for now, has been downloaded from github (first message)


Ukrainian

Offline

#9 2020-12-01 10:26:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,687

Re: echo $LS_COLORS in tty2 is empty

I the script or an interactive shell?
What's "echo $XDG_CONFIG_HOME"
Does

# Dir colors
if [[ "$TERM" != "linux" && -f "$XDG_CONFIG_HOME/dircolors.ansi.dark" ]]; then
    eval $(dircolors "$XDG_CONFIG_HOME/dircolors.ansi.dark")
elif [[ -f "$XDG_CONFIG_HOME/dircolors" ]]; then
    dircolors "$XDG_CONFIG_HOME/dircolors"
    eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
fi

get you the expectable output?

Offline

#10 2020-12-01 11:26:40

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

0 webcapcha@home-laptop:~$ echo $XDG_CONFIG_HOME
/home/webcapcha/.config

Now I've rewritten as
# Dir colors

if [[ -f "$XDG_CONFIG_HOME/dircolors.ansi.dark" ]]; then
    eval $(dircolors "$XDG_CONFIG_HOME/dircolors.ansi.dark")
elif [[ -f "$XDG_CONFIG_HOME/dircolors" ]]; then
    eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
fi

So, didn't get, what do you mean expectable output?


Ukrainian

Offline

#11 2020-12-01 11:28:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,687

Re: echo $LS_COLORS in tty2 is empty

*NOT* in an interactive shell.
If you run dircolors in that segment it should print the variable that would be set by the following eval - does that happen?

Offline

#12 2020-12-01 13:37:35

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

well, is it correct that you mean to comment out

# [[ $- != *i* ]] && return

and try?

But even in this case shell is interactive.


Ukrainian

Offline

#13 2020-12-01 13:38:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,687

Re: echo $LS_COLORS in tty2 is empty

I want you to not inspect the variable by typing something into a shell but inside the bashrc.

Offline

#14 2020-12-01 13:45:51

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

Re: echo $LS_COLORS in tty2 is empty

webcapcha wrote:
cat $XDG_CONFIG_HOME/dircolors.ansi.dark

Gives me output, so no mistypes here.

That much has been obvious from the start - that would never have been in question based on your symptoms.  What would be relevant is whether the following different command produces output - and specifically if it produces the output you want to use for your colors in the tty, which, for some unspecified reason, are different than the colors you are trying to use elsewhere:

cat $XDG_CONFIG_HOME/dircolors

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2020-12-01 13:47:16

webcapcha
Member
Registered: 2019-02-14
Posts: 167

Re: echo $LS_COLORS in tty2 is empty

So I simply added echo $XDG_CONFIG_HOME in .bashrc
and then source it

0 webcapcha@home-laptop:~$ source .bashrc 
/home/webcapcha/.config

Ukrainian

Offline

#16 2020-12-01 13:48:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,687

Re: echo $LS_COLORS in tty2 is empty

I give up. This is going nowhere.

Offline

Board footer

Powered by FluxBB