LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-23-2005, 02:25 PM   #1
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Rep: Reputation: 30
ls - setting colours as default?


Hi, I like using "ls" a lot to prble the folder I'm in,
but in slackware the input is not coloured by
default.
Where can I change this setting?

Thanks,
Riddick
 
Old 08-23-2005, 02:32 PM   #2
objorkum
Member
 
Registered: Aug 2003
Location: Norway
Distribution: Slackware 10.0
Posts: 231

Rep: Reputation: 30
Yes it is, but it depends how you launch your terminal.

If the terminal uses /etc/profile, then it should load /etc/DIR_COLORS

For example if you use xterm, you should launch it this way:

xterm -ls
 
Old 08-23-2005, 02:44 PM   #3
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Original Poster
Rep: Reputation: 30
I would be using Konsole and the runlevel 3 interface.
I'll try ?etc?profile and see how it goes, Thanks!
 
Old 08-23-2005, 02:46 PM   #4
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Original Poster
Rep: Reputation: 30
! there isd a line already in there that seems to be doing this already - why is it not being picked up?
 
Old 08-23-2005, 03:31 PM   #5
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
Quote:
Riddick:: there isd a line already in there that seems to be doing this already - why is it not being picked up?
Which line ? Which file ? What does "isd" mean ? Please, if you want to get useful help, try to give more details as we (I?) can read in your mind !

-- LiNuCe
 
Old 08-23-2005, 03:39 PM   #6
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Original Poster
Rep: Reputation: 30
isd = is - an easy mistake since the letters are close together.
I'll try to write out as much of it as i can:

if ["$SHELL" = "/bin/zsh"];then
eval 'dircolors -z'

and 3 more cases like this (ash -> -s and nothing = -b)

OK?

Any ideas?
 
Old 08-23-2005, 03:47 PM   #7
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
Ok, just add the following line in your ~/.bashrc file :

Code:
eval `dircolors -b`
If you do not have a ~/.bashrc file, create it.

-- LiNuCe

Last edited by LiNuCe; 08-23-2005 at 11:38 PM.
 
Old 08-23-2005, 03:58 PM   #8
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Riddick the colors are loaded by default when /etc/profile is read.
The problem is when terminals do not start as login consoles, they won't read /etc/profile. If i'm not wrong, there's a checkbox on Konsole to tell it to read the startup files, it should be something like Login console.
 
Old 08-23-2005, 05:30 PM   #9
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Quote:
Originally posted by gbonvehi
Riddick the colors are loaded by default when /etc/profile is read.
The problem is when terminals do not start as login consoles, they won't read /etc/profile. If i'm not wrong, there's a checkbox on Konsole to tell it to read the startup files, it should be something like Login console.
This explains why, when using "su -" to root (or to any other user) it will start showing the colors. Very interesting.

What about for fluxbox/blackbox? We don't have handy checkboxes

Edit: See what a long day at work will do to you? You ask silly questions, that's what! .bash_profile or .bashrc of course is the answer

Last edited by Poetics; 08-23-2005 at 05:48 PM.
 
Old 08-23-2005, 10:41 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Poetics you've command line parameters to run consoles as login consoles, no need for checkbox
As objorkum suggested, xterm -ls is one of them.

You could also use .bash_profile or .bashrc as you said, i think the first one is read only when used login consoles too, but I'm not sure about that, but a quick read at bash man pages will tell..
 
Old 08-23-2005, 11:07 PM   #11
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
I threw the above lines into .bash_profile and happened to have .bashrc linked to it. Logged out, back in, ran fluxbox and rxvt ran in all it's colorful glory! Now just to figure out how to set the transpancy and choose my own colors.

But I have a few other matters of import to get to first (you can see the related thread here in the Slack forum)!

Last edited by Poetics; 08-23-2005 at 11:08 PM.
 
Old 08-24-2005, 03:47 AM   #12
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.2
Posts: 1,491

Rep: Reputation: 50
is it possible to still have the colours when you pipe into 'less' or similar?

Always wondered that......
 
Old 08-24-2005, 03:27 PM   #13
Riddick
Member
 
Registered: May 2004
Location: Rome, Italy
Distribution: slackware-current
Posts: 454

Original Poster
Rep: Reputation: 30
excellent - thanks!
 
Old 08-25-2005, 12:52 PM   #14
ghight
Member
 
Registered: Jan 2003
Location: Indiana
Distribution: Centos, RedHat Enterprise, Slackware
Posts: 524

Rep: Reputation: 30
When you open Konsole, go to the sessions menu and click Linux Console. This will read the setup files as requested. Also you could edit the Konsole icon command to simply say 'xterm' instead of the default 'konsole'.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting the default GW permanently hcclnoodles Linux - Networking 6 09-15-2005 09:38 AM
setting a default browser imagineaxion Mandriva 12 01-07-2005 12:16 AM
setting default page size and default tray lived4eva Linux - General 1 11-04-2003 02:39 PM
setting default browser? tombomb300 Linux - Software 1 10-19-2003 07:14 PM
setting up your default editor tarballed Linux - Newbie 2 08-19-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration