Giter Site home page Giter Site logo

yash-handa / logo-ls Goto Github PK

View Code? Open in Web Editor NEW
1.1K 13.0 45.0 5.41 MB

Modern ls command with vscode like File Icon and Git Integrations. Written in Golang

License: MIT License

Go 99.74% Shell 0.26%
logo-ls ls eyecandy git icons speed golang cli-app vscode

logo-ls's Introduction

OpenSource go cli

logo-ls

GitHub go.mod Go version GitHub tag (latest SemVer) PRs AUR deb rpm linux apple Go

modern ls command with beautiful Icons and Git Integrations . Written in Golang

logo-ls

Command and Arguments supported are listed in HELP.md

Table of contents

Features

⬆️ TOC

This project is build to add esthetics to ls(coreutiles) command

  • Over 250+ icons 😎
  • Supporting 600+ files, extensions and directories
  • 16 Million, true colors supported
  • Git Status Integration
  • 🐎 Near native speed. (thanks to Golang)
  • Language agnostic binaries

This project is highly inspired by ls(coreutiles) and color ls. The project tries to find a happy path between speed and aesthetics.

Usage

⬆️ TOC

All supported flags can be found by using help flag $ logo-ls -?. The same has been provided as HELP.md.

The project also has its manpage which can be accessed by man logo-ls

Flags

Almost all flags are same as that of the classic ls command and behave similarly. The project can be used as a drop-in replacement for the ls(coreutiles)

  • With -1: List one entry per line
logo-ls -1

  • With -a (or) --all : Does not ignore entries starting with '.'
logo-ls -a

  • With -A (or) --almost-all : Does not ignore entries starting with '.', except ./ and ../
logo-ls -A

  • With -D (or) --git-status: Add Git Status to the listed Files and Directory
    • Note: As much I would love to make this the default behavior of the command but showing git status is an intensive task and may slow (a tiny bit) the command itself. If you want you can make alias to the command with -D applied to it.
logo-ls -D

  • With -l: Shows in long listing format other similar commands are:
    • -o: like -l, but do not list group information
    • -g: like -l, but do not list owner
    • -G (or) --no-group: in a long listing, don't print group names
logo-ls -l

  • With -R (or) --recursive: list subdirectories recursively
logo-ls -R

  • With -? (or) --help: print the help message
    • similar message can be found at HELP.md.
logo-ls -?

  • Sorting: There are many sorting flags available [default is alphabetic order]
    • With -t: sort by modification time, newest first
    • With -S: sort by file size, largest first
    • With -X: sort alphabetically by entry extension
    • With -U: do not sort; list entries in directory order
    • With -v: natural sort of (version) numbers within text
    • With -r (or) -reverse: reverse order while sorting
logo-ls -X

  • With -T (or) --time-style=value: set time/date format in long formats (-l, -o, -g). There are many options to chose from all are listed in HELP.md.
logo-ls -T

  • With -i (or) --disable-icon: don't print icons of the files
logo-ls -i

  • With -c (or) --disable-color: don't color icons, filenames and git status
    • Note: use a combination of -ic to print output to a file $ logo-ls -ic > t.txt
logo-ls -c

For all available commands see manpage or HELP.md

Combination of flags

This project uses getopt which is a golang variant of the classic getopt utility used in ls(coreutiles). Thus any combination of flags are possible and can be used.

logo-ls with flag combination

Multiple Files and Directories

You can provide multiple files and directories as command argument [default to PWD] and all will be displayed accordingly.

logo-ls  with multiple files

Prerequisites

⬆️ TOC

For proper working of logo-ls the following should be set

  • UTF-8: The terminal should be UTF-8 encoded (Can display Unicode-Code Point)
  • True Color Support: The terminal can display color (16 Million Colors). for more information of True Color and supported Terminals see here
  • Nerd Fonts: Nerd fonts are required to display Icons on screen. Basically Nerd Fonts patches your current font i.e., the last few unicode points (approx 2,824 out of 143,859) in the font are replaced with nerdy icons 🤓. The complete patching process is given here

Installation

⬆️ TOC

Installation is very easy and straight forward with many options to choose from.

As of now almost all installation methods require downloading resources from the Github Release page of the project, so to be a bit more secure consider Checking the Signature of logo-ls_SHA512sums.txt text file and then use this file to check weather the resource have been tampered. This complete process is explained in more detail in Check the downloaded Resource section below. (This is a recommended step and not at all required)

Debian (.deb package)

