this post was submitted on 26 Mar 2024
35 points (100.0% liked)

libre

9836 readers
2 users here now

Welcome to libre

A comm dedicated to the fight for free software with an anti-capitalist perspective.

The struggle for libre computing cannot be disentangled from other forms of socialist reform. One must be willing to reject proprietary software as fiercely as they would reject capitalism. Luckily, we are not alone.

libretion

Resources

  1. Free Software, Free Society provides an excellent primer in the origins and theory around free software and the GNU Project, the pioneers of the Free Software Movement.
  2. Switch to GNU/Linux! If you're still using Windows in $CURRENT_YEAR, flock to Linux Mint!; Apple Silicon users will want to check out Asahi Linux.

Rules

  1. Be on topic: Posts should be about free software and other hacktivst struggles. Topics about general tech news should be in the technology comm or programming comm. That doesn't mean all posts have to be serious though, memes are welcome!
  2. Avoid using misleading terms/speading misinformation: Here's a great article about what those words are. In short, try to avoid parroting common Techbro lingo and topics.
  3. Avoid being confrontational: People are in different stages of liberating their computing, focus on informing rather than accusing. Debatebro nonsense is not tolerated.
  4. All site-wide rules still apply

Artwork

founded 3 years ago
MODERATORS
 

Like, best text editor? Helix, Neovim, vim, emacs? All of the above, because why not? Currently leaning helix, becuase there's less setup involved with plugins and what not, but I'm not a serious programmer or anything.

Any reason to use an alternative to bash?

Any cool games? Best terminal file manager? Tmux or Zelij? Etc.

Useful aliases you use?

I'm currently messing around with NixOS, and was trying to build up a replacement for my current debian media server, and (eventually, hopefully, inshallah ) as a replacement to my current windows install.

I like debian a lot, but after installing it on both my laptop and server there was a lot of program drift between the two, when I wanted them to basically be identical, and then I found nix, and thought "this looks neat" and the idea of being able to reproduce everything on each install, with the same config format, appealed to me. I am currently playing around with it in a vm until the config is to my liking.

Seeing as the .nix config files are so portable I started working on a "module" for terminal apps to get about as close to a fully functional system as you can get with only a command line or terminal session, just to see what I could do.

So far I have quite a list, and looked over quite a few top 10 lists for this stuff, but was wondering if there was anything else out there I'm overlooking?

Pic is of my current bash prompt with starship, which was incredibly easy to get working and tweak thanks to home-manager modules. If anyone else is running starship and has a cool config they want to share, please do.

top 35 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 7 months ago (2 children)

the most essential programs are, of course, neofetch, pfetch, fastfetch, macchina, ufetch, and screenfetch.

[–] [email protected] 9 points 7 months ago (1 children)
[–] [email protected] 9 points 7 months ago

boohoo how could I forget the best one?

[–] [email protected] 7 points 7 months ago (1 children)

currently using freshfetch, because it's written in rust and that's good for reasons i don't currently understand.

[–] [email protected] 8 points 7 months ago

It makes it blazingly fast!

[–] [email protected] 9 points 7 months ago (1 children)

For a filemanager try out nnn it takes a bit of getting used to but it's very elegant and has a lot of clever little quality of life features. I use pulsemixer for volume and ncmpcpp + mpd for music. I like this cli calculator. It works basically as you'd expect and you can use . to mean "result of last calculation".

I guess I'll also plug my calendar program lol:

I wrote this calendar over the last few years. Pressing enter on a day allows you to write a note/journal entry for that day, which can be previewed quickly in the calendar. You can also add keywords like "appointment" which, if they exist in a note, will change the color used to display that day:

I've added various other features over the years like a help menu (press ?) and mouse support. There's only a few minor things left I have planned so it's mostly a "finished" project which is nice.

[–] [email protected] 4 points 7 months ago

NNN seems to work pretty well.

That calender app looks really nice! I was looking for something like that.

[–] [email protected] 7 points 7 months ago* (last edited 7 months ago) (1 children)

I work outta zsh as it's the default for macOS but I can't evangelize it much because I don't have enough bash experience to differentiate the two. I think it's pretty neat, though.

I use passion for my theme and spaceship for my prompt. Used to use powerlevel, but I found it to be too visually cluttered for my tastes after a while. With opsec stuff cleared out–here's my neofetch:

