Spotify in the Terminal With spotify-tui and spotifyd

Spotify TUI is a Spotify client for the terminal, written in Rust. In conjuction with Spotifyd, a lighteight Unix daemon, you’ll get a fully-featured terminal application that connects to your Spotify Premium account. Install Spotifyd Installation There are pre-build libraries for different operating systems. For Arch, you can find several packages in the AUR. I use pulseaudio as my sound server, so I chose spotifyd-pulseaudio-git from the AUR: yay -S spotifyd-pulseaudio-git Installation takes a while.
Read more →

TIL About Finding the Path Environment Variables With Fish Shell

The fish_user_paths are the alternative for $PATH in fish shell. But how do I find out, what’s in my fish path? echo $fish_user_paths | tr " " "\n" | nl This gives you an array of path environment variables. You can erase a path with set -e fish_user_paths[1]. Be aware that the array is mutable, so if you delete an item, another one will take its place. Further Reading How to remove a path from $PATH variable in fish?
Read more →

TIL: Linux - Delete Files Older Than X Days

Today I learned that you can pass a date argument to find. I wanted to delete all files that were older than 10 days using the command line. We can use find which ships with every Linux distribution. find . -type f -mtime +20 Find all files that are older than 20 days in the current directory. Now let’s delete them: find . -type f -mtime +20 -exec rm -f {} \; I use fd as an alternative to find:
Read more →

Friday Picks 040

Read more →

TIL: How to Search and Replace Text in All Files With rg and sed

Read more →

TIL: How to Run Your Scripts From Everywhere

I’ve been writing a few bash scripts and some Nim command line utilities. You can run a script from the folder which contains the script. Here’s an example file structure: ~/bin/ ├── git-reset-author.sh └── readme_template When I’m inside the ~/bin directory, I can type into the terminal: readme_template. But what if I want to navigate to a different folder on my machine and run the script from that location? fish: unknown command readme_template The shell doesn’t find the program.
Read more →

How I Manage My SSH Keys

Setup SSH keys with Manjaro i3 and keychain The following blog post details how I setup my SSH keys. I always forget some of the moving parts. Then I have to painstakingly debug why ssh-add doesn’t remember my keys or why ssh-agent doesn’t work. Create ssh-keys with ssh-keygen. cd ~/.ssh ssh-keygen -t ed25519 -o -a 100 Make sure to save both public and private key inside ~/.
Read more →

Suspend Vim to the Background or What Is Linux Job Control

Vim has an inbuilt terminal, which you can start with :terminal. That means that you don’t have to leave your Vim editor to run commands in the shell. Sometimes, it’s still useful. If you quickly want to switch to your shell, suspend the Vim editor with Ctrl+z. That sends the process into the background (on Linux). Now you have access to your standard terminal and can run commands. Type jobs or jobs -l to see a list of the background processes.
Read more →

Fish Plugins I Like

Updated: December 5th, 2019 Fish shell is my favorite shell. It’s awesome. Fish comes with useful features out of the box. For example, excellent auto-completion and syntax highlighting make my life easier. Fish is a joy to use. What Is a Shell? From technopedia: A shell is software that provides an interface for an operating system’s users to provide access to the kernel’s services. On Unix-based or Linux-based operating systems, a shell can be invoked through the shell command in the command line interface (CLI), allowing users to direct operations through computer commands, text or script.
Read more →

Pipe a Terminal Command to Vim

How can you run a command in your normal shell and then pipe it to Vim? A typical use case could be to run a find command and open the found file in Vim. Answer: You can use command substitution. vim $(find . -name example.txt) Here’s a useful command that I’m using now: nvim (fd | fzy) (I’m using fish as my interactive shell. Thus I don’t need to use $.
Read more →

Sign up for the newletter!

powered by Buttondown