Hacker Public Radio

The Hacker Public Radio Old Microphone Logo

https://hackerpublicradio.org/about.html

subscribe
share






HPR3431: Living in the Terminal


Talking Points Rational

  • Sometimes, X.org just doesn't want to work
  • Esspecially if you are a dumb n00b running Arch
  • The terminal will always be there for you.
Applications: My .bashrc:
  • Environment Variables:
export EDITOR=nvim export PAGER=most export BROWSER=lynx export XDG_DATA_HOME="$HOME/.local/share" export XDG_CONFIG_HOME="$HOME/.config"

PS1: user@hostname:~ (git_branch) $

if [[ $EUID == 0 ]]; then export PS1="\[e[1;31m\]\u\[\e[m\]@\[\e[0;32m\]\h\[\e[m\]:\w\$(__git_ps1) # " else export PS1="\[e[1;34m\]\u\[\e[m\]@\[\e[0;32m\]\h\[\e[m\]:\w\$(__git_ps1) $ " fi
  • Aliases:
    • alias vim=nvim
    • alias play=mpv
Productivity ("Window Manager"): tmux
  • Provides an easy way of splitting a tty into various panes
  • Get multiple workspaces for free with CTL+ALT+F{1,2,3,4,5,6,7}
  • All of the tiling window manager, none of the X-it
  • Can set up if [ -t 0 ] && [[ -z $TMUX ]] && [[ $- = *i* ]]; then exec tmux; fi in .bashrc in order to have tmux start/stop with your terminal sessiion.
Music: cmus
  • Easy library and playlist management
  • Dead simple to use (with cmus-tutorial)
    • y to yank songs onto a playlist
    • SPA to select a playlist
    • RET to play a song/playlist
    • TAB to switch between panes
Pictures: fim
  • Requires user be in the video group for permission to use the Linux framebuffer
Radio/Video/single audio files: mpv
  • Can display video in terminal (badly with libcaca)
  • Can actually display video in linux framebuffer (with drm)
  • Can handle all of your somafm files/web-video links
  • Requires youtube-dl for video
Podcasts/RSS: newsboat/podboat
  • Orginizes all of your podcasts and RSS feeds into an easy-to-use ncurses interface
  • Can be set up with player "mpv --save-position-on-quit" to save positions on podcasts
  • Very convinent for articles, less so for podcasts
  • Really needs better integration with something like cmus
Runner Up: podfox
  • Can be configured with JSON
  • Has better directory structure than podboat, imo
  • Tree based structure vs shove everything in ~ by default
Text Editing/Word Processing: neovim/GitX Flavored Markdown/pandoc
  • Clean modal editing
  • Can export to whatever with pandoc
  • Probably not as good as OrgMode if emacs wasn't the HFS+ of text editors
Audio Recording/Post-Processing: ffmpeg
  • One alias and three scripts in my .bashrc
    • record: alias record="ffmpeg -f alsa -channels 1 -i hw:1"
    • atrim, top-tail, and anorm: Allows me to quickly spin up a recording and run post processing
function atrim() { if [ $1 ]; then local in="$1" else local in="-" fi if [ $2 ]; then local out="$2" else local out="-f nut -" fi if [[ $# > 2 ]]; then echo "atrim: requires 2 or fewer arguments" return 1 fi if [ $2 ]; then echo "atrim: silencing $in and saving to $out..."; fi ffmpeg -i $in -af silenceremove=start_periods=1:stop_periods=-1:start_threshold=-50dB:stop_threshold=-50dB:stop_duration=0.75 $out \ 2>/dev/null \ #1>/dev/null if [ $2 ]; then echo "atrim: done"; fi } function top-tail() { local top="$HOME/project/hpr-notes/template/intro-music-slick0-cc0.flac" local tail="$HOME/project/hpr-notes/template/outro-mixed-slick0-manon_fallon-cc0.flac" if [ $1 ]; then local in="$1" else local in="-" fi if [ $2 ]; then local out="$2" else local out="-f nut -" fi if [[ $# > 2 ]]; then echo "hpr-top-tail: requres 2 or fewer arguments" return 1 fi if [ $2 ]; then echo "hpr-top-tail: Topping $in with $top and tailing with $tail..."; fi ffmpeg -i "$top" -i $in -i "$tail" -vn -filter_complex " [0][1]acrossfade=d=1:c1=tri:c2=tri[a01]; [a01][2]acrossfade=d=1:c1=tri:c2=tri" \ $out \ 2> /dev/null \ #1> /dev/null if [ $2 ]; then echo "hpr-top-tail: done"; fi } function anorm() { if [ $1 ]; then local in="$1" else local in="-" fi if [ $2 ]; then local out="$2" else local out="-f nut -" fi if [[ $# > 2 ]]; then echo "anorm: requires 2 or fewer arguments" return 1 fi if [ $2 ]; then echo "anorm: normalizing audio $in and saving to $out..."; fi ffmpeg -i $in $(ffmpeg-lh $in) $out \ #2> /dev/null \ 1> /dev/null if [ $2 ]; then echo "anorm: done"; fi } Web Browsing: lynx
  • Fast and easy text based web browsing
  • Can leverage Web 4.0 technologies like Gopher!!
  • Some sites break pretty bad...
Email: mutt*
  • I didn't really use email very much when I was living on the terminal and now, since I use protonmail, I don't really have an easy way not to use the webmail.

  • Trying to find a fix to this. Let me know your thoughts!

  • This is the mail client I've heard the most good things about that isn't built into a text editor I can't use

Show Notes Important Links:
  • tmux
  • cmus
  • Napalm Lounge by Fat Chance Lester
  • fim
  • mpv
  • youtube-dl
  • newsboat/podboat
  • neovim
  • CommonMark
  • pandoc
  • ffmpeg
  • lynx
  • mutt
Resources:
  • atrim.sh
  • top-tail.sh
  • anorm.sh
Contact Me
  • Email: izzy leibowitz at pm dot me
  • Mastodon: at blackernel at nixnet dot social


fyyd: Podcast Search Engine
share








 September 27, 2021  n/a