#!/bin/sh # The Clear BSD License # # Copyright (c) 2019 dweller # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted (subject to the limitations in the disclaimer # below) provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED # BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED # TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHE RIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. # pfetch ad hoc script for archlinux ricers userhost="$USER@$(uname -n)" uh_len=${#userhost} uh_under=$(printf "%${uh_len}s" | tr " " "=") kernel="$(uname -sr | awk '{split($0,a,"-"); print a[1]}')" # Works properly only on (some) Intel CPUs (coz I cut the model name) cpu="$(lscpu | grep "^CPU(s)" | awk '{print $2}')x \ $(lscpu | grep 'Model name' | awk '{print $6}') @ \ $(lscpu | grep "max MHz" | awk '{print $4 / 1000}')GHz" gpu="$(lspci | grep VGA | cut -d'[' -f2 | cut -d']' -f1)" mem="$(free -h --si | grep "Mem:" | awk '{print $3 "/" $2}')" wm="$(echo $XDG_SESSION_DESKTOP)" # 24-bit RGB FG/BG r g b # printf "\033[38;2;0;0;0m" # printf "\033[48;2;0;0;0m" setcol="\033[0;34m" rstcol="\033[;m" echo "" printf "$setcol $rstcol %s \n" "$userhost" printf "$setcol _ $rstcol %s \n" "$uh_under" printf "$setcol / \ $rstcol %s \n" printf "$setcol > _ \ $rstcol %s \n" "$kernel $wm" printf "$setcol / ( ) < $rstcol %s \n" "$cpu" printf "$setcol /_/ \_\ $rstcol %s \n" "$gpu" printf "$setcol $rstcol %s \n" "$mem" echo ""