Skip to content

Instantly share code, notes, and snippets.

@Leinnan
Created December 30, 2016 00:59
Show Gist options
  • Save Leinnan/306f2c255ab2c8460bb6a6c2b3ccdb23 to your computer and use it in GitHub Desktop.
Save Leinnan/306f2c255ab2c8460bb6a6c2b3ccdb23 to your computer and use it in GitHub Desktop.
Ufetch for Manjaro
#!/bin/sh
HOST="$(hostname)"
OS="Manjaro Linux"
KERNEL="$(uname -sr)"
WM=$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | sed -e 's/_NET_WM_NAME = \"\(.*\)\"/\1/')
UPTIME="$(uptime -p | sed s:"up "::)"
PACKAGES="$(pacman -Q | wc -l)"
## DEFINE COLORS
# probably don't change these
bc="$(tput bold)" # bold
c0="$(tput setaf 0)" # black
c1="$(tput setaf 1)" # red
c2="$(tput setaf 2)" # green
c3="$(tput setaf 3)" # yellow
c4="$(tput setaf 4)" # blue
c5="$(tput setaf 5)" # magenta
c6="$(tput setaf 6)" # cyan
c7="$(tput setaf 7)" # white
rc="$(tput sgr0)" # reset
# you can change these
lc="${bc}${c2}" # labels
nc="${bc}${c2}" # user and hostname
tc="${bc}${c7}" # text
fc="${bc}${c2}" # first color
sc="${c2}" # second color
cat << EOF
${fc} |‾‾‾‾‾‾‾| |‾‾| ${nc}${USER}${tc}@${nc}${HOST}${rc}
${fc} | _____| | | ${lc}OS: ${tc}${OS}${rc}
${fc} | | | | ${lc}KERNEL: ${tc}${KERNEL}${rc}
${fc} | | |‾‾| | | ${lc}UPTIME: ${tc}${UPTIME}${rc}
${fc} | | | | | | ${lc}PACKAGES: ${tc}${PACKAGES}${rc}
${fc} | | | | | | ${lc}SHELL: ${tc}${SHELL}${rc}
${fc} |__| |__| |__| ${lc}WM: ${tc}${WM}${rc}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment