maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   x terminal ls-command - different colors for folder/file (https://talk.maemo.org/showthread.php?t=40418)

b666m 2010-01-14 03:19

x terminal ls-command - different colors for folder/file
 
hi,

it seems like a simple problem but i'm unable to find a solution here and in google.

when using the ls-command in x terminal the output is just monochrome. everything is black on white.
but i would like to have different colors for folders and files. for example folders in blue and files in green or something.
that would be especially helpfull if the file hasn't an extension like .mp3 or .doc etc.

the option --color=always isn't recognized by ls and other options don't seem to do what i would like to see.

can anybody help?
(i'm feeling pretty dumb right now because the problem looks too simple :/)

R-R 2010-01-14 03:27

Re: x terminal ls-command - different colors for folder/file
 
Well, we need to convince nokia to ditch busybox and finally get bash and coreutils on this thing to make it perfect :-)

b666m 2010-01-14 03:31

Re: x terminal ls-command - different colors for folder/file
 
so... mhm... is there no chance of getting some color in x terminal? :/

RipTorn 2010-01-14 04:07

Re: x terminal ls-command - different colors for folder/file
 
You could possibly get bash installed and select that as a shell, I am unsure if this would work or break the device, or even if xterm supports colour at all.

jkq 2010-01-14 04:29

Re: x terminal ls-command - different colors for folder/file
 
Quote:

Originally Posted by RipTorn (Post 469625)
You could possibly get bash installed and select that as a shell, I am unsure if this would work or break the device, or even if xterm supports colour at all.

The xterm supports colors just fine. Just ssh into a linux box, run ls --color, and see the pretty colors show up as expected. As someone pointed out above, we just need to ditch busybox. :)

On the N8x0, someone had made a color-ls package. Anyone brave enough to try it and see if it works fine on the N900? :D

-jkq

RipTorn 2010-01-14 04:34

Re: x terminal ls-command - different colors for folder/file
 
well by xterm I meant x terminal on the N900 Gui. So even if bash/dash/etc was installed would colours work locally? (I suspect they would work just fine by ssh-ing into the N900)

Cheers
Rip

jkq 2010-01-14 05:00

Re: x terminal ls-command - different colors for folder/file
 
1 Attachment(s)
Quote:

Originally Posted by RipTorn (Post 469640)
well by xterm I meant x terminal on the N900 Gui. So even if bash/dash/etc was installed would colours work locally? (I suspect they would work just fine by ssh-ing into the N900)

Yes, I did too. I'm saying that the N900's XTerminal supports colors. I don't believe the shell being used has any effect on colors working in ls (or another program).

The problem is that the version of ls on the N900 does not support colored output, as it is actually busybox, not the "standard" ls found on most linux boxes. Ssh-ing into the N900 won't magically add that funtionality to ls. Using a proper version of ls on the device will make colors "work".

-jkq

ruskie 2010-01-14 07:16

Re: x terminal ls-command - different colors for folder/file
 
Feel free to install gcoreutils from my repos(see sig). That will install it and some other tools as gls and so on...

codeMonkey 2010-01-14 07:59

Re: x terminal ls-command - different colors for folder/file
 
1 Attachment(s)
Quote:

Originally Posted by jkq (Post 469637)
On the N8x0, someone had made a color-ls package. Anyone brave enough to try it and see if it works fine on the N900? :D

I've had it installed for quite a while - it works well for me, YMMV.

Attached the deb in case anyone doesn't want to install all of coreutils.
You have to install it through dpkg.

damion 2010-01-14 13:35

Re: x terminal ls-command - different colors for folder/file
 
Quote:

Originally Posted by jkq (Post 469654)
The problem is that the version of ls on the N900 does not support colored output, as it is actually busybox, not the "standard" ls found on most linux boxes. Using a proper version of ls on the device will make colors "work".

As a quick fix for some initial mental uncomfortableness in the limited shell you get by default, I copied the binary busybox from my arm linux based NAS. This busybox contains telnet and telnetd, and the ls is compiled to support rudimentary colour output (not configurable I think, but thankfully doesn't require --colo(u)r=(yes|auto) added, you'd have to alias ls otherwise as many linux dists do). I've not compared the two fully yet, as diff isn't install by default :)

Oh and I copied the built-in busybox to busybox-suid and made links for su and ping. I hope my minor tinkering isn't eating up too much space on / (only 600k out of the default 50meg left).


All times are GMT. The time now is 00:49.

vBulletin® Version 3.8.8