Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr3431 :: Living in the Terminal

BlacKernel shows you some programs you'll need for living life without X org

<< First, < Previous, , Latest >>

Hosted by BlacKernel on Monday, 2021-09-27 is flagged as Explicit and is released under a CC-BY-SA license.
cli, terminal, nox, linux, technology, tty. 5.
The show is available on the Internet Archive at: https://archive.org/details/hpr3431

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:46:03

Lightweight Apps.

Reviews of light weight applications

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

Resources:


Contact Me

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2021-09-27 12:15:59 by Operat0r

Kids these days!

Wow... I didn't think people like you really existed! Mad props ! Me 4 days ago would have asked you about playing music though a SSH tunnel? but I just switched to PlexAmp for music because my wife uses Subsonic too. I think Subsonic is dying...Another thing is I really enjoy the highlighting in my windows MobaXterm terminal. I have tried a few times to get my entire terminal setup with syntax highlighting and keyword stuff like Moba does but its app specific ... so for example in Vi I can have nice colors then I leave the terminal and I get B/W .. What I want is everything everywhere highlighted like :


* warning messages,error,not,info,complete,OK, IP address,commandline switches ( example ) https://mobaxterm.mobatek.net/img/moba/features/feature-syntax-highlighting.png
* syntax highlighting (without having to name it .bash or .sh ) so for example if I cat out a binary file and it has random scripting or programing in it .. maybe it (detects) python and highlights that …

Anyway great stuff keep fighting the good fight!

Comment #2 posted on 2021-09-28 15:53:48 by b-yeezi

+1 for cnus

Thank you for this great show. I also use CMUS, as it's the only program that doesn't choke on my extremely large music library that I have on an NFS mount. I will be trying out most, and I encourage you to try out ranger!

Comment #3 posted on 2021-09-29 16:50:49 by sesamemucho

The text

Thanks for the show! At one point I used emacs on the console because I didn't have enough RAM to run X windows and a compiler at the same time.

Never sat down and got the Linux console to use a good font - these days I run the i3 window manager, so I get a lot of terminal windows, and graphics apps as needed.

If you're looking for an improved sort of ncurses, you could look into the Textual framework.

Figured there would be more comments here about '6'!

Comment #4 posted on 2021-09-29 20:50:34 by Dave Morriss

Very enjoyable

Hi,

Loved the show. I started on mainframes in the 1970's where all there was was a teletype or physical terminal. I use X-Windows now, but spend the majority of my time in terminal emulators.

Having spent today in the Linux console on my Debian Testing system debugging a problem caused by the last update, I'm appreciating being back in KDE. The problem was due to multiple incompatible versions of the NVIDIA "legacy" driver lurking in the system it turned out. I wouldn't want to stay in the console though, even with tmux.

Like you I'm a fan of ncurses, and have written a few simple things in my time.

I'm a Vim user and am contemplating moving to Neovim. I've written a few basic extensions in Vimscript but like the look of Neovim's Lua interface.

Finally, you had me going for a moment, calling 'vi' 'six' :-) Having been an ed and ex user in the past on various Unix flavours, I remembered that 'vi' was the abbreviated 'visual' command that gave you the screen mode from ex.

Dave

Comment #5 posted on 2021-10-06 16:36:48 by Gumnos

Using "c" to pause in cmus

The controls in cmus are laid out like a traditional VCR/tape-player from left-to-right in the bottom corner of a traditional QWERTY keyboard:

z=prev ⏮️
x=play ▶️
c=pause ⏯️
v=stop ⏹️
b=next ⏭️

I can't say it helps me remember *much*, but at least that's the reasoning behind the non-mnemonic keys.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?