News for hackers. Stuff that matters.
Re:Neofetch: Command-line system information tool written in... by simonw on Saturday July 24, 2021 @12:03PM (#27942016)
The implementation of this - a single, huge bash script - is actually a pretty neat thing to browse through if you want to improve your knowledge of bash.

I particularly enjoyed this function that returns the ASCII-art logo for the current platform: https://github.com/dylanaraps/neofetch/blob/017aa041d86340f2...

Re:Neofetch: Command-line system information tool written in... by woodruffw on Saturday July 24, 2021 @12:10PM (#27942073)
> I particularly enjoyed this function that returns the ASCII-art logo for the current platform

I wonder how much of it is copied from screenfetch[1], which (I believe) is the "grandfather" for a lot of these kinds of information viewers.

I wrote my own version of screenfetch[2] a very long time ago, and I'm pretty sure I just ripped their ASCII-art directly :-)

[1]: https://github.com/KittyKatt/screenFetch/blob/c3a47890441166...

[2]: https://github.com/woodruffw/screenfetch-c

Re:Neofetch: Command-line system information tool written in... by forgotpwd16 on Saturday July 24, 2021 @12:53PM (#27942468)
Relevant, Dylan had written a piece[0] on why he created Neofetch rather attempting to improve Screenfetch. It seems he later blanked the page, I guess due to being a bit heated.

[0]: https://github.com/dylanaraps/neofetch/wiki/Neofetch-vs.-Scr...

Re:Neofetch: Command-line system information tool written in... by gexla on Sunday July 25, 2021 @01:15AM (#27946892)
GitHub Copilot strikes again.
Re:Neofetch: Command-line system information tool written in... by linspace on Saturday July 24, 2021 @03:29PM (#27943760)
And it's actually developed as a single file. I do wonder if they have considered a solution like the sqlite amalgamation https://www.sqlite.org/amalgamation.html
Re:Neofetch: Command-line system information tool written in... by r3trohack3r on Saturday July 24, 2021 @12:57PM (#27942502)
Dylan is also the author of KISS Linux and the pure {sh,bash} bibles. All interesting projects.

https://k1sslinux.org/ https://github.com/dylanaraps/pure-sh-bible

Re:Neofetch: Command-line system information tool written in... by forgotpwd16 on Saturday July 24, 2021 @01:13PM (#27942646)
Also author of a pure-bash file manager (https://github.com/dylanaraps/fff), TUI terminal pixer art editor (https://github.com/dylanaraps/pxltrm), IRC client (https://github.com/dylanaraps/birch), TUI client for Transmission torrent daemon (https://github.com/dylanaraps/torque), and even an attempt to coreutils implementation (https://github.com/dylanaraps/bareutils). A bash wizard someone may say.
Re:Neofetch: Command-line system information tool written in... by l2cluster on Saturday July 24, 2021 @03:28PM (#27943755)
And my favorite, pywal (https://github.com/dylanaraps/pywal), which generates color schemes from an image.
Re:Neofetch: Command-line system information tool written in... by chubot on Saturday July 24, 2021 @01:20PM (#27942722)
This huge bash program can also be run under Oil :)

Oil 0.8.pre4 - The Biggest Shell Programs in the World http://www.oilshell.org/blog/2020/04/release-0.8.pre4.html#t...

(or at least it could as of a year ago)

Re:Neofetch: Command-line system information tool written in... by michaelsbradley on Saturday July 24, 2021 @12:29PM (#27942265)
Re:Neofetch: Command-line system information tool written in... by rashil2000 on Saturday July 24, 2021 @01:44PM (#27942944)
There's a pure PowerShell version[0] of this, for Windows, called winfetch. The repository also has a batch alternative for systems not supporting PowerShell.

[0]: https://github.com/kiedtl/winfetch

Re:Neofetch: Command-line system information tool written in... by infogulch on Saturday July 24, 2021 @03:28PM (#27943753)
osquery is a related open source cross-platform system information tool that exposes everything through sql syntax. The scope of information you can query for is enormous: https://osquery.io/schema/4.9.0/
Re:Neofetch: Command-line system information tool written in... by normac2 on Saturday July 24, 2021 @01:57PM (#27943052)
I feel like this should be a bunch of files that are concatenated in the makefile, not one giant 10,000SLOC script. Otherwise it seems pretty organized and looks like it's following bash best practices.
Re:Neofetch: Command-line system information tool written in... by mushufasa on Saturday July 24, 2021 @11:40AM (#27941824)
I wonder what prompted this reposting.
Re:Neofetch: Command-line system information tool written in... by jmcgough on Saturday July 24, 2021 @01:52PM (#27943010)
Usually someone just discovers it for the first time.
Re:Neofetch: Command-line system information tool written in... by literallyaduck on Saturday July 24, 2021 @11:50AM (#27941898)
Did I miss some news about neofetch?
Re:Neofetch: Command-line system information tool written in... by grae_QED on Saturday July 24, 2021 @12:11PM (#27942085)
Probably a karma bot
Re:Neofetch: Command-line system information tool written in... by ibraheemdev on Saturday July 24, 2021 @12:43PM (#27942376)
Or someone who thought it was interesting and wanted to share it with others, not knowing that it had been posted before.
Re:Neofetch: Command-line system information tool written in... by ingve on Saturday July 24, 2021 @01:40PM (#27942908)
Pretty close! Actually, someone was working on a short bash script for backing up some files, tried to remove some hardcoded values, had to use google to figure out how to get the information dynamically using `sysctl` and `system_profiler`, ended up on the Github page for neofetch, and thought "hey this is great, maybe this could be useful for other people as well!" and submitted it.
Re:Neofetch: Command-line system information tool written in... by grae_QED on Saturday July 24, 2021 @01:31PM (#27942823)
They have over 140,000 points, post multiple times a day and never write any comments. They sure look like a bot.

I've seen lots of profiles made around 2012 as well that post regularly but only have a tenth the amount of points as this one has.

Also, not sure why you're so quick to defend them. Bots are very common now a days. Its not unreasonable to assume most of the profiles that produce massive amounts of content on most social media platforms are bots.

Re:Neofetch: Command-line system information tool written in... by krick on Saturday July 24, 2021 @10:09PM (#27946063)
Huh... That's plausible. But I'm curious, how this bot would work? How does it "know" it should make this particular submission?
Re:Neofetch: Command-line system information tool written in... by ficklepickle on Saturday July 24, 2021 @11:26PM (#27946446)
Must be a pretty advanced bot, because he left a comment explaining his motivation right above this thread.
Re:Neofetch: Command-line system information tool written in... by krick on Saturday July 24, 2021 @11:43PM (#27946513)
Oh well. Now I'm disappointed.
Re:Neofetch: Command-line system information tool written in... by iamtedd on Sunday July 25, 2021 @12:00AM (#27946591)
Who are you talking about? The submitter - ingve - has many comments going back at least a year, including as a sister comment to yours.
Re:Neofetch: Command-line system information tool written in... by rhizome on Sunday July 25, 2021 @04:51PM (#27952811)
Nothing prevents someone from posting under an account otherwise used as a submission bot. If you actually look where they're commenting, it's usually only on stories that they submitted.
Re:Neofetch: Command-line system information tool written in... by 2OEH8eoCRo0 on Saturday July 24, 2021 @01:39PM (#27942897)
Somewhat off topic but what terminal is this:

https://camo.githubusercontent.com/82b03feab20083a17944229ea...

I've only ever used whatever the default terminal is so this seems fancy. Looks nice.

Re:Neofetch: Command-line system information tool written in... by BanazirGalbasi on Saturday July 24, 2021 @01:55PM (#27943038)
The fancy appearance is probably due to user customizations. Simply changing the terminal font to one you like better and changing the background from pure black to another color (while keeping it dark) makes a big difference on appearance. The rest is probably window decorations, which means tweaking your WM theme. [r/unixporn](https://old.reddit.com/r/unixporn) has a lot of good examples, and most people share dotfiles for you to borrow from.
Re:Neofetch: Command-line system information tool written in... by ducktective on Saturday July 24, 2021 @01:54PM (#27943028)
I also use Xfce4-terminal but that is not its default theme. Pretty much any modern terminal emulator can be tweaked to have a purple background...
Re:Neofetch: Command-line system information tool written in... by soberpeach on Saturday July 24, 2021 @01:47PM (#27942974)
It shows xfce4-terminal
Re:Neofetch: Command-line system information tool written in... by 2OEH8eoCRo0 on Saturday July 24, 2021 @04:54PM (#27944394)
Oh. I see.
Re:Neofetch: Command-line system information tool written in... by diogenesjunior on Saturday July 24, 2021 @11:57AM (#27941960)
I think the code could be easily re-written with Python.
Re:Neofetch: Command-line system information tool written in... by simonw on Saturday July 24, 2021 @11:59AM (#27941983)
It wouldn't be as good though, because then you'd have to install Python in order to use it.
Re:Neofetch: Command-line system information tool written in... by diogenesjunior on Saturday July 24, 2021 @12:03PM (#27942015)
I think most Linux operating systems come with Python already installed (at least all the ones I use do). It could be uploaded to PyPI, which would mean installing PIP, but using pre-installed libraries would mean you could simply use git (which is usually pre-installed too), and then run `python3 setup.py install`.
Re:Neofetch: Command-line system information tool written in... by jeppesen-io on Saturday July 24, 2021 @12:25PM (#27942227)
> Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX and Haiku

You're making a lot of assuptions. Many servers don't have git installed. Some only have python2. Some dont even have that. Not to mention AIX or other non-linux platforms

Re:Neofetch: Command-line system information tool written in... by diogenesjunior on Saturday July 24, 2021 @12:38PM (#27942331)
How hard is it to install git and Python 3?
Re:Neofetch: Command-line system information tool written in... by georgyo on Saturday July 24, 2021 @12:47PM (#27942416)
In some environment, very hard. Especially embedded systems and corporate machines.
Re:Neofetch: Command-line system information tool written in... by bool3max on Saturday July 24, 2021 @03:02PM (#27943575)
I'm not sure why you would want Neofetch on any embedded system or corporate machine though.
Re:Neofetch: Command-line system information tool written in... by saagarjha on Saturday July 24, 2021 @03:05PM (#27943595)
What, you don’t send your friends screenshots of the beefy machine your work provided you? Or the potato you are running Linux on?
Re:Neofetch: Command-line system information tool written in... by diogenesjunior on Saturday July 24, 2021 @01:22PM (#27942745)
If you cannot install git or py3 then installing bash will be just as hard, no?
Re:Neofetch: Command-line system information tool written in... by ylyn on Saturday July 24, 2021 @01:41PM (#27942911)
Bash is a relatively small C program.

Python is a huge beast compared to Bash.

Re:Neofetch: Command-line system information tool written in... by mixmastamyk on Saturday July 24, 2021 @12:58PM (#27942504)
Installing bash will be just as hard in those situations.
Re:Neofetch: Command-line system information tool written in... by IggleSniggle on Saturday July 24, 2021 @02:23PM (#27943278)
Ok…but bash is waaayy more common. I could see this if you were making an argument about Perl, since it’s probably pretty close to parity with bash in terms of pre-existing in most environments…but python? No way!
Re:Neofetch: Command-line system information tool written in... by mixmastamyk on Saturday July 24, 2021 @06:14PM (#27944872)
Python is 10x more popular than perl these days. None are installed by default on Windows.
Re:Neofetch: Command-line system information tool written in... by IggleSniggle on Saturday July 24, 2021 @09:08PM (#27945765)
Ah, right, Windows, forgot about that one! So, Windows you’re pretty much always going to have to install something anyway.

For almost all of the BSDs, Linux distros, Solaris, AIX, HPUX, countless others, you’re going to have both bash and Perl interpreters included by default.

I think installing python is generally quite reasonable! It’s just not as ubiquitous, so if you’re looking for a one-stop interpreted language that most people will neither need to install or worry about the interpreter version, then a baseline old version of bash or Perl is a pretty good bet.

Although really awk probably also deserves consideration in this regard, given that you will even have it on embedded Linux where bash and Perl are not. I don’t know enough about awk to comment on its general utility for doing something like neofetch, however.

Re:Neofetch: Command-line system information tool written in... by hansel_der on Saturday July 24, 2021 @01:22PM (#27942752)
guess the point was that bash is way more common than python?
Re:Neofetch: Command-line system information tool written in... by mixmastamyk on Saturday July 24, 2021 @06:12PM (#27944863)
It’s not, especially in the Windows-centric corporate environments mentioned above. 0 not greater than 0.
Re:Neofetch: Command-line system information tool written in... by hansel_der on Wednesday July 28, 2021 @08:31AM (#27982971)
even in those Windows-centric corporate environments you can push a few buttons to get a Microsoft-built version of bash, even before wsl was a thing, not so for python.
Re:Neofetch: Command-line system information tool written in... by moondev on Saturday July 24, 2021 @11:03PM (#27946355)
How is that better? You don't even need to install it, just run

   curl -L https://github.com/dylanaraps/neofetch/raw/7.1.0/neofetch | bash
Re:Neofetch: Command-line system information tool written in... by walteweiss on Saturday July 24, 2021 @01:43PM (#27942931)
But what’s the point in doing that?
Re:Neofetch: Command-line system information tool written in... by krick on Saturday July 24, 2021 @09:53PM (#27945981)
This is a pretty small project, and, furthermore, it is by its nature supposed to support a lot of different systems, so I personally don't know if it makes sense to rewrite it (and in Python out of all things: maybe then better rewrite it in a compiled language, so that you can distribute it as a binary?). So I'm hesistant to say one should do it: it might do more harm than good.

But if this wouldn't bother me, I would really want to rewrite it. Just look at the source. It is 11K LoC. It is very modular by nature, since there is a lot of stuff that is "the same, but slightly different" for each OS. It is really simple by nature, just a few dozens of directives, each of them should answer 1 pretty straight-forward question. So it should be fairly easy to read (and it actually makes a practical sense even for a user, since this is so much of a collection of knowledge about different OS, not so much a "real program"). But it's not (I mean, it's not easy to read, assuming you are comfortable with bash). And it's not badly-written bash-script, quite otherwise. It's just… bash. How exactly you'd improve that would depend on the language of choice, but every "proper" PL should make it possible to write this very thing in such a way, that reading it "entirely" in a few minutes would be trivial, and wouldn't require scrolling through 11K LoC. Just separating all ASCII-art from code and making a separate class (if we use Python) for each OS implementation with a common interface, extending 1 or more base-classes (for OS families) would improve it greatly, since it would take me literally seconds to see all directives it currently supports, and to find their implementations for the particular system I'm interested in. After scrolling through some maybe 200 LoC you'd feel that you know everything that it does, and the rest 10K LoC (or whatever it would be) are just "details".

So while actually suggesting to rewrite it in Python might show some lack of analysis, I wouldn't bash anyone for wishing it would have been written in Python.

Re:Neofetch: Command-line system information tool written in... by arminiusreturns on Saturday July 24, 2021 @05:11PM (#27944520)
Not sure about the gp, but lots of people on hn love to hate on bash, and give reasons either it's bad or lang is better.
Re:Neofetch: Command-line system information tool written in... by mixmastamyk on Saturday July 24, 2021 @06:20PM (#27944901)
Readability, maintainability, etc. if that matters to you.