Code Monkey home page Code Monkey logo

ls-icons's Introduction

image

Overview

This is a fork of coreutils with a modified ls that print icons

Dependencies

Installation

You need to install icons-in-terminal first.

  • Once installed, you can run:
$ ./bootstrap
$ export CFLAGS=-DNO_TRUE_COLOURS=1 # Execute this line _only_ if your terminal doesn't support true colours
$ export CC=clang CXX=clang++
$ ./configure --prefix=/opt/coreutils
$ make
$ make install
$ /opt/coreutils/bin/ls

You can check if your terminal support true colours here.

Customization

  • You can change colors in src/ls-icons.c.
  • To add new icons with file extensions, modify the array file_matches in src/ls-icons.c. Pull requests are welcome

ls-icons's People

Contributors

agordon avatar andreas-schwab avatar auerswal avatar benoitknecht avatar bernhard-voelker avatar bhaible avatar chenguo avatar ebblake avatar eggert avatar gigabo avatar giuseppe avatar innerout avatar jamesyoungman avatar jarkkojs avatar jas4711 avatar jeremy-compostella avatar jidanni avatar jojo-schmitz avatar kdudka avatar ldv-alt avatar meyering avatar nickalcock avatar ovasik avatar pibroch avatar pixelb avatar sebastiencs avatar slattarini avatar stephane avatar stoeckmann avatar vapier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ls-icons's Issues

Incorrect Icons

Hi!

The icons for pdf files, images and databases aren't showing up for me as intended.

2017-08-09-200456_1168x128_scrot

Terminator - v1.91; Ubuntu 17.04

lib/careadlinkat.c

lib/careadlinkat.c: In function 'careadlinkat':
cc1: error: function may return address of local variable [-Werror=return-local-addr]
lib/careadlinkat.c:73:8: note: declared here
73 | char stack_buf[1024];
| ^~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:10024: lib/careadlinkat.o] Error 1
make[2]: Leaving directory '/media/root/download/icons-in-terminal/ls-icons'
make[1]: *** [Makefile:12675: all-recursive] Error 1
make[1]: Leaving directory '/media/root/download/icons-in-terminal/ls-icons'
make: *** [Makefile:6835: all] Error 2

help

multiple definition of `minus_zero'

using clang, on devuan aarch64
coreutils Version: 8.32-4.1

/usr/bin/ld: lib/libcoreutils.a(strtold.o):(.data+0x0): multiple definition of `minus_zero'; lib/libcoreutils.a(strtod.o):(.data+0x0): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:9028: src/od] Error 1
make[2]: Leaving directory '/media/sd/Projects/ascii/ls-icons'
make[1]: *** [Makefile:12678: all-recursive] Error 1
make[1]: Leaving directory '/media/sd/Projects/ascii/ls-icons'

No reference to this build error was found in 'gotchas'
Websearch returned:
https://www.mail-archive.com/[email protected]/msg36503.html

Resolution is beyond me. Is it a 'your system is weird' problem, or a legitimate issue with ls-icons?

Different colors for icons and filenames

Say LS_COLORS has red for video files and the ls-icons icon has some other color, say magenta. Now if I do /opt/coreutils/bin/ls --color then the ls-icons icon for video files has the same color as that of LS_COLORS, i.e red.

Is it possible to have different colors for the icons and filenames?

Make failed with error: function may return address of local variable

Make command failed with error as follows:
$ sudo make
make all-recursive
make[1]: Entering directory '/home/reuben/Downloads/Programs/ls-icons'
Making all in po
make[2]: Entering directory '/home/reuben/Downloads/Programs/ls-icons/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons/po'
Making all in .
make[2]: Entering directory '/home/reuben/Downloads/Programs/ls-icons'
CC src/chroot.o
CC src/version.o
AR src/libver.a
CC lib/copy-acl.o
CC lib/set-acl.o
CC lib/acl-errno-valid.o
CC lib/acl-internal.o
CC lib/get-permissions.o
CC lib/set-permissions.o
CC lib/allocator.o
CC lib/areadlink.o
CC lib/areadlink-with-size.o
CC lib/areadlinkat.o
CC lib/argmatch.o
CC lib/argv-iter.o
CC lib/backupfile.o
CC lib/backup-rename.o
CC lib/backup-find.o
CC lib/base32.o
CC lib/base64.o
CC lib/binary-io.o
CC lib/bitrotate.o
CC lib/c-strcasecmp.o
CC lib/c-strncasecmp.o
CC lib/c-strtod.o
CC lib/c-strtold.o
CC lib/canon-host.o
CC lib/canonicalize.o
CC lib/careadlinkat.o
lib/careadlinkat.c: In function 'careadlinkat':
cc1: error: function may return address of local variable [-Werror=return-local-addr]
lib/careadlinkat.c:73:8: note: declared here
73 | char stack_buf[1024];
| ^~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:10024: lib/careadlinkat.o] Error 1
make[2]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons'
make[1]: *** [Makefile:12675: all-recursive] Error 1
make[1]: Leaving directory '/home/reuben/Downloads/Programs/ls-icons'
make: *** [Makefile:6835: all] Error 2

