#!/bin/sh ###################################################################### # @author : swytch (adapated from github.com/jschx/ufetch) # @file : fetch # @license : GPLv3 # @created : Wednesday May 20, 2020 18:16:09 CEST # # @description : display system infos ###################################################################### ## INFO # $USER is already defined host="$(cat /etc/hostname)" os='Arch Linux' kernel="$(uname -sr)" uptime="$(uptime -p | sed 's/up //')" packages="$(pacman -Q | wc -l)" shell="$(basename "$SHELL")" wm="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)" memav="$(grep "MemAvailable" /proc/meminfo | cut -d ':' -f 2 | awk '{ print int($1 / 1024) }')" memtot="$(grep "MemTotal" /proc/meminfo | cut -d ':' -f 2 | awk '{ print int($1 / 1024) }')" memus="$(expr $memtot - $memav)" # set colors if [ -x "$(command -v tput)" ]; then bold="$(tput bold)" black="$(tput setaf 0)" red="$(tput setaf 1)" green="$(tput setaf 2)" yellow="$(tput setaf 3)" blue="$(tput setaf 4)" magenta="$(tput setaf 5)" cyan="$(tput setaf 6)" white="$(tput setaf 7)" reset="$(tput sgr0)" fi # you can change these lc="${bold}${blue}" # labels nc="${bold}${magenta}" # user and hostname ic="${reset}" # info c0="${reset}" # first color cat <