Last active
February 2, 2021 16:33
-
-
Save cybardev/90a4bd98f8820424ac0be62aaae3f480 to your computer and use it in GitHub Desktop.
Simple, cute pfetch/ufetch alternative by elenapan, with some modifications to suit my case
This file contains hidden or 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
| #!/usr/bin/bash | |
| # Tiny colored fetch script | |
| # Requires Typicons Font to display the icons | |
| f=3 b=4 | |
| for j in f b; do | |
| for i in {0..7}; do | |
| printf -v $j$i %b "\e[${!j}${i}m" | |
| done | |
| done | |
| d=$'\e[1m' | |
| t=$'\e[0m' | |
| v=$'\e[7m' | |
| # Items | |
| sep= | |
| s=$d$f0$sep$t | |
| w= | |
| netname="$(nmcli -g common | grep -m 1 connected | awk '{print($4)}')" | |
| [[ -z $netname ]] && netname="no wifi" | |
| h= | |
| wmname="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep -m 1 "WM_NAME" | cut -f2 -d \")" | |
| k= | |
| kernel="$(uname -r | cut -d '-' -f1)" | |
| r= | |
| resolution="$(xwininfo -root | grep geometry | awk '{print $2}' | cut -d + -f1)" | |
| sh= | |
| shell=$(basename $SHELL) | |
| # /\_/\ | |
| # ( o.o ) | |
| # > ^ < | |
| # /\_/\ | |
| # ( ·.· ) | |
| # > ^ < | |
| # /\_/\ | |
| # ( -.- ) | |
| # > ^ < | |
| tput clear | |
| cat << EOF | |
| $d$f1$h $t$wmname | |
| /\_/\ $f3$k $t$kernel | |
| ( $d^.^$t ) $f2$sh $t$shell | |
| $f1>$t $f3^$t $f1<$t $f5$r $t$resolution | |
| $f4$w $t$netname | |
| EOF |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How it looks:
Changes made:
line 1: changed shebang from#!/bin/bashto#!/usr/bin/bash(personal preference)line 20: changed the variable name fromwifinametonetnameline 20: changed the command that gets network name to show wired connection when availableline 21: added a condition for when not connected to the internetline 24: added-m 1flag to grep to avoid printing multiple instances of wmname (in my case I had two -xfce4andXfce4)lines 35-54: changed code to display a kitty instead of a bunnyLinks: