Last active
October 6, 2023 19:10
-
-
Save Kodehawa/85b97416723a0e6cd3d7bd3dccb970f6 to your computer and use it in GitHub Desktop.
Simple Arch Linux fetch script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/dash | |
bold=$(tput bold) | |
normal=$(tput sgr0) | |
#thanks pfetch guy | |
while IFS=':k ' read -r key val _; do | |
case $key in | |
MemTotal) | |
mem_used=$((mem_used + val)) | |
mem_full=$val | |
;; | |
Shmem) | |
mem_used=$((mem_used + val)) | |
;; | |
MemFree|Buffers|Cached|SReclaimable) | |
mem_used=$((mem_used - val)) | |
;; | |
esac | |
done < /proc/meminfo | |
mem_used=$((mem_used / 1024)) | |
mem_full=$((mem_full / 1024)) | |
kernel=$(uname -r) | |
pkg=$(pacman -Q | wc -l) | |
aur_pkg=$(pacman -Qm | wc -l) | |
ex_pkg=$(pacman -Qqe | wc -l) | |
user=${USER} | |
hostname=$(hostname) | |
# Greeting | |
printf " ${bold}❤$normal Hello $(echo "$user" | sed 's/.*/\u&/') <3 ${bold}(${user}@${hostname})${normal}\n" | |
# Kernel | |
printf " ${bold}Kernel:${normal} ${kernel}\n" | |
# Memory | |
printf " ${bold}Memory:${normal} ${mem_used} MB / ${mem_full} MB\n" | |
# Packages | |
printf " ${bold}Packages:${normal} ${pkg} (Explicit: ${ex_pkg}, AUR: ${aur_pkg})\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment