Mint az látszik, nem puppy linuxon futtatva (MX és antix) illetve minden olyan rendszeren amelyben van vagy telepíthető a gtkdialog - is jól működik.
Bal oldali frame:
CPU cache méret, microcode, CPU model
alatta főbb utasításkészletek
alatta órajelek 1500ms-os frissítéssel /mag és szál
---
jobb oldali frame:
ram info
legalul uptime, mióta fut a rendszer eltelt időben is kifejezve. Az lm = long mode vagy 64 bit, a pni az az sse3 másik elnevezése, a pae és nx bit a pae és nx képesség, a többi szerintem ismerős mindenkinek. Az SHA és hasonszőrű utasításkészletek nem kerültek bele, lévén azokra a modern puppyk az irányadók kapásból.
Íme a szkript:
Kód: Egész kijelölése
#!/bin/bash
# This script has been originally created by nocsak with help of KuLuSz.
if [[ "$(which gtkdialog)" != "" ]];then
LANG=C
export OUTPUT_CHARSET=UTF-8
if [[ ! -f "/tmp/MEM.txt" ]];then
touch /tmp/MEM.txt && echo -e "Please wait ..." > /tmp/MEM.txt
else
echo "mar van txt"
fi
echo "#!/bin/bash
LANG=C
MEMTF=\"\$(grep \"Mem[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTAL=\"\$[\$(sed 2d <<< \"\$MEMTF\")*1024]\"
FREE=\"\$[\$(sed 1d <<< \"\$MEMTF\")*1024]\"
MEMBUFF=\"\$(grep \"Buffers:\|^Cached:\" /proc/meminfo | grep -o \"[0-9]*\")\"
CACH=\"\$[\$(sed 2d <<< \"\$MEMBUFF\")*1024]\"
BUUF=\"\$[\$(sed 1d <<< \"\$MEMBUFF\")*1024]\"
MEMSHAR=\"\$(grep \"SReclaimable:\|^Shmem:\" /proc/meminfo | grep -o \"[0-9]*\")\"
SHMEM=\"\$[\$(sed 2d <<< \"\$MEMSHAR\")*1024]\"
SREC=\"\$[\$(sed 1d <<< \"\$MEMSHAR\")*1024]\"
MEMswap=\"\$(grep \"Swap[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTALS=\"\$[\$(sed 2d <<< \"\$MEMswap\")*1024]\"
FREES=\"\$[\$(sed 1d <<< \"\$MEMswap\")*1024]\"
CUCC=\"\$[\$CACH+\$SREC]\"
CUCCALL=\"\$[\$CUCC-\$SHMEM]\"
USED=\"\$[\$TOTAL-\$FREE]\"
swapUSED=\"\$[\$TOTALS-\$FREES]\"
Allcache=\"\$[\$BUUF+\$CUCCALL]\"
REALUSED=\"\$[\$USED-\$Allcache]\"
# GBREALUSED=\"\$(printf '%.2f\n' \$(echo \"scale=2; \$REALUSED*1024\" | bc -l))\"
echo -e \"
Used: \$(echo \$[\$TOTAL-\$FREE-\$BUUF-\$CACH] | numfmt --to=iec-i --format='%.2f')
RealUsed: \$(echo \$REALUSED | numfmt --to=iec-i --format='%.2f')
Allocated: \$(echo \$USED | numfmt --to=iec-i --format='%.2f')
Free: \$(echo \$FREE | numfmt --to=iec-i --format='%.2f')
TOTAL: \$(echo \$TOTAL | numfmt --to=iec-i --format='%.2f')
swapUsed: \$(echo \$swapUSED | numfmt --to=iec-i --format='%.2f')
FreeSwap: \$(echo \$FREES | numfmt --to=iec-i --format='%.2f')
TOTALswap: \$(echo \$TOTALS | numfmt --to=iec-i --format='%.2f')
\" > /tmp/MEM.txt
" > /tmp/MEM.sh && chmod +x /tmp/MEM.sh
# grep "microcode\|model name\|cache size" /proc/cpuinfo| sort |uniq|rev|cut -f1 -d":"|rev|cut -f2- -d" "| tr "\n" " "; grep -io --color=always " pae \| nx \| lm \| avx \| avx2 " /proc/cpuinfo |sort |uniq|tr "\n" "|";grep "cpu MHz" /proc/cpuinfo|rev|cut -f1 -d" "|rev| tr "\n" " "
# wakkk=$(iw dev | awk '$1=="Interface"{print $2}')
####export wakkk="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | head -n1)"
#export wakkkl="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | wc -l)"
export since="$(uptime -s)"
export MAIN_DIALOG="
<window title=\"$(gettext 'Brief Sys Info')\" icon-name=\"gtk-convert\" resizable=\"true\">
<vbox scrollable=\"true\" width=\"670\" height=\"370\">
<hbox>
<frame Clock speed:>
<text>
<label>nincs</label>
<input>exec grep 'microcode\|model name\|cache size' /proc/cpuinfo| sort |uniq|rev|cut -f1 -d':'|rev|cut -f2- -d' '| tr '\n' ' ';printf '\n\n'; grep -io ' pae \| nx \| lm \| avx \| avx2 \| sse \| ssse3 \|sse2\| sse4\| sse3 \| pni \| fma\| aes ' /proc/cpuinfo |sort |uniq|tr '\n' '|';printf '\n\n';grep 'cpu MHz' /proc/cpuinfo|rev|cut -f1 -d' '|rev </input>
<variable>nocsak</variable>
</text>
<timer milliseconds=\"true\" interval=\"1500\" visible=\"false\">
<action>refresh:nocsak</action>
</timer>
</frame>
<frame RAM>
<text auto-refresh=\"true\">
<label>wait</label>
<input file>/tmp/MEM.txt</input>
<variable>nocsako</variable>
</text>
<timer milliseconds=\"true\" interval=\"2500\" visible=\"false\">
<action>exec /tmp/MEM.sh</action>
</timer>
</frame>
</hbox>
<text>
<label>nincs</label>
<input>echo -n \"since: \"; echo ${since} </input>
</text>
<text>
<label>nincs</label>
<input>echo -n \"Uptime: \";uptime | cut -f4- -d' ' | cut -d',' -f1</input>
<variable>nocsaki</variable>
</text>
<timer milliseconds=\"true\" interval=\"5500\" visible=\"false\">
<action>refresh:nocsaki</action>
</timer>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>$(gettext 'QUIT')</label></button>
</hbox>
</vbox>
</window>"
gtkdialog --program=MAIN_DIALOG --center
else
xmessage -title "Error" "No gtkdialog installed!" &
fi
És íme ehhez is a szkript:
Kód: Egész kijelölése
#!/bin/bash
# This script has been originally created by nocsak with help of KuLuSz.
if [[ "$(which gtkdialog)" != "" ]];then
LANG=C
export OUTPUT_CHARSET=UTF-8
if [[ ! -f "/tmp/MEM.txt" ]];then
touch /tmp/MEM.txt && echo -e "Please wait ..." > /tmp/MEM.txt
else
echo "mar van txt"
fi
echo "#!/bin/bash
LANG=C
MEMTF=\"\$(grep \"Mem[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTAL=\"\$[\$(sed 2d <<< \"\$MEMTF\")*1024]\"
FREE=\"\$[\$(sed 1d <<< \"\$MEMTF\")*1024]\"
MEMBUFF=\"\$(grep \"Buffers:\|^Cached:\" /proc/meminfo | grep -o \"[0-9]*\")\"
CACH=\"\$[\$(sed 2d <<< \"\$MEMBUFF\")*1024]\"
BUUF=\"\$[\$(sed 1d <<< \"\$MEMBUFF\")*1024]\"
MEMSHAR=\"\$(grep \"SReclaimable:\|^Shmem:\" /proc/meminfo | grep -o \"[0-9]*\")\"
SHMEM=\"\$[\$(sed 2d <<< \"\$MEMSHAR\")*1024]\"
SREC=\"\$[\$(sed 1d <<< \"\$MEMSHAR\")*1024]\"
MEMswap=\"\$(grep \"Swap[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTALS=\"\$[\$(sed 2d <<< \"\$MEMswap\")*1024]\"
FREES=\"\$[\$(sed 1d <<< \"\$MEMswap\")*1024]\"
CUCC=\"\$[\$CACH+\$SREC]\"
CUCCALL=\"\$[\$CUCC-\$SHMEM]\"
USED=\"\$[\$TOTAL-\$FREE]\"
swapUSED=\"\$[\$TOTALS-\$FREES]\"
Allcache=\"\$[\$BUUF+\$CUCCALL]\"
REALUSED=\"\$[\$USED-\$Allcache]\"
# GBREALUSED=\"\$(printf '%.2f\n' \$(echo \"scale=2; \$REALUSED*1024\" | bc -l))\"
echo -e \"
Used: \$(echo \$[\$TOTAL-\$FREE-\$BUUF-\$CACH] | numfmt --to=iec-i --format='%.2f')
RealUsed: \$(echo \$REALUSED | numfmt --to=iec-i --format='%.2f')
Allocated: \$(echo \$USED | numfmt --to=iec-i --format='%.2f')
Free: \$(echo \$FREE | numfmt --to=iec-i --format='%.2f')
TOTAL: \$(echo \$TOTAL | numfmt --to=iec-i --format='%.2f')
swapUsed: \$(echo \$swapUSED | numfmt --to=iec-i --format='%.2f')
FreeSwap: \$(echo \$FREES | numfmt --to=iec-i --format='%.2f')
TOTALswap: \$(echo \$TOTALS | numfmt --to=iec-i --format='%.2f')
\" > /tmp/MEM.txt
" > /tmp/MEM.sh && chmod +x /tmp/MEM.sh
# grep "microcode\|model name\|cache size" /proc/cpuinfo| sort |uniq|rev|cut -f1 -d":"|rev|cut -f2- -d" "| tr "\n" " "; grep -io --color=always " pae \| nx \| lm \| avx \| avx2 " /proc/cpuinfo |sort |uniq|tr "\n" "|";grep "cpu MHz" /proc/cpuinfo|rev|cut -f1 -d" "|rev| tr "\n" " "
# wakkk=$(iw dev | awk '$1=="Interface"{print $2}')
####export wakkk="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | head -n1)"
#export wakkkl="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | wc -l)"
export since="$(uptime -s)"
decoder=""
if [[ "$(dmidecode -t memory | grep "Maximum Capacity: " > /dev/null && echo "OK" || echo "Failed")" != "Failed" ]];then
decoder="$decoder
<text wrap=\"true\" width-chars=\"20\">
<label>nincs</label>
<input>dmidecode -t memory | grep 'Maximum Capacity: '</input>
<variable>nocsakid</variable>
</text>
<timer milliseconds=\"true\" interval=\"5500\" visible=\"false\">
<action>refresh:nocsakid</action>
</timer>
"
else
decoder="$decoder
<text wrap=\"true\" width-chars=\"20\">
<label>sudo or root required</label>
<input>echo 'sudo or root \n required here'</input>
</text>
"
fi
export MAIN_DIALOG="
<window title=\"$(gettext 'Brief Sys Info')\" icon-name=\"gtk-convert\" resizable=\"true\">
<vbox scrollable=\"true\" width=\"420\" height=\"420\">
<hbox>
<frame Clock speed:>
<text wrap=\"true\" width-chars=\"25\">
<label>nincs</label>
<input>exec grep 'microcode\|model name\|cache size' /proc/cpuinfo| sort |uniq|rev|cut -f1 -d':'|rev|cut -f2- -d' '| tr '\n' ' ';printf '\n\n'; grep -io ' pae \| nx \| lm \| avx \| avx2 \| sse \| ssse3 \|sse2\| sse4\| sse3 \| pni \| fma\| aes ' /proc/cpuinfo |sort |uniq|tr '\n' '|';printf '\n\n';grep 'cpu MHz' /proc/cpuinfo|rev|cut -f1 -d' '|rev </input>
<variable>nocsak</variable>
</text>
<timer milliseconds=\"true\" interval=\"1500\" visible=\"false\">
<action>refresh:nocsak</action>
</timer>
</frame>
<frame RAM>
<text auto-refresh=\"true\">
<label>wait</label>
<input file>/tmp/MEM.txt</input>
<variable>nocsako</variable>
</text>
<timer milliseconds=\"true\" interval=\"2500\" visible=\"false\">
<action>exec /tmp/MEM.sh</action>
</timer>
${decoder}
</frame>
</hbox>
<text>
<label>nincs</label>
<input>echo -n \"since: \"; echo ${since} </input>
</text>
<text>
<label>nincs</label>
<input>echo -n \"Uptime: \";uptime | cut -f4- -d' ' | cut -d',' -f1</input>
<variable>nocsaki</variable>
</text>
<timer milliseconds=\"true\" interval=\"5500\" visible=\"false\">
<action>refresh:nocsaki</action>
</timer>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>$(gettext 'QUIT')</label></button>
</hbox>
</vbox>
</window>"
gtkdialog --program=MAIN_DIALOG --center
else
xmessage -title "Error" "No gtkdialog installed!" &
fi
rm /tmp/MEM.txt /tmp/MEM.sh
Kérésre belevettem az összes "jelentősebb" utasításkészletet:
https://unix.stackexchange.com/question ... uinfo-mean
Íme a 3. (remélhetőleg most már végleges) szkript:
Kód: Egész kijelölése
#!/bin/bash
# This script has been originally created by nocsak with help of KuLuSz and NTamas and Mobulla.
if [[ "$(which gtkdialog)" != "" ]];then
LANG=C
export OUTPUT_CHARSET=UTF-8
if [[ ! -f "/tmp/MEM.txt" ]];then
touch /tmp/MEM.txt && echo -e "Please wait ..." > /tmp/MEM.txt
else
echo "mar van txt"
fi
echo "#!/bin/bash
LANG=C
MEMTF=\"\$(grep \"Mem[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTAL=\"\$[\$(sed 2d <<< \"\$MEMTF\")*1024]\"
FREE=\"\$[\$(sed 1d <<< \"\$MEMTF\")*1024]\"
MEMBUFF=\"\$(grep \"Buffers:\|^Cached:\" /proc/meminfo | grep -o \"[0-9]*\")\"
CACH=\"\$[\$(sed 2d <<< \"\$MEMBUFF\")*1024]\"
BUUF=\"\$[\$(sed 1d <<< \"\$MEMBUFF\")*1024]\"
MEMSHAR=\"\$(grep \"SReclaimable:\|^Shmem:\" /proc/meminfo | grep -o \"[0-9]*\")\"
SHMEM=\"\$[\$(sed 2d <<< \"\$MEMSHAR\")*1024]\"
SREC=\"\$[\$(sed 1d <<< \"\$MEMSHAR\")*1024]\"
MEMswap=\"\$(grep \"Swap[TF]\" /proc/meminfo | grep -o \"[0-9]*\")\"
TOTALS=\"\$[\$(sed 2d <<< \"\$MEMswap\")*1024]\"
FREES=\"\$[\$(sed 1d <<< \"\$MEMswap\")*1024]\"
CUCC=\"\$[\$CACH+\$SREC]\"
CUCCALL=\"\$[\$CUCC-\$SHMEM]\"
USED=\"\$[\$TOTAL-\$FREE]\"
swapUSED=\"\$[\$TOTALS-\$FREES]\"
Allcache=\"\$[\$BUUF+\$CUCCALL]\"
REALUSED=\"\$[\$USED-\$Allcache]\"
# GBREALUSED=\"\$(printf '%.2f\n' \$(echo \"scale=2; \$REALUSED*1024\" | bc -l))\"
echo -e \"
Used: \$(echo \$[\$TOTAL-\$FREE-\$BUUF-\$CACH] | numfmt --to=iec-i --format='%.2f')
RealUsed: \$(echo \$REALUSED | numfmt --to=iec-i --format='%.2f')
Allocated: \$(echo \$USED | numfmt --to=iec-i --format='%.2f')
Free: \$(echo \$FREE | numfmt --to=iec-i --format='%.2f')
TOTAL: \$(echo \$TOTAL | numfmt --to=iec-i --format='%.2f')
swapUsed: \$(echo \$swapUSED | numfmt --to=iec-i --format='%.2f')
FreeSwap: \$(echo \$FREES | numfmt --to=iec-i --format='%.2f')
TOTALswap: \$(echo \$TOTALS | numfmt --to=iec-i --format='%.2f')
\" > /tmp/MEM.txt
" > /tmp/MEM.sh && chmod +x /tmp/MEM.sh
# grep "microcode\|model name\|cache size" /proc/cpuinfo| sort |uniq|rev|cut -f1 -d":"|rev|cut -f2- -d" "| tr "\n" " "; grep -io --color=always " pae \| nx \| lm \| avx \| avx2 " /proc/cpuinfo |sort |uniq|tr "\n" "|";grep "cpu MHz" /proc/cpuinfo|rev|cut -f1 -d" "|rev| tr "\n" " "
# wakkk=$(iw dev | awk '$1=="Interface"{print $2}')
####export wakkk="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | head -n1)"
#export wakkkl="$(cat /proc/net/arp | grep -v 'IP' | awk '{print $6}' | wc -l)"
export since="$(uptime -s)"
decoder=""
if [[ "$(dmidecode -t memory | grep "Maximum Capacity: " > /dev/null && echo "OK" || echo "Failed")" != "Failed" ]];then
decoder="$decoder
<text wrap=\"true\" width-chars=\"20\">
<label>nincs</label>
<input>dmidecode -t memory | grep 'Maximum Capacity: '</input>
<variable>nocsakid</variable>
</text>
<timer milliseconds=\"true\" interval=\"5500\" visible=\"false\">
<action>refresh:nocsakid</action>
</timer>
"
else
decoder="$decoder
<text wrap=\"true\" width-chars=\"20\">
<label>sudo or root required</label>
<input>echo 'sudo or root \n required here'</input>
</text>
"
fi
export MAIN_DIALOG="
<window title=\"$(gettext 'Brief Sys Info')\" icon-name=\"gtk-convert\" resizable=\"true\">
<vbox scrollable=\"true\" width=\"420\" height=\"420\">
<hbox>
<frame Clock speed:>
<text wrap=\"true\" width-chars=\"25\">
<label>nincs</label>
<input>exec grep 'microcode\|model name\|cache size' /proc/cpuinfo| sort |uniq|rev|cut -f1 -d':'|rev|cut -f2- -d' '| tr '\n' ' ';printf '\n\n'; grep -io 'sha_ni\| pae \| nx \| lm \| avx \| avx2 \| sse \| ssse3 \|sse2\|sse3 \|pni \| fma\| aes \|sse4_1 \|sse4_2 \|mmx\| vmx \| svm \| smx \| hypervisor \| ht \| mp \| abm \|sse4a\| lpae ' /proc/cpuinfo |sort |uniq|tr '\n' ' ';printf '\n\n';grep 'cpu MHz' /proc/cpuinfo|rev|cut -f1 -d' '|rev </input>
<variable>nocsak</variable>
</text>
<timer milliseconds=\"true\" interval=\"1500\" visible=\"false\">
<action>refresh:nocsak</action>
</timer>
</frame>
<frame RAM>
<text auto-refresh=\"true\">
<label>wait</label>
<input file>/tmp/MEM.txt</input>
<variable>nocsako</variable>
</text>
<timer milliseconds=\"true\" interval=\"2500\" visible=\"false\">
<action>exec /tmp/MEM.sh</action>
</timer>
${decoder}
</frame>
</hbox>
<text>
<label>nincs</label>
<input>echo -n \"since: \"; echo ${since} </input>
</text>
<text>
<label>nincs</label>
<input>echo -n \"Uptime: \";uptime | cut -f4- -d' ' | cut -d',' -f1</input>
<variable>nocsaki</variable>
</text>
<timer milliseconds=\"true\" interval=\"5500\" visible=\"false\">
<action>refresh:nocsaki</action>
</timer>
<hbox>
<button><input file stock=\"gtk-quit\"></input><label>$(gettext 'QUIT')</label></button>
</hbox>
</vbox>
</window>"
gtkdialog --program=MAIN_DIALOG --center
else
xmessage -title "Error" "No gtkdialog installed!" &
fi
rm /tmp/MEM.txt /tmp/MEM.sh