You are not logged in.

#1 2018-01-29 15:04:15

ap
Member
Registered: 2017-08-09
Posts: 47

[SOLVED] solarized urxvt can't change colors of directories and files

Hi all! I used a solarized theme for everything (terminal, mutt, vim, irssi, tmux etc....even matlab!) and one very minor thing I would like to change is the colors of directories and files displayed by ls. I use urxvt in the 256color version...back in the days I would grab a color theme and put it in .dircolors and that would do the trick, but now this doesn't seem to change my ls colours

I would like to use this https://github.com/seebi/dircolors-solarized or anything else to achieve the desired result, but again, putting themes in .dircolours does not have any effect although in my .bashrc I have

if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

Anyone has any suggestion on how to solve this?
Thanks!

Last edited by ap (2018-01-31 04:40:59)

Offline

#2 2018-01-29 15:53:02

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: [SOLVED] solarized urxvt can't change colors of directories and files

This works for me:

mkdir -p ~/git && cd ~/git
git clone http://github.com/seebi/dircolors-solarized
cp ~/git/dircolors-solarized/dircolors.ansi-universal ~/.dir_colors
echo 'eval $(dircolors ~/.dir_colors)' >> ~/.bashrc

Any new terminals opened after those invocations now use the new scheme.

Last edited by Head_on_a_Stick (2018-01-29 15:59:15)

Offline

#3 2018-01-30 01:05:48

ap
Member
Registered: 2017-08-09
Posts: 47

Re: [SOLVED] solarized urxvt can't change colors of directories and files

Hi Head_on_a_Stick thanks for your help. That's exactly what I am doing; I have tried with different themes but no change...the ls colouring remains always the same, like the standard one I would have with no theme. If you have any other suggestion, please let me know, thanks smile

Offline

#4 2018-01-30 09:06:01

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: [SOLVED] solarized urxvt can't change colors of directories and files

Please post the full content of ~/.bashrc and also the output of

ls -a ~

I really don't see the point of testing to see if /usr/bin/dircolors or ~/.dir_colors exists if you already know they're there — those sort of conditionals are used by distributions to cover all use-cases but for your own set up they're just slowing things down.

Offline

#5 2018-01-30 12:10:28

ap
Member
Registered: 2017-08-09
Posts: 47

Re: [SOLVED] solarized urxvt can't change colors of directories and files

hi there smile this is the output of my ls -a ~

.                      Documents         .gnupg          MEGA                    .spss
..                     Downloads         .Graphboard     .moonchild productions  .subversion
anaconda2              Drive             .gtk-bookmarks  .mozilla                Templates
.bash_history          .dropbox          .gtkrc-2.0      Music                   .thumbnails
.bash_logout           Dropbox           IBM             .nano                   Videos
.bashrc                .dropbox-dist     .IBM            .nanorc                 .vim
.bashrc-anaconda2.bak  .ew.json          .icons          Pictures                .viminfo
.cache                 .expressvpn.conf  .ipython        .pki                    .vimrc
.calcurse              .fehbg            .irssi          .profile                .w3m
.conda                 .gconf            .JASP           .psychopy2              .Xauthority
.config                .gdfuse           .java           Public                  .Xresources
.dbus                  .gimp-2.8         .jupyter        R                       .xscreensaver
Desktop                .gksu.lock        .local          .Rhistory               .xsession-errors
.dir_colors            .gnome2           .matlab         .rstudio-desktop
.dmenu_cache           .gnome2_private   MATLAB          .selected_editor

my bashrc it's an unmodified one...the only few additions I have at the bottom are

alias vol='pactl set-sink-volume 0'
alias s='subliminal download -l en'
alias mdrive='google-drive-ocamlfuse /home/ap/Drive'
alias udrive='fusermount -u /home/ap/Drive'
alias e='expressvpn connect'
alias f='expressvpn disconnect'
#alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
alias v='vim'

#vim-live-latex-preview executables
export PATH="~/.vim/bundle/vim-live-latex-preview/bin:$PATH"
 
#xterm transparency
[ -n "$XTERM_VERSION" ] && transset-df .9 --id "$WINDOWID" >/dev/null
# added by Anaconda2 installer
export PATH="/home/ap/anaconda2/bin:$PATH"

#PS1='\[\033[01;32m\]\u\[\033[01;34m\]@\[\033[01;31m\]\h\[\033[00;34m\]{\[\033[01;34m\]\w\[\033[00;34m\]}\[\033[01;32m\]:\[\033[00m\]'


GRAY='\[\033[0m\]'
GREEN='\[\033[0;32m\]'
PURPLE='\[\033[0;35m\]'

PS1="${GREEN}\u ${GRAY}\w ${PURPLE}>> ${GRAY}"

#if [ -f `which powerline-daemon` ]; then
#  powerline-daemon -q
#  POWERLINE_BASH_CONTINUATION=1
#  POWERLINE_BASH_SELECT=1
#  . /usr/share/powerline/bindings/bash/powerline.sh
#fi

that's all. I noticed that also on a second machine with debian, the dircolors theme are not applied and also on my work machine (ubuntu 16.04). Is it possible that this behaviour is due to the solarized palette from https://github.com/altercation that I use in urxvt and xterm?

Last edited by ap (2018-01-30 12:11:21)

Offline

#6 2018-01-30 17:27:35

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: [SOLVED] solarized urxvt can't change colors of directories and files

Well, you certainly have ~/.dir_colors but you are lacking the `eval` command in your ~/.bashrc

Add it now and then open a new terminal to test:

echo 'eval $(dircolors ~/.dir_colors)' >> ~/.bashrc

^ Be sure to run that command as your normal user, it won't work if you run it as root wink

Offline

#7 2018-01-31 04:45:38

ap
Member
Registered: 2017-08-09
Posts: 47

Re: [SOLVED] solarized urxvt can't change colors of directories and files

I had removed "echo 'eval $(dircolors ~/.dir_colors)' >> ~/.bashrc" since nothing changed by including it...anyway, I tried again and followed all steps. After a reboot now everything is working as it should :-D I could have probably tried this before...but if I remember correctly, when I did this in the past the ls colouring did not need a reboot but just a restart of the terminal. Anyway, solved! Thanks a lot

Offline

Board footer

Powered by FluxBB