[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