Before this, I ran "$ sudo ./configure --prefix=/opt/coreutils FORCE_UNSAFE_CONFIGURE=1". I did this as it gave me an error when i ran it without the flag as follows:
$ sudo ./configure --prefix=/opt/coreutils
...
checking whether mkfifo rejects trailing slashes... yes
checking whether mknod can create fifo without root privileges... configure: error: in /home/reuben/Downloads/Programs/ls-icons': configure: **error:** you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check) See config.log' for more details

Before that, I'd run "$ export CC=clang CXX=clang++" and "$ ./bootstrap" as instructed

My system details:-
$ uname -a
Linux reubens-fedora 5.12.14-300.fc34.x86_64 #1 SMP Wed Jun 30 18:30:21 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
OS: Fedora 34
Terminal: Alacritty [0.8.0]

PS: it'd be great if someone could package it for non-debian based OSes instead of us having to build it from source.
config.log

The <sys/sysctl.h> header is deprecated and will be removed.

In file included from lib/nproc.c:50:
/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: error: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror=cpp]
21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
| ^~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:10024: lib/nproc.o] Error 1
make[2]: Leaving directory '/home/bq666/Downloads/ls-icons'
make[1]: *** [Makefile:12675: all-recursive] Error 1
make[1]: Leaving directory '/home/bq666/Downloads/ls-icons'
make: *** [Makefile:6835: all] Error 2

checking whether the C compiler works... no C compiler cannot create executables

Hi im using manjaro OS, and i have already install clang with pacman package management.

when i run

 ./configure --prefix=/opt/coreutils 

i get this error.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/home/anasr/ls-icons':
configure: error: C compiler cannot create executables
See `config.log' for more details

any solutions for this ? thanks.

Suggestion for the dev: don't create the ls executable

Hello, first of all thank you for your work.

Usually, when you create tools, you should not use an already used command name, like ls, that is the one you created in /opt/coreutils folder.

The best approach is to use a new name, to be stored in /usr/bin called, for example, ls-icons, and then a user can choose to use it by creating an alias like alias ls=ls-icons --color=auto.

Please, implement the new name. Take as example this project: https://github.com/Yash-Handa/logo-ls#recommended-configurations

Uninstalling

How can I uninstall all the things that were installed?

I already uninstall icons-in-terminal and delete the following line in .bashrc file:

alias ls="/opt/coreutils/bin/ls"

But when I use ls I get this output
image

EDIT: this was actually solved just by running exec bash after deleting the line mentioned before on .bashrc.

I'm still wondering if I have to delete dependencies in order to fully uninstall it. Is there a script within the project that make this automatically or do I have to uninstall all dependencies manually? Or just deleting the project directory is enough?

error bootstrap

Submodule 'gnulib' (git://git.sv.gnu.org/gnulib.git) registered for path 'gnulib'
Cloning into '/home/gentux/ls-icons/gnulib'...
Submodule path 'gnulib': checked out '188d87b05190690d6f8b0577ec65ef221a711d08'
./bootstrap: getting translations into po/.reference for coreutils...

Icons in VSCode

In a normal terminal the icons are shown without any issue but as soon as I open a terminal inside vscode the icons aren't detected anymore. Is there a known fix for this?

configure: error: C compiler cannot create executables

When I type the command './configure --prefix=/opt/coreutils' one of the results goes like this 'configure: error: C compiler cannot create executables' everything else said 'yes'

I dont know how to make it works, if you need some information please let me know

thank you
Im on Ubuntu 18.04

Do not work on ubuntu fresh install

export CFLAGS=-DNO_TRUE_COLOURS=1; export CC=clang CXX=clang++; ./configure CC=gcc --prefix=/opt/coreutils; make clean; make

error on make

  CC       lib/opendirat.o
  CC       lib/parse-datetime.o
  CC       lib/physmem.o
  CC       lib/pipe2.o
  CC       lib/posixtm.o
lib/posixtm.c: In function 'posixtime':
lib/posixtm.c:217:9: error: '__builtin_memcpy' writing 3 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  217 |         strcpy (b - 2, "59");
      |         ^~~~~~~~~~~~~~~~~~~~
lib/posixtm.c:215:14: note: at offset -2 into destination object 'buf' of size 16
  215 |         char buf[16];
      |              ^~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:10027: lib/posixtm.o] Error 1
make[2]: Leaving directory '/home/duard/Downloads/ls-icons'
make[1]: *** [Makefile:12678: all-recursive] Error 1
make[1]: Leaving directory '/home/duard/Downloads/ls-icons'
make: *** [Makefile:6838: all] Error 2

bug-gnulib - Cannot compile

lib/freadseek.c:68:3: error: "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to
bug-gnulib."
#error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
^
1 error generated.

Redundant with original ls

The original LS has dir_colors for generating the LS_COLORS attributes, which already supports console escape sequences which permits mapping unicode character sets to file types:

This for example, when the below is added to ~/.dir_colors, it will make all rc resource files light green in appearance and set the alpine linux icon when using NerdFonts:
*rc 36m๏Œ€ \e[36

I recommend updating the project/readme with the above details to assist in disseminating this information so that as a community we can focus on improving our file type mappings with contributions to https://github.com/trapd00r/LS_COLORS additional icon/color mappings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.