Sections

2020-08-20

Cool aliases for .bashrc


So my Windows 10 installation has somehow began to take multiple attempts to boot, possibly because of a failing card reader or the fact that it left the bootloader on the old drive with a previous broken Windows XP installation and now it can't cope with the consequences of such decision I had no opportunity to overturn. So I now use Manjaro Cinnamon which I recently installed on a long unused M.2 nVME SSD, reserved for this exact purpose. After those 2 years at CTU and countless Linux videos on YouTube, I observe my knowledge about *NIX systems is way better than it used to be way back when I only used Knoppix 6 as a game library and wondered why I can't get anything cool on openSUSE 11 (infamous RPM dependency hell), to the extent I distro-hopped to LXLE since CTU uses Debianoids. Since Arch-based distros have overtaken RPM-based distros and UE is full of Windows boomers anyway, I decided to try a distro with the praised Arch package system, and I found that Manjaro has a community Cinnamon edition, which looks just like Linux Mint, a perfect distro for when another family member wants to borrow my PC. Cinnamon is by no means a lightweight DE, even though it makes the system consume only 800 MB on boot, whereas Win10 immediately "nationalizes" 2 GB. Not that it would really matter with my 32 GB in 4-channel.

So far the main source of annoyance is that some AUR packages are built from source and some just don't, including my childhood arithmetic practice game tuxmath, often due to linkage errors. Also due to soystemd most of old system-level tutorials don't work.

There are quite some alias tips on the internet, so I'll put here only those of my own devising, which are reasonably complex.



# MS-DOS habits
alias dir="lsd -la"
alias md="mkdir -p"
alias rd="rmdir -p"
alias cls="clear"

# directories
alias lols="ls -laF | lolcat"
alias yeet="rm -rf"
function cl {
    cd '$@' && lsd
}

# package management
alias pas="pacaur -S"
alias pms="sudo pacman -S"
alias update="sudo pacaur -Syu && sudo pacaur -Rcc $(pacaur -Qdtq) && yes | sudo pacaur -Scc"
alias bigpack="pacman -Qi | awk '/^Name/{name=\$3} /^Installed Size/{print \$4\$5, name}' | sort -hr | head -25 | lolcat"

# rainbow fun gadgets
alias pslol="watch -p -n 1 'ps aux | sort -nr -k 6' | lolcat"
alias loltop="top -d 1 | lolcat"
alias clock="watch -t -p -n 1 'date +%T\ %y-%m-%d | figlet -w 81 -f bigmono12 | sed '1,2d' | sed '14,16d'' | lolcat"
alias clock2="watch -c -t -p -n 1 'date +%T%y-%m-%d | toilet -w 81 -f bigmono12 --gay | sed '1,2d' | sed '14,16d''"
alias loltrix="cmatrix -a | lolcat"



bigpack

Originally found in a comment section of a DistoTube "let's share your .bashrc" video, albeit with a useless heading and padding. Now for a hall of shame of the most bloated packages on my system:

5,00GiB cuda
3,46GiB thedarkmod-bin
1924,87MiB nerd-fonts-complete
1324,82MiB texlive-fontsextra
1055,07MiB redeclipse-bin
951,86MiB wine
803,62MiB rstudio-desktop-bin
686,44MiB netbeans
638,85MiB pioneer
621,01MiB sauerbraten-data
561,95MiB linux-firmware
537,27MiB radium
460,07MiB racket
453,54MiB widelands-git
411,62MiB texlive-core
409,85MiB libreoffice-still
403,51MiB pycharm-community-edition
402,80MiB openarena
397,29MiB rust
371,15MiB vulkan-validation-layers
361,35MiB unknown-horizons-git
321,93MiB noto-fonts-extra
321,64MiB valgrind
294,43MiB noto-fonts-cjk
292,40MiB nvidia-440xx-utils


pslol

So I was wondering whether all the *tops are bloat, so I synthesized a very minimalist version of top with watch and ps. While I was at it, I also added some rainbow. Any section that was updated will be in a different color, which unexpectedly adds to readability. One could possibly prepend output from free to give the overall memory stats. I would consider this to be on the same level as replacing head with sed '11q'.

Every 1,0s: ps aux | sort -nr -k 6                                                                   Zetor: Thu Aug 20 20:08:00 2020