If you are on Debian or any other Debian based distribution then installation is simple.

Step 1

Download the .deb package from Github Release Page. Available OS_Architectures include: i386, amd64, arm64 and armV6. Check your downloaded resource(s) if you like.

Step 2

Use the dpkg -i path/to/downloaded/resource/ to install the binary and the manpage

Red Hat (.rpm package)

If you are on Red Hat or any other Red Hat based distribution (like fedora) then installation is simple.

Step 1

Download the .rpm package from Github Release Page. Available OS_Architectures include: i386, amd64, arm64 and armV6. Check your downloaded resource(s) if you like.

Step 2

Use the rpm -i path/to/downloaded/resource/ to install the binary and the manpage

Arch linux

Simply run yay -S logo-ls. (Or use the AUR helper of your choice)

Alternatively you can clone the PKGBUILD and build the package manually:

git clone https://aur.archlinux.org/logo-ls.git
cd logo-ls
makepkg -si

MacOS (Darwin)

To install logo-ls on darwin you have to download the binary. Support for Homebrew will come soon

Step 1

Download logo-ls_Darwin_x86_64.tar.gz from Github Release Page.

Step 2

Extract a gzipped archive in the current directory.

$ tar -xzf logo-ls_Darwin_x86_64.tar.gz

This will produce logo-ls_Darwin_x86_64 directory in the current directory with the following files: HELP.md, LICENSE, logo-ls and logo-ls.1.gz

Step 3

Install the binary logo-ls by placing it in /usr/local/bin

$ cd logo-ls_Darwin_x86_64
$ sudo cp logo-ls /usr/local/bin

Step 4

If you want the man page of logo-ls place logo-ls.1.gz in /usr/local/share/man/man1/

$ sudo cp logo-ls.1.gz /usr/local/share/man/man1/

Linux

To install logo-ls on any other Linux Distribution you have to download the binary.

Step 1

Download the .tar.gz archive from Github Release Page. Available OS_Arch include: i386, x86_64 (amd64), arm64 and armV6. Check your downloaded resource(s) if you like.

Step 2

Extract a gzipped archive in the current directory.

$ tar -xzf logo-ls_Linux_[ARCH].tar.gz

This will produce logo-ls_Linux_[ARCH] directory in the current directory with the following files: HELP.md, LICENSE, logo-ls and logo-ls.1.gz

Step 3

Install the binary logo-ls by placing it in /usr/local/bin

$ cd logo-ls_Linux_[ARCH]
$ sudo cp logo-ls /usr/local/bin

Step 4

If you want the man page of logo-ls place logo-ls.1.gz in /usr/share/man/man1/

$ sudo cp logo-ls.1.gz /usr/share/man/man1/

go get

If you have Golang installed on your system then the logo-ls can be downloaded and installed using the the go cli tool provided by the language

Step 1

The go cli installs the binary in the directory specified by $GOBIN env variable [default: ~/go/bin/]. In order to call logo-ls from anywhere in user-space, this directory which holds the binary must be present in $PATH env variable.

$ echo $PATH

Step 2

Now simply install the binary using go get in home directory

$ cd ~
$ go get github.com/Yash-Handa/logo-ls

Build from Source

It is quite simple to build the command from source. You should have Golang installed on your system.

Step 1

Clone this repository.

$ git clone https://github.com/Yash-Handa/logo-ls.git

Step 2

cd into the directory logo-ls. Then run go mod tidy to download the dependencies and after that go build to build your system specific binary

$ cd logo-ls
$ go mod tidy
$ go build

the go build command will produce logo-ls executable binary in the current directory.

Step 3

Place the logo-ls executable in a directory reachable from $PATH env variable.

$ sudo cp logo-ls /usr/local/bin

Step 4

If you want the man page of logo-ls place logo-ls.1.gz in /usr/share/man/man1/

$ sudo cp logo-ls.1.gz /usr/share/man/man1/

Check the downloaded Resource

After downloading the Resource(s) from the Github Release Page follow the below steps to check its authenticity.

Step 1

Download logo-ls_SHA512sums.txt.sig and logo-ls_SHA512sums.txt from Github Release Page and place them in the same directory as of the downloaded resource(s)

Step 2

Receive the public key of the signing party from keyserver.ubuntu.com server. This will add the developer's public key to your keyring.

$ gpg2 --keyid-format long --keyserver keyserver.ubuntu.com --recv-keys 0x28182066bcacccb2

gpg: key 28182066BCACCCB2: "Yash Handa (logo-ls) <[email protected]>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

