Skip to main content

#Shell - How to sharpen a command-line interface for better plain-text experience?

For some of us and as crazy as it may look like our productivity derives directly from the addition and subsequent customization of dot files


This week, I've stumbled upon this article of Nikita Sobolev, written with geat care on this topic with particularly detailed illustrations and precious pointers :  

Instant +100% command line productivity boost 

Here are some of the new challengers reinventing our daily plain-text experience 

ag - code searching tool similar to ack, with a focus on speed

exa - modern replacement for ls

fzf - general-purpose command-line fuzzy finder 

zsh-syntax-highlighting - Fish shell-like like syntax highlighting for Zsh

For better compatibility with tmux,

  • I've re-installed my current version of the terminal multiplexer from its 2.5 release
    I had some issue when using Pygments as replacement of cat for syntax highlighting of source files with version of tmux above 2.5). Besides tig (upgraded to its 2.2.2 release) would render incremental changes in funny ways  
  • I've updated its configuration to preserve vim-mode selection and system clipboard copy-paste

For easier use of these little gems, I've added the following aliases to my shell start-up script (read ~/.zshrc equivalent) :

 

#i3 - How not to loose focus when navigating with a JetBrains IDE

Add the following directive to ~/.i3/config

focus_follows_mouse no

#WeeChat - Filters and tags with WeeChat

/filter add joinquit * irc_join,irc_part,irc_quit *

#Systemd - How to read live-tail logs of multiple services with journalctl

Tail logs of multiple services

sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service

#Shell - Set sound volume from the command-line

Add the next function and its corresponding alias to a shell startup script to set sound volume from the command-line. Thanks to Nick Robinson-Wall for sharing how to set/get/mute volume from the command line with .

function set_sound_volume() {
    local PERCENTAGE="${1}"       
  
    echo 'About to set volume up to '"${PERCENTAGE}"' % of its maximal value'  
    osascript -e 'set volume output volume '"${PERCENTAGE}"
}
alias set-sound-volume='set_sound_volume'