coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: icon support for ls


From: PΓ‘draig Brady
Subject: Re: icon support for ls
Date: Mon, 14 May 2018 22:32:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 14/05/18 15:07, Gokcehan Kara wrote:
> Hello,
> 
> Apologies if this has been discussed before.
> 
> There has been some interest for showing icons for different files in `ls`
> lately. I have found the following projects attempting this:
> 
>     https://github.com/illinoisjackson/better-ls/
>     https://github.com/ryanoasis/devicons-shell
>     https://github.com/athityakumar/colorls
> 
> There are some others trying to modify `ls` source for this purpose:
> 
>     https://github.com/illinoisjackson/even-better-ls
>     https://github.com/sebastiencs/ls-icons
> 
> Though I doubt these have been submitted back as patches.
> 
> There are already some interesting unicode icons in the standard:
> 
>     πŸ—€ Folder         U+1F5C0
>     πŸ— Open Folder    U+1F5C1
>     πŸ—‹ Empty Document U+1F5CB
>     πŸ—Œ Empty Page     U+1F5CC
>     πŸ— Empty Pages    U+1F5CD
>     πŸ—Ž Document       U+1F5CE
>     πŸ— Page           U+1F5CF
>     πŸ— Pages          U+1F5D0
> 
> There are also specialized fonts with support for various icons:
> 
>     https://github.com/ryanoasis/nerd-fonts
>     https://github.com/sebastiencs/icons-in-terminal
> 
> I was thinking a similar mechanism as the color option could be used for
> icons
> as well. Maybe `dircolors` can be used to export an `$LS_ICONS` variable
> from a
> configuration file. Or maybe this could be directly added to `$LS_COLORS`
> variable somehow.
> 
> What do you think such a feature?

An interesting proposal, though less general on the terminal due
to space available and alignment considerations.

Note you can sort of hack it now with LS_COLORS like:

LS_COLORS='lc=:rc=:rs=:'
LS_COLORS="${LS_COLORS}di=πŸ—€ :fi=πŸ—‹ :ln=  :do=  :cd=  :bd=  :so=  :pi=  :"
LS_COLORS="${LS_COLORS}ex=:tw=:ow=:st=:su=:sg=:"
export LS_COLORS

Which generates nicely aligned output on my terminal at least:
For example: ls /proc/$$

πŸ—€ attr               cwd      πŸ—‹ loginuid    πŸ—‹ numa_maps      πŸ—‹ schedstat  πŸ—€ task
πŸ—‹ autogroup        πŸ—‹ environ  πŸ—€ map_files   πŸ—‹ oom_adj        πŸ—‹ sessionid  πŸ—‹ 
timers
πŸ—‹ auxv               exe      πŸ—‹ maps        πŸ—‹ oom_score      πŸ—‹ setgroups  πŸ—‹ 
timerslack_ns
πŸ—‹ cgroup           πŸ—€ fd       πŸ—‹ mem         πŸ—‹ oom_score_adj  πŸ—‹ smaps      πŸ—‹ 
uid_map
πŸ—‹ clear_refs       πŸ—€ fdinfo   πŸ—‹ mountinfo   πŸ—‹ pagemap        πŸ—‹ stack      πŸ—‹ 
wchan
πŸ—‹ cmdline          πŸ—‹ gid_map  πŸ—‹ mounts      πŸ—‹ personality    πŸ—‹ stat
πŸ—‹ comm             πŸ—‹ io       πŸ—‹ mountstats  πŸ—‹ projid_map     πŸ—‹ statm
πŸ—‹ coredump_filter  πŸ—‹ latency  πŸ—€ net           root           πŸ—‹ status
πŸ—‹ cpuset           πŸ—‹ limits   πŸ—€ ns          πŸ—‹ sched          πŸ—‹ syscall

cheers,
PΓ‘draig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]