sysinfo -- Linux sysinfo fetch script
by putrid - Thursday June 13, 2024 at 04:54 AM
#1
Preview:
[Image: 6rachb.png]

How To Use:
chmod +x sysinfo.sh ./sysinfo.sh

Source Code:
#!/bin/sh #sysinfo by putrid #█▓▒░ vars FULL=━ EMPTY=┄ name=$USER host=$HOSTNAME battery="/sys/class/power_supply/BAT0" distro=$(cat /etc/os-release | grep '^NAME=' | cut -d '"' -f 2)  kernel=$(uname -r | sed 's/ARCH/0x0/') )  pkgs=$(yay -Qqs | wc -l) # Fetch other configurations (adjust according to your setup)  colors="CHANGE ME  font="CHANGE ME  wm=$(wmctrl -m | grep 'Name:' | awk '{print $2}') #█▓▒░ progress bar draw() {   perc=$1   size=$2   inc=$(( perc * size / 100 ))   out=   if [ -z $3 ]   then     color="36"   else     color="$3"   fi   for v in `seq 0 $(( size - 1 ))`; do     test "$v" -le "$inc"  \     && out="${out}\e[1;${color}m${FULL}" \     || out="${out}\e[0;${color}m${EMPTY}"   done   printf $out } #█▓▒░ colors printf "\n  " i=0 while [ $i -le 6 ] do   printf "\e[$((i+41))m\e[$((i+30))m█▓▒░"   i=$(($i+1)) done printf "\e[37m█\e[0m▒░\n\n" #█▓▒░ environment printf " \e[1;33m      distro \e[0m$distro\n" printf " \e[1;33m      system \e[0m$host\n" printf " \e[1;33m      kernel \e[0m$kernel\n" printf " \e[1;33m    packages \e[0m$pkgs\n" printf " \e[1;33m          wm \e[0m$wm\n" printf " \e[1;33m        font \e[0m$font\n" printf " \e[1;33m      colors \e[0m$colors\n" printf " \e[0m\n" #█▓▒░ cpu cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}') c_lvl=`printf "%.0f" $cpu` printf "  \e[0;36m%-4s \e[1;36m%-5s %-25s \n" " cpu" "$c_lvl%" `draw $c_lvl 15` #█▓▒░ ram ram=`free | awk '/Mem:/ {print int($3/$2 * 100.0)}'` printf "  \e[0;36m%-4s \e[1;36m%-5s %-25s \n" " ram" "$ram%" `draw $ram 15`
Ban reason: Scamming | Last IP: 172.7.7.248 | https://raidforums.su/Forum-Ban-Appeals if you feel this is incorrect. (Permanent)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linux from Scratch kirby 7 4,850 01-06-2026, 05:33 PM
Last Post: swisstiger
  your linux distro dundrondo 22 4,580 04-10-2025, 11:36 AM
Last Post: fogplank
  Thinking to switch from windows to linux? Budne01 10 5,571 01-24-2025, 11:38 PM
Last Post: TheBanano21
  A Beginner's Guide to Writing a Simple Linux Rootkit Ilikecrackers 1 1,204 12-25-2024, 10:24 AM
Last Post: Ilikecrackers
  Alpine Linux Croquet 5 2,359 11-13-2024, 05:30 PM
Last Post: neddiH



 Users browsing this thread: 1 Guest(s)