j637man   125071 86.9  9.5 16590500 3134436 ?    Sl   16:33 186:46 /usr/lib/jvm/java-8-openjdk/jre/bin/java -Djava.library.path=/hom
j637man     6971  3.4  1.9 1050976 626956 ?      Sl   12:19  16:01 /usr/bin/pamac-manager --gapplication-service
j637man     6714  3.2  1.2 3782600 393844 ?      Sl   12:17  15:15 /opt/minecraft-launcher/minecraft-launcher
j637man     1591  7.9  1.1 3913264 386004 ?      Sl   11:24  41:48 cinnamon --replace
j637man   441231  9.6  0.8 5075424 289884 ?      Sl   18:35   8:57 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man   390342  1.9  0.7 795380 255420 ?       SLl  18:28   1:53 /usr/lib/chromium/chromium --ppapi-flash-version=32.0.0.403 --ppa
root        1007  2.5  0.7 600372 239984 tty7    Ss+  11:24  13:08 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten
j637man   390449  2.2  0.6 677752 197792 ?       Sl   18:28   2:16 /usr/lib/chromium/chromium --type=gpu-process --field-trial-handl
j637man     6708  0.0  0.4 453700 157876 ?       Sl   12:17   0:26 krusader -qwindowtitle Krusader
j637man   125061  0.4  0.4 2706832 146512 ?      Sl   16:33   1:01 /opt/minecraft-launcher/minecraft-launcher --type=renderer --no-s
j637man     6741  0.0  0.4 1100748 140096 ?      Sl   12:17   0:27 /opt/minecraft-launcher/minecraft-launcher --type=gpu-process --n
j637man   390546  0.1  0.4 15306488 139256 ?     Sl   18:28   0:08 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man   390451  0.1  0.4 443472 134256 ?       SLl  18:28   0:08 /usr/lib/chromium/chromium --type=utility --utility-sub-type=netw
j637man     6805  0.2  0.3 2667416 129236 ?      Sl   12:17   1:01 /opt/minecraft-launcher/minecraft-launcher --type=renderer --no-s
j637man   663905  0.1  0.3 4735916 114568 ?      Sl   19:48   0:02 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man   390363  0.0  0.3 363280 112952 ?       S    18:28   0:00 /usr/lib/chromium/chromium --type=zygote --ppapi-flash-path=/usr/
j637man   390362  0.0  0.3 363280 112532 ?       S    18:28   0:00 /usr/lib/chromium/chromium --type=zygote --no-zygote-sandbox --pp
j637man   487384  0.0  0.3 4717624 107060 ?      Sl   18:41   0:03 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man   110390  0.2  0.3 935012 105004 ?       Sl   16:28   0:32 /usr/bin/qmmp /run/media/j637man/AUDIO/MUSIC/_OGG/ALESTORM - Mexi
j637man   112093  0.0  0.3 628040 100596 ?       Sl   16:30   0:09 xed
j637man   390584  0.0  0.2 4701656 97864 ?       Sl   18:28   0:00 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man     1634  0.0  0.2 180232 87612 ?        Sl   11:24   0:11 fcitx5
j637man     1395  0.0  0.2 561672 86964 ?        Sl   11:24   0:00 /usr/lib/cinnamon-settings-daemon/csd-background
root        6978  0.0  0.2 781488 72212 ?        Ssl  12:19   0:17 /usr/bin/pamac-daemon
j637man   322713  0.3  0.2 712524 69976 ?        Sl   18:16   0:26 nemo /home/j637man
j637man     1625  0.0  0.1 496132 64468 ?        Sl   11:24   0:06 nemo-desktop
j637man   325304  0.2  0.1 488392 60824 ?        Ssl  18:17   0:16 /usr/lib/gnome-terminal-server
j637man     1633  0.0  0.1 480812 56956 ?        Sl   11:24   0:02 nm-applet
j637man   664016  0.0  0.1 4668616 56040 ?       Sl   19:49   0:00 /usr/lib/chromium/chromium --type=renderer --field-trial-handle=1
j637man     1642  0.0  0.1 400120 55556 ?        Sl   11:24   0:01 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
j637man     1628  0.0  0.1 261276 54440 ?        Sl   11:24   0:01 pamac-tray
j637man     6722  0.0  0.1 248088 53748 ?        S    12:17   0:00 /opt/minecraft-launcher/minecraft-launcher --type=zygote --no-san
j637man     1612  0.0  0.1 395904 52080 ?        Sl   11:24   0:01 /usr/lib/xapps/sn-watcher/xapp-sn-watcher
j637man     1788  0.0  0.1 466248 48868 ?        Sl   11:24   0:03 cinnamon-screensaver
j637man     1636  0.0  0.1 257504 46828 ?        Sl   11:24   0:06 msm_notifier
j637man     1632  0.5  0.1 351256 40768 ?        Sl   11:24   3:01 /usr/lib/caribou/caribou
j637man     1400  0.0  0.1 571424 39364 ?        Sl   11:24   0:00 /usr/lib/cinnamon-settings-daemon/csd-power
j637man     1281  0.0  0.1 408984 36872 ?        Ssl  11:24   0:00 cinnamon-session --session cinnamon
j637man     1637  0.0  0.1 277168 36768 ?        Sl   11:24   0:00 cinnamon-killer-daemon
j637man     1387  0.0  0.1 276028 35980 ?        Sl   11:24   0:00 /usr/lib/cinnamon-settings-daemon/csd-xsettings
j637man     1588  0.0  0.1 202164 35292 ?        Sl   11:24   0:00 cinnamon-launcher


clock

Very awesome on the fullscreen terminals, which you can invoke by pressing Ctrl+Alt+F2 to F6. F7 is your graphical desktop and F1 is the by default silenced boot log. The default dimensions are 80x30, so I had to delete some padding lines with sed. Also you may not agree with my choice of YY-MM-DD date format, maybe you use DD.MM.YY or MM/DD/YY, so feel free to shuffle the fields around to fit your customs.