and here's an example prompt:

some useful aliases:

alias modx="chmod +x" # make file/script executable
alias calc="bc -e" # quick calculator
alias sl="ln -s" # symlink

I'd also recommend making a catch-all function for updating your package managers. I call mine shell-update and have it aliased to shu, which is the following function in my config:

brew update # homebrew sync
brew upgrade # update packages
brew cleanup # delete old versions

rustup update # rust toolchain update

npm update -g # node global update

pip3 list -o \  # python mass update
  | cut -f1 -d' ' \
  | tr " " "\n" \
  | awk '{if(NR>=3)print}' \
  | cut -d' ' -f1 \
  | xargs -n1 pip3 install -U

omz update # oh-my-zsh update

Your environment may vary.

[–] [email protected] 2 points 7 months ago

Cool, thanks!

A custom update function was something I was thinking of doing. The nix commands are a bit arcane, having a simple "update" command for all of them seems like it would be useful.

[–] [email protected] 7 points 7 months ago (1 children)

ripgrep is an excellent grep replacement to check out. wild how much faster it runs. +1 on the eza (other poster said exa but that's abandonware forked to eza)

check out deploy-rs and ragenix once you've replaced your current media server with a NixOS one. They make it much easier to apply configuration changes and to handle secrets if you need em for configs. +1 on start using flakes ASAP if you're not already (pretty sure both these tools only work with flakes), Xe Iaso's got a bunch of good blog posts about em if those are your jam.

I am currently playing around with it in a vm until the config is to my liking.

this is how I got NixOS to click for me, 10/10 highly recommend. even if it doesn't stick this time keep your config in source control somewhere so you can revisit it.

Any reason to use an alternative to bash?

gonna strongly disagree with one of the other posters in here that you should use POSIX-compliant shells because they're more portable, for a few reasons:

  1. if you're using the shell on a server or someone else's workstation to do more than run a handful of diagnostic binaries you're already wasting your time, and even then finding a quick one-liner in stack overflow to do some annoying repetitive task like filesystem cleanup or the like will be trivial. goes double for nixos where the likelihood you're doing anything once shelled in besides editing a config or running a diagnostic becomes even more unlikely
  2. speaking of, since you use nixos, you can trivially have your preferred shell environment available on any server you're running for yourself
  3. modern structured data pipeline-based shells (PowerShell, elvish, nushell, etc.) are far more ergonomic for both interactive and scripted usage

I wrote a little bit more about how modern structured data shells have been a more ergonomic option for like two decades now in a dunk tank post a few weeks back so I'll just link that instead of elaborating.

even if you find you prefer flat text pipelines, zsh and fish are fine (and were preferable for me for interactive use before I started using pwsh and then elvish) and you'll still wind up writing bash scripts anyway. or at least when I used those shells I don't think I once wrote a script that targeted them instead of bash. also #! /usr/bin/env sh is fine, you should hopefully be well aware when you write scripts that have a chance of running on a system that has a weird shell symlinked to sh.

[–] [email protected] 4 points 7 months ago

Thanks for the flake tutorial. I've implemented one already, but was a little confused about it. I plan to come back to it eventually.

I was planning to stick to bash, but since with nix you can switch between a few different shells trivially, I might as well look into the alternativces more closely.

[–] [email protected] 5 points 7 months ago

Ed is the standard text editor

[–] [email protected] 5 points 7 months ago (1 children)

Any reason to use an alternative to bash?

Some people will say that zsh is a better interactive shell than bash, but using a different interactive shell than the shell that runs your scripts makes it harder to write shell scripts. I've also heard that because zsh technically implements POSIX that you can simply target sh for your shell scripts, which is also not a good idea. There's too many variants of sh, and some variants like Dash do not support Bash features like [[ conditions, it's much more practical to target bash.

[–] [email protected] 3 points 7 months ago

I'll keep that in mind. I'm probably going to go with the default bash unless there is a feature something else has that looks neat.

[–] [email protected] 5 points 7 months ago (1 children)

You can use fish or nushell if you really want to use something other than bash. Bash is useful because it's installed in virtually all GNU/Linux machines by default. So unless you live in your terminal prompt 24/7 you dont need to change.

Zellij over tmux.

Best text editor is the one you like using and receives constant updates (and libre).

Make sure you start learning Nix Flakes as soon as possible if you want the most out of NixOS. The documentation is quite verbose so that's what I'd prioritize.

[–] [email protected] 3 points 7 months ago

Zellij looked like the way to go, so that seals it. Thanks.

and three strong recommendations to start using flakes, so I guess that's what I'll jump into next.

[–] [email protected] 4 points 7 months ago* (last edited 7 months ago) (1 children)

tldr pages for when you need a refresher for a command but don't feel like digging through a whole man page.

here's a cool guide on using flakes for your nixos setup. which you should probably do since they're likely going to replace the current system at some point

if you get stuck on something with nix search around github with the langauge:nix tag and you'll usually be able to figure things out based on what other people have done.

[–] [email protected] 2 points 7 months ago
[–] [email protected] 4 points 7 months ago
[–] [email protected] 3 points 7 months ago (1 children)

I've been thinking about getting into nix, any resource recommendations to get started?

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago)

These two channels were the main ones I referenced

https://www.youtube.com/@librephoenix https://librephoenix.com/tags/nix.html

https://www.youtube.com/@vimjoyer

Seeing what this Zaney guy did with his nix install is what got me intrigued.

Best way to go is to install it on a VM and start looking at the .nix files and following instructions on how to add programs, and then move on from there.

[–] [email protected] 3 points 7 months ago (2 children)

gnu stow to stow all those dotfiles into a single folder. Track the folder with git, the persist it across multiple devices.

fzf or skim integrate nicely into all sorts of different things. Basically let's you slap a specific ui onto a script.

Ranger is the best style of terminal file manager and the only mature one. I tried joshuto and wanted to like it but it just wasnt as mature and ranger.

With ranger there's a --chose-dir option that you can use in a function so that you jump to the folder you left on when you exited ranger. Such a massive time saver from constant ls, cd and tabbing. Like there should be a lightweight version of the program that only does that and should be considered standard unix like vi. Actual file management is secondary.

[–] [email protected] 1 points 7 months ago

stow pretty redundant with home-manager tbh, I don't think OP would find it that useful if they're already writing modules for their stuff

[–] [email protected] 1 points 7 months ago

With ranger there's a --chose-dir option that you can use in a function so that you jump to the folder you left on when you exited ranger.

that seems incredibly useful, thanks!

[–] [email protected] 3 points 7 months ago (1 children)

cmatrix and cbonsai are classics off the dome. btop is the fanciest and prettiest top variant. exa is a more modern ls. pywal can also be very fun, it generates color schemes from your wallpapers. if you have a nvidia graphics card, something like nvtop can be useful.

[–] [email protected] 3 points 7 months ago

pywal can also be very fun, it generates color schemes from your wallpapers

nice!

[–] [email protected] 3 points 7 months ago (1 children)

helix looks really cool. how is the plugjn ecosystem?

[–] [email protected] 2 points 7 months ago* (last edited 7 months ago) (2 children)

nonexistent, but they're working on it i guess. they have decided on Scheme as the language and ruled out suggestions to support multiple languages. so it's not looking great imo which is a shame since I liked it better than neovim. currently using it as a nano replacement on my nixos pi setup, but will probably ditch it at some point.

[–] [email protected] 3 points 7 months ago (2 children)

Sensible defaults and the lack of plugins seems to be why people like it.

[–] [email protected] 2 points 7 months ago* (last edited 7 months ago)

I can’t speak for everyone but I don’t like the lack of plugins, though I do appreciate the reduced necessity of them.

[–] [email protected] 1 points 6 months ago (1 children)

Is there at least good LSP support?

[–] [email protected] 2 points 7 months ago* (last edited 7 months ago)

decided on Scheme as the language

luffy-pog SCHEME MENTIONED +++++++1 or (+ 1 1 1 1 1 1 1 1)

[–] [email protected] 3 points 7 months ago

I was looking at zoxide the other day, haven't gotten around to trying it yet but it looks neat.

[–] [email protected] 2 points 7 months ago

Tmux / GNU Screen. Both are terminal multiplexers which allow you to do things like split a terminal into several windows and detach your session (so for instance, you can detach from a text terminal and resume in a terminal emulator, or so you can re-attach to a remote session over SSH after a hangup).