Giter Site home page Giter Site logo

Add asciiart support about neofetch HOT 23 CLOSED

dylanaraps avatar dylanaraps commented on May 18, 2024
Add asciiart support

from neofetch.

Comments (23)

dylanaraps avatar dylanaraps commented on May 18, 2024

Sounds like a neat idea.

I've started working on implementing ascii support, here's what I've got so far:

1

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

We can also easily implement screenfetch ascii logos.

arch

from neofetch.

aloisdg avatar aloisdg commented on May 18, 2024

I was thinking ascii art for the color palette (like I do in ascolorii), but implement ascii art as main pitcure level is a great idea too! :)

from neofetch.

aloisdg avatar aloisdg commented on May 18, 2024

It would be nice for both of our project to be able to scale the ascii art file. A work around would to use a tool to convert ascii art to svg format since svg support vectorization.

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I've just pushed the base ascii support to master, you can use it like this:

fetch --ascii "path/to/ascii.txt" --ascii_color "4"

fetch

The info text is padded according to the longest line in the ascii file, you can then use --gap and $gap to pad the text more or less.

The only caveat is that the dynamic padding only works on systems where wc has the flag -L. I'm looking into other methods of getting the longest line in a file. Fixed.

Please test it out!

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I was thinking ascii art for the color palette (like I do in ascolorii), but implement ascii art as main pitcure level is a great idea too! :)

Ah, I see.

This should be easy to implement too!

It would be nice for both of our project to be able to scale the ascii art file. A work around would to use a tool to convert ascii art to svg format since svg support vectorization.

I'm not going to ship any ascii with fetch, I think it should be up to the user.

from neofetch.

aloisdg avatar aloisdg commented on May 18, 2024

Please test it out!

Sure I will!

I'm not going to ship any ascii with fetch, I think it should be up to the user.

Sure you are right. You should not cluter the project with this,

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I've run into an issue while adding support for printing ascii art similar to the terminal color blocks. We need to insert padding to each line of ascii art so that it's inline with the text but I can't seem to do it without a really slow while read line statement.

Any ideas?

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I've decided on shipping distro logos with fetch. The distro logos will work with the distro detection and will be displayed according to detected distro exactly like screenfetch.

Here's what the file structure will probably look like:

  • fetch.sh
  • ascii
    • distros
      • arch.txt
      • ubuntu.txt
      • etc

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

Displaying the current distro's ascii art is finished in my local branch, I'm just doing some cleanup before I push it to master. Here are some scrots:

arch
gentoo
osx
windows

from neofetch.

aloisdg avatar aloisdg commented on May 18, 2024

Neat ! You nailed it.

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I just pushed it to master, see this faq question to enable it.

https://github.com/dylanaraps/fetch#how-do-i-enable-screenfetch-mode

It needs testing very badly. :)

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I'm testing Windows, BSD and a few Linux distros. It's confirmed working in:

  • Windows
  • FreeBSD
  • OpenBSD
  • NetBSD
  • Arch Linux
  • Elementary OS

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

@mclado, are you able to test ascii support on your OS X system?

Here's how you can test it out:

https://github.com/dylanaraps/fetch#how-do-i-enable-screenfetch-mode

This is the issue page for it, so if you've got any issues or ideas post them below. :)

from neofetch.

ladislavskufca avatar ladislavskufca commented on May 18, 2024

Hmm, I am getting this error.
readlink: illegal option -- f
usage: readlink [-n] [file ...]
Just checking out why but I don't get it.

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

It seems that readlink on OS X is missing the -f flag(?). I'll have a look at alternatives to readlink or a workaround for OS X.

I'm using readlink to get the path for the distro ascii btw.

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I also just realised that we need a standard location to store the distro ascii art.

from neofetch.

ladislavskufca avatar ladislavskufca commented on May 18, 2024

Hmm, this looks like the easiest solution instead of other things in just googled.

http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

Thanks for the link, a modified version of that is in master and the ascii art should work for you now.

from neofetch.

ladislavskufca avatar ladislavskufca commented on May 18, 2024

I can confirm, now it works perfectly.

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

Awesome!

from neofetch.

dylanaraps avatar dylanaraps commented on May 18, 2024

I don't think it's possible to add ascii blocks similar to your script to fetch. I ran into multiple issues when implementing it myself and I couldn't get it to a point where I was happy with it.

You can use your script with fetch very easily. Just add this line to the printinfo function at the top like so:

printinfo () {
    info title
    info underline

    info "CPU" cpu
    info "GPU" gpu
    info "Memory" memory

    /path/to/ascolorii ~/skull.txt
    # etc ...
}

I'm closing this issue as the distro ascii stuff is complete now and I don't have any plans to add ascii block support any time soon.

from neofetch.

aloisdg avatar aloisdg commented on May 18, 2024

It will do the job. Thank you for your work.

from neofetch.

Related Issues (20)

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.