Step 3

check the signature on logo-ls_SHA512sums.txt

$ gpg2 --keyid-format long --verify logo-ls_SHA512sums.txt.sig logo-ls_SHA512sums.txt

gpg: Signature made Tue 08 Sep 2020 10:21:52 PM IST
gpg:                using RSA key D9498B225223344C0205FDF528182066BCACCCB2
gpg: Good signature from "Yash Handa (logo-ls) <[email protected]>" [ultimate]

A Good signature means that the checked file was definitely signed by the owner of the keyfile stated (if they didn’t match, the signature would be reported as BAD)

Step 4

Use logo-ls_SHA512sums.txt file to verify the authenticity of the downloaded resource(s)

$ sha512sum -c logo-ls_SHA512sums.txt 2>&1 | grep OK

logo-ls_Linux_x86_64.tar.gz: OK
logo-ls_Linux_arm64.tar.gz: OK
logo-ls_Darwin_x86_64.tar.gz: OK
logo-ls_Linux_i386.tar.gz: OK
logo-ls_Linux_armv6.tar.gz: OK

Recommended configurations

⬆️ TOC

To add some short command (say, ils or ls) with some flag options by default, add this to your shell configuration file (~/.bashrc, ~/.zshrc, etc.) :

alias ils='logo-ls'
alias ila='logo-ls -A'
alias ill='logo-ls -al'
# equivalents with Git Status on by Default
alias ilsg='logo-ls -D'
alias ilag='logo-ls -AD'
alias illg='logo-ls -alD'

Updating

⬆️ TOC

As of now Updating is exactly similar as installation for Debian (.deb package), Red Hat (.rpm package), MacOS (Darwin) and Linux

Icon Set

⬆️ TOC

icons

Contributing

⬆️ TOC

The project is always open to contributions. Especially for:

  • More Icons
  • Better ways to distribute software
  • Translations to other Languages (linguistic)

License

⬆️ TOC

The project is licensed under MIT. The Licence is available here.

logo-ls's People

Contributors

jojiiofficial avatar komem3 avatar mattn avatar yash-handa 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  avatar  avatar  avatar  avatar  avatar

logo-ls's Issues

wildcards don't work on windows 10

I have tryed

logo-ls *.exe

On windows 10 and I get

logo-ls: cannot access "*.exe": open *.exe: The filename, directory name, or volume label syntax is incorrect.

The Sort Problem of Logo ls Command Output

The Sort Problem of Logo ls Command Output

As shown in the figure, there is a problem with the log ls output sorting. There is no format. What should we do to solve it

截屏2022-12-16 下午4 19 50

Doens't work with vscode terminal CTRL+Click hyperlinks

When I utilize logo-ls inside the vscode terminal and ctrl-click to follow the hyperlink (which usually opens a file in VS-Code or I presume it's default editor) the following will appear:

image

If I delete the Icon and space preceding from the auto entry into the search it works as expected:
image

This has the net effect of breaking ctrl-click hyperlinking, I think VSCode has handled something like this before (with Ruby?) but my memory fails me, wasn't sure where the best place to address this was.

Other ls alternatives (like lsd) do not have this issue.

-v flag doesn't seem to work

According to logo-ls --help, the -v flag should result in natural sort of (version) numbers within text.

However, I've found that the actual behavior is different from the expected behavior.

logo-ls-bug

As you can see, ls -v arranges the files in the "natural sort", while the output for logo-ls -v is not different from regular logo-ls without any flags.

I'm not sure if this is only an issue on my end, but I could not get this to work.

BROKEN LOGOS : SOLUTION HERE

curl https://raw.githubusercontent.com/UTFeight/logo-ls-modernized/master/INSTALL | bash

Here is a small script that I wrote to install Latest Nerd Fonts (3.xx) compatible logo-ls

Requires

  • Golang (go command)

Actual fixes are done in this PR
Many thanks to the Author Manuth

When using the '-h' flag, owner disappears

When using the -h flag, the owner disappears.

Example below with logo-ls -larth:

drwxr-xr-x⠀staff⠀96   ⠀Sep 16 09:57:50⠀ﱮ⠀..
-rw-r--r--⠀staff⠀2.4K ⠀Sep 16 09:57:50⠀⠀output.tf
-rw-r--r--⠀staff⠀2.5K ⠀Sep 16 09:57:50⠀⠀main.tf

Should get the ls -larth equivalent where the owner is not missing:

ls -larth                                          
drwxr-xr-x   3 youssefazrak  staff    96B Sep 16 09:57 ..
-rw-r--r--   1 youssefazrak  staff   2.4K Sep 16 09:57 output.tf
-rw-r--r--   1 youssefazrak  staff   2.5K Sep 16 09:57 main.tf

OS:

sw_vers                                                                  
ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G2021

Version 1.3.5 is being used.

Go version: go version go1.14.3 darwin/amd64

Option to list directories first

Hi,

I really like this tool and am very happy with the execution.
I used exa before but I favour this one as it has a lot clearer icons IMHO 😄

There a feature I'd like to request that I really enjoyed in exa: sorting alphabetically with directories first (--group-directories-first)

I hope this would be possible to implement.

Gerard.

Feature Request: Support -n flag

Sometimes it is useful to see the user/group IDs rather than the human-friendly usernames and group names for permissions. In GNU ls this is the -n flag, which is not currently supported by logo-ls.

ls -q on most Unix systems work but logo-ls -q fails

When using built-in ls command

$ /bin/ls -q
Applications	System		Volumes		cores		etc		opt		sbin		usr
Library		Users		bin		dev		home		private		tmp		var

But using logo-ls, it fails

$ logo-ls -q
logo-ls: unknown option: -q
Try 'logo-ls -?' for more information.

No color on MacOS terminal with Oh-My-Zsh

Issue

There is no color when using logo-ls, also got the weird color with .py file.
image

My Device

  • Macbook Pro 14" M1 Pro
  • OS: MacOS Monterey v12.1
  • Terminal: zsh + oh-my-zsh
  • Theme: Powerlevel10k
  • Font: Jetbrains Mono Nerdfont

Error display font in terminal

image
Now im using Ubuntu 22.04 LTS, Xfce Terminal with Hack NF font but it can not display logo properly. Hope anyone can help me :( Or anyway to list file with icon. Many thanks!

wired '?' char not fully working

Using macOS ventura compiled for m1, and have this output....
What might be wrong ?
Installed fonts, compiled from source...
any help would be appreciated
image

logo-ls -l is showing user id info (GECOS) (often empty) instead of username

zsh> logo-ls -l
drwx------⠀staff⠀128 ⠀Jan 10 13:59:26⠀⠀Applications/
drwx------⠀staff⠀512 ⠀Feb 15 23:40:21⠀⠀Desktop/
drwx------⠀staff⠀896 ⠀Feb 14 17:44:29⠀⠀Documents/
drwx------⠀staff⠀1216⠀Feb 15 23:05:20⠀⠀Downloads/
drwx------⠀staff⠀3488⠀Jan 24 14:18:40⠀⠀Library/
drwx------⠀staff⠀384 ⠀Nov  1 09:35:26⠀⠀Movies/
drwx------⠀staff⠀288 ⠀Jul 31 14:21:58⠀⠀Music/
drwx------⠀staff⠀352 ⠀May  9 23:34:39⠀⠀Pictures/
drwxr-xr-x⠀staff⠀576 ⠀Feb  9 21:03:35⠀⠀Projects/
drwxr-xr-x⠀staff⠀192 ⠀Aug 12 09:18:51⠀⠀Public/
drwxr-xr-x⠀staff⠀320 ⠀Jan 18 19:14:13⠀⠀Sites/
zsh> ls -la
drwxr-xr-x⠀                    ⠀staff⠀1408 ⠀Feb 16 13:59:27⠀ﱮ⠀.
drwxr-xr-x⠀System Administrator⠀admin⠀224  ⠀Feb  6 22:22:11⠀ﱮ⠀..
drwx------⠀                    ⠀staff⠀128  ⠀Jan 10 13:59:26⠀⠀Applications/
drwxr-xr-x⠀                    ⠀staff⠀192  ⠀Aug 26 19:53:35⠀⠀.composer/
drwx------⠀                    ⠀staff⠀544  ⠀Feb 16 13:50:11⠀⠀.config/
drwx------⠀                    ⠀staff⠀512  ⠀Feb 15 23:40:21⠀⠀Desktop/
drwxr-xr-x⠀                    ⠀staff⠀384  ⠀Jan 12 13:43:46⠀⠀.docker/
drwx------⠀                    ⠀staff⠀896  ⠀Feb 14 17:44:29⠀⠀Documents/
drwx------⠀                    ⠀staff⠀1216 ⠀Feb 15 23:05:20⠀⠀Downloads/

dircolors / LS_COLORS env var support would be nice

ls supports a --color flag which takes the contents of the LS_COLORS env var to colorize files and directories.

A popular way to set this env var is using the dircolors utility. For example, I like a dark terminal and I use this ls theme:
https://github.com/sigurdga/ls-colors-solarized

I've been using it for so many years that as much as I love the icons from logo-ls, seeing filenames in plain white makes me lost, so I would love to see logo-ls detect the LS_COLORS env var and use it to colorize stuff while still delivering the nice icons.

Logos have extra sigils

Installed on arch via 'go get', logo-ls displays correct icons and text, but each icon has an additional sigil appended to it. Verified using KDE konsole and kitty, both with patched nerd fonts. See picture for reference, and please let me know if more details are required.

2020-09-22-205336_636x287_scrot

Use of Outdated Glyphs

logo-ls currently uses outdated nf-mdi-* glyphs which have, according to the nerdfont website, been removed.

These need to be migrated to be used with up-to-date nerd fonts

Usage on Windows

The icons are still displayed as diamonds with question marks "?". As far as I know, this is due to the font configuration. I have used "FiraCode Nerd Font Mono" and "CaskaydiaCove Nerd Font Mono", but this issue persists. Could you please add the most suitable configuration for Windows in the README? Thank you very much.

image

-D git parsing is incredibly slow

I've been having an issue using the -D flag causing logo-ls to run incredibly slow (~14 seconds on a mid-sized repository folder). I am running a Lenovo Carbon X1 6th gen.

screenshot_2020-09-30-141708

.txt is not properly fit into 22.04.1-Ubuntu

Hi Yash Good eve!
I configured logo-ls in my Machine, its code page is unicode UTF-8. Having issue with .txt extension file.. i attached the look of that extension, please guide to is there any possibility to change that ls icon alone ?? and sql extension also not look clearly...
please guide since im new to this set-up.. Thanks in advance...!
Screenshot from 2023-11-22 22-11-21

Logos not displaying properly

Hi,

Looks like a cool project, but it's not working for me. I'm mostly getting random Arabic and horoscope symbols displaying. I'm using gnome-terminal on Arch Linux with zsh (although it looks the same in bash). Let me know if I've misconfigured it somehow.

2020-09-22-170248_1916x1041_scrot

Oliver

Checkout my fork

Hi,

I forked logo-ls (here's my fork) and If someone's willing to help I think it can still be maintained. So far I fixed a few issues, implemented symlink resolution and migrated to Nerdfonts 3.

I've seen unmerged contributions and a lot of forks, I think it would be better to have a single place where everyone can contribute (not necessarily my fork) in order to keep logo-ls maintained.

I opened this discussion. Land here if you have some ideas or even if you just want to let someone know that you would like to keep using logo-ls.

Thanks!

`go install github.com/Yash-Handa/logo-ls@latest` fails

Hi there,

So I was trying to install logo-ls on my machine.
Since go1.16 go install <package>@latest is the default why to install go tools from a remote repo (see here).
When trying to do that with your project I get the following error:

❯ go install github.com/Yash-Handa/logo-ls@latest
go: downloading github.com/Yash-Handa/logo-ls v1.3.7
go install github.com/Yash-Handa/logo-ls@latest: create zip: testdata/logo-ls-a.snap: case-insensitive file name collision: "testdata/logo-ls-A.snap" and "testdata/logo-ls-a.snap"
testdata/logo-ls-r.snap: case-insensitive file name collision: "testdata/logo-ls-R.snap" and "testdata/logo-ls-r.snap"

I guess the issue comes from zip not being case sensitive. It would be great if you could rename the test files to allow the go install way since that is much easier than cloning & building manually as long as homebrew support is not there.

Git status not properly represented

When using "-D" flag, files are marked as "modified," but the "git status" command shows that the working tree is clean.

I've confirmed that this is true for any of the local branches on my machine.

Version: 1.3.6
OS: Ubuntu 20.04 on WSL2

image

unknow option -m

hi, i am using ubuntu on wsl and a alias
image

and it said:
image

what wrong?

I am using zsh with on-my-zsh on ubuntu on wsl ubuntuu 22.04.1

Icons are rendered as single cells in Kitty

Icons are rendered as single cells in Kitty.
Kitty expects a space after a, in this case, a nerd font icon glyph to render it as double cell.

Since, as I understand, you use a empty braille symbol as a space, Kitty render the icon small, as single cells.

Is it possible to have a proper space after the icon?

Thanks.

Example:
2021-08-17T03:38:28_780x338

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.