Last active
September 19, 2021 21:46
-
-
Save Apeiros-46B/69832a7152f029d0ae793b672a2f97ae to your computer and use it in GitHub Desktop.
Fetch utility. "sing" and the code for color printing are from https://github.com/Manas140/sh, and wmctrl is needed for detecting the window manager.
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/bash | |
c1="\033[1;30m" | |
c2="\033[1;31m" | |
c3="\033[1;32m" | |
c4="\033[1;33m" | |
c5="\033[1;34m" | |
c6="\033[1;35m" | |
c7="\033[1;36m" | |
c8="\033[1;37m" | |
end="\033[1;0m" | |
e1="dist" | |
e2="krnl" | |
e3="init" | |
e4="shll" | |
e5="winm" | |
distro=$(cat /etc/os-release | grep ID | awk -F= '{ print $2 }' | head -1) | |
kernel=$(uname -r) | |
init="" | |
if init --version > /dev/null; then | |
init=$(init --version | head -1 | awk '{ print $2 }' | awk -F\( '{ print $1 }') | |
else | |
init=$(stat /sbin/init | head -1 | awk '{ print $4 }') | |
fi | |
windowmanager=$(wmctrl -m | grep Name | awk '{print $2}') | |
echo -e "$c5$e1 $c6- $(sing $distro)" | |
echo -e "$c5$e2 $c6- $(sing $kernel)" | |
echo -e "$c5$e3 $c6- $(sing $init)" | |
echo -e "$c5$e4 $c6- $(sing $SHELL)" | |
echo -e "$c5$e5 $c6- $(sing $windowmanager)" | |
printf "\n$c1▇▇$c2▇▇$c3▇▇$c4▇▇$c5▇▇$c6▇▇$c7▇▇$c8▇▇$end\n\n" |
looks good now make it dependency - less !
yeah i was gonna work on that
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what it looks like:
![image](https://user-images.githubusercontent.com/61390942/133942059-5f033ee0-9498-4c02-b67a-feb959304ca8.png)