0 Members and 1 Guest are viewing this topic.
#! /bin/bash#--------------------------------------------------------------------------------------------------------# Info tool working with Gedit by Misko_2083 Update Sysdrum#--------------------------------------------------------------------------------------------------------#inxi installed?if [ -z "$(which inxi)" ]; then if zenity --title="Question" --question text="Inxi is not installed, do you want to install it?\nIf you choose No program will exit." then gksudo "sudo apt-get install inxi -y" | zenity --progress --title="Installing inxi" --text="please wait" --pulsate --auto-close if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error --title="Error" --text="inxi could not be installed." exit fi else exit fifi#gedit installed?if [ $(dpkg-query -W -f='${Status}' gedit 2>/dev/null | grep -c "ok installed") -eq 0 ];then if zenity --title="Question" --question text="Gedit is not installed, do you want to install it?\nIf you choose No program will exit." then gksudo "sudo apt-get install gedit -y" | zenity --progress --title="Installing Gedit" --text="please wait" --pulsate --auto-close if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error --title="Error" --text="Gedit could not be installed." exit fi else exit fifidisk_df=(FALSE "Fs disk space info" "df -Th | grep /dev/sd" "View filesystem disk space usage")FDISK=(FALSE "List Partitions" "sudo fdisk -l" "List out the partition information (password required)")BLOCKDEV=(FALSE "Display Block Devices" "lsblk" "List out information all block devices")lspci_info=(FALSE "PCI info" "lspci -vnn" "View PCI devices info")lspci_graph=(FALSE "Graphics" "lspci -vnn | grep VGA -A 12" "View graphics devices info")lsusb_info=(FALSE "USB info" "lsusb" "View usb devices info")CPU=(FALSE "32/64 bit CPU" " " "Find out is this 32 or 64 bit CPU")CPUZ=(FALSE "Processor info" "lscpu" "Display detailed info on CPU")OS=(FALSE "32/64 bit OS" "uname -a" "Find out is this 32 or 64 bit OS")inxi_full=(FALSE "Full info" "inxi -Fxz" "View system info")inxi_df=(FALSE "Partition info" "inxi -plu" "View partition info")REPOS=(FALSE "View Repositories" "inxi -r" "View repositories on this sistem")GRAPHICS=(FALSE "View Graphics" "inxi -Gxx" "View graphics on this sistem")AUDIO=(FALSE "View Audio" "inxi -A" "View audio on this sistem")NETWORK=(FALSE "View Network" "inxi -nz" "View network on this sistem")NETWORKC=(FALSE "Network Configuration" "ifconfig -a" "View network configuration on this sistem")OPENGL=(FALSE "View OpenGL configuration" "glxinfo | grep OpenGL" "View OpenGL configuration on this sistem")LSB=(FALSE "View lsb release" "lsb_release -dic" "View lsb release info")ic="/usr/share/icons/zenity-llcc.png"selection=$(zenity --window-icon="$ic" --list --checklist --width=900 --height=700 --column="Select" --column="Name" --column="Command" \--column="Description" --text="Select the info tool you wish to use, then click the Display button." --title="Info" --ok-label="Display" --cancel-label="Quit" --separator="\n" \"${disk_df[@]}" \"${FDISK[@]}" \"${BLOCKDEV[@]}" \"${lspci_info[@]}" \"${lspci_graph[@]}" \"${lsusb_info[@]}" \"${CPU[@]}" \"${CPUZ[@]}" \"${OS[@]}" \"${inxi_full[@]}" \"${inxi_df[@]}" \"${REPOS[@]}" \"${GRAPHICS[@]}" \"${AUDIO[@]}" \"${NETWORK[@]}" \"${NETWORKC[@]}" \"${OPENGL[@]}" \"${LSB[@]}" )# If Quit is clicked then exitif [ "${PIPESTATUS[0]}" -ne "0" ]; thenexit 0fi# check if anything is selectedecho $selection | grep '[a-zA-Z0-9]'if [ "${PIPESTATUS[1]}" -ne "0" ]; thenzenity --info --title='Info' --text='Nothing was selected.'exit 0fiecho $selection | grep "^Fs disk space info" > /dev/nullif [ $? = 0 ];then SOME_TEXT="df - View file system disk space usage\nYou can select the mount to open in the file manager" SOME_TITLE="df" df -h -T| tail -n+2 | while read fs type size used rest target; do if [[ $rest ]] ; then echo "$fs" "$type" "$size"B "$used"B "$rest"B "${target[@]}" | grep /dev/sd | # remove "grep /dev/sd |" to show all awk '{print $1,"\n",$2,"\n",$3,"\n",$4,"\n",$5,"\n",$6}BEGIN{ s = 7; e = 35; }{for (i=s; i<=e; i++) printf("%s%s", $(i), i<e ? OFS : "\n"); }' #Workaround for disk labels that contain whitespaces(number of characters that can be divided by whitespace =e-s) fi done | sed -e 's/[ \t]*$//' $1|zenity --list --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Device" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="7"| cut -d '|' -f2| tee /tmp/tempdf #With radiolist is also an option #done | sed -e 's/[ \t]*$//' $1| sed 's!^/dev/sd*!FALSE\n/dev/sd!g' | zenity --list --radiolist --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Select" --column="FS" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="8"| cut -d '|' -f2| tee /tmp/tempdf if [ -z "$(cat /tmp/tempdf)" ]; then exit 0 fi xdg-open "$(cat /tmp/tempdf)" rm -f /tmp/tempdffiecho $selection | grep "List Partitions" > /dev/nullif [ $? = 0 ];then gksudo --message 'To run this tool your password is required. Enter your password, or press Cancel.' 'sudo fdisk -l' |tee /tmp/lsblkinfo.txt| zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in gedit" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then gedit /tmp/lsblkinfo.txt; rm /tmp/lsblkinfo.txt else exit 0 fifiecho $selection | grep "Display Block Devices" > /dev/nullif [ $? = 0 ];then lsblk | zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsblk > /tmp/lsblkinfo.txt; gedit /tmp/lsblkinfo.txt; rm /tmp/lsblkinfo.txt else exit 0 fifiecho $selection | grep "PCI info" > /dev/nullif [ $? = 0 ];then lspci -vnn | zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lspci -nn > /tmp/lspciinfo.txt; gedit /tmp/lspciinfo.txt; rm /tmp/lspciinfo.txt else exit 0 fifiecho $selection | grep "^Graphics$" > /dev/nullif [ $? = 0 ];then lspci -vnn | grep VGA -A 12 | zenity --title="Graphics" --text-info --width=800 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then lspci -vnn | grep VGA -A 12 > /tmp/lspcigraph.txt; gedit /tmp/lspcigraph.txt; rm /tmp/lspcigraph.txt else exit 0 fifiecho $selection | grep "USB info" > /dev/nullif [ $? = 0 ];then lsusb | zenity --title="USB info" --text-info --width=800 --height=400 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsusb > /tmp/lsusbinfo.txt; gedit /tmp/lsusbinfo.txt; rm /tmp/lsusbinfo.txt else exit 0 fifiecho $selection | grep "32/64 bit CPU" > /dev/nullif [ $? = 0 ];then if [ "$(egrep -c ' lm ' /proc/cpuinfo)" -lt "1" ]; then bus_zen="32" else bus_zen="64" fi zenity --title="32/64 bit CPU" --info --text="This is $bus_zen bit CPU"fiecho $selection | grep "Processor info" > /dev/nullif [ $? = 0 ];then lscpu | zenity --title="Processor info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lscpu > /tmp/processorinfo.txt; gedit /tmp//tmp/processorinfo.txt; rm /tmp/processorinfo.txt else exit 0 fifiecho $selection | grep "32/64 bit OS" > /dev/nullif [ $? = 0 ];then if [ "$(uname -a | egrep -c 'i386|i486|i586|i686')" -eq "1" ]; then os_zen="32" else os_zen="64" fi zenity --title="32/64 bit OS" --info --text="This is $os_zen bit OS"fiecho $selection | grep "Full info" > /dev/nullif [ $? = 0 ];then inxi -Fxz -c 0 | zenity --title="Full info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -Fxz -c 0 > /tmp/inxifull.txt; gedit /tmp/inxifull.txt; rm /tmp/inxifull.txt else exit 0 fifiecho $selection | grep "Partition info" > /dev/nullif [ $? = 0 ];then inxi -plu -c 0 | zenity --title="Partition info" --text-info --width=650 --height=400 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -plu -c 0 > /tmp/partitionsinfo.txt; gedit /tmp/partitionsinfo.txt; rm /tmp/partitionsinfo.txt else exit 0 fifiecho $selection | grep "View Repositories" > /dev/nullif [ $? = 0 ];then inxi -r -c 0| zenity --title="Repositories" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -r -c 0 > /tmp/repositorieslist.txt; gedit /tmp/repositorieslist.txt; rm /tmp/repositorieslist.txt else exit 0 fi fiecho $selection | grep "View Graphics" > /dev/nullif [ $? = 0 ];then inxi -Gxx -c 0| zenity --title="Graphics info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -Gxx -c 0 > /tmp/graphicsinfo.txt; gedit /tmp/graphicsinfo.txt; rm /tmp/graphicsinfo.txt else exit 0 fifiecho $selection | grep "View Audio" > /dev/nullif [ $? = 0 ];then inxi -A -c 0| zenity --title="Audio info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -A -c 0 > /tmp/audioinfo.txt; gedit /tmp/audioinfo.txt; rm /tmp/audioinfo.txt else exit 0 fifiecho $selection | grep "^View Network$" > /dev/nullif [ $? = 0 ];then inxi -nz -c 0 | zenity --title="Network info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -nz -c 0 > /tmp/networkinfo.txt; gedit /tmp/networkinfo.txt; rm /tmp/networkinfo.txt else exit 0 fifiecho $selection | grep "Network Configuration" > /dev/nullif [ $? = 0 ];then ifconfig -a | zenity --title="Network info" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then ifconfig -a > /tmp/networkconfinfo.txt; gedit /tmp/networkconfinfo.txt; rm /tmp/networkconfinfo.txt else exit 0 fifiecho $selection | grep "View OpenGL configuration" > /dev/nullif [ $? = 0 ];then glxinfo | grep OpenGL| zenity --title="View OpenGL configuration" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then glxinfo | grep OpenGL > /tmp/openglinfo.txt; gedit /tmp/openglinfo.txt; rm /tmp/openglinfo.txt else exit 0 fifiecho $selection | grep "View lsb release" > /dev/nullif [ $? = 0 ];then lsb_release -dic| zenity --title="lsb_release" --text-info --width=850 --height=600 --ok-label="Open in Gedit" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsb_release -dic > /tmp/lsbinfo.txt; gedit /tmp/lsbinfo.txt; rm /tmp/lsbinfo.txt else exit 0 fifi
#! /bin/bash#--------------------------------------------------------------------------------------------------------# Info tool by Misko_2083#--------------------------------------------------------------------------------------------------------#inxi installed?if [ -z "$(which inxi)" ]; then if zenity --title="Question" --question text="Inxi is not installed, do you want to install it?\nIf you choose No program will exit." then gksudo "sudo apt-get install inxi -y" | zenity --progress --title="Installing inxi" --text="please wait" --pulsate --auto-close if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error --title="Error" --text="inxi could not be installed." exit fi else exit fifidisk_df=(FALSE "Fs disk space info" "df -Th | grep /dev/sd" "View filesystem disk space usage")FDISK=(FALSE "List Partition Tables" "sudo fdisk -l" "List out the partition information (password required)")BLOCKDEV=(FALSE "Display Block Devices" "lsblk" "List out information of all block devices")PARTED=(FALSE "List Partition Layout" "sudo parted -l" "List partition layout on all block devices")lspci_info=(FALSE "PCI info" "lspci -vnn" "View PCI devices info")lspci_graph=(FALSE "Graphics" "lspci -vnn | grep VGA -A 12" "View graphics devices info")lsusb_info=(FALSE "USB info" "lsusb" "View usb devices info")CPU=(FALSE "32/64 bit CPU" "egrep -c ' lm ' /proc/cpuinfo" "Find out is this 32 or 64 bit CPU")CPUZ=(FALSE "Processor info" "lscpu" "Display detailed info on CPU")OS=(FALSE "32/64 bit OS" "uname -a" "Find out is this 32 or 64 bit OS")inxi_full=(FALSE "Full info" "inxi -Fxz" "View system info")inxi_df=(FALSE "Partition info" "inxi -plu" "View partition info")REPOS=(FALSE "View Repositories" "inxi -r" "View repositories on this sistem")GRAPHICS=(FALSE "View Graphics" "inxi -Gxx" "View graphics on this sistem")AUDIO=(FALSE "View Audio" "inxi -A" "View audio on this sistem")NETWORK=(FALSE "View Network" "inxi -nz" "View network on this sistem")NETWORKC=(FALSE "Network Configuration" "ifconfig -a" "View network configuration on this sistem")OPENGL=(FALSE "View OpenGL configuration" "glxinfo | grep OpenGL" "View OpenGL configuration on this sistem")LSB=(FALSE "View lsb release" "lsb_release -dic" "View lsb release info")ic="/usr/share/icons/zenity-llcc.png"selection=$(zenity --window-icon="$ic" --list --checklist --width=900 --height=700 --column="Select" --column="Name" --column="Command" \--column="Description" --text="Select the info tool you wish to use, then click the Display button.\nYou can select multiple tools." --title="Info" --ok-label="Display" --cancel-label="Quit" --separator="\n" \"${disk_df[@]}" \"${FDISK[@]}" \"${BLOCKDEV[@]}" \"${PARTED[@]}" \"${lspci_info[@]}" \"${lspci_graph[@]}" \"${lsusb_info[@]}" \"${CPU[@]}" \"${CPUZ[@]}" \"${OS[@]}" \"${inxi_full[@]}" \"${inxi_df[@]}" \"${REPOS[@]}" \"${GRAPHICS[@]}" \"${AUDIO[@]}" \"${NETWORK[@]}" \"${NETWORKC[@]}" \"${OPENGL[@]}" \"${LSB[@]}" )# If Quit is clicked then exitif [ "${PIPESTATUS[0]}" -ne "0" ]; thenexit 0fi# check if anything is selectedecho $selection | grep '[a-zA-Z0-9]'if [ "${PIPESTATUS[1]}" -ne "0" ]; thenzenity --info --title='Info' --text='Nothing was selected.'exit 0fiecho $selection | grep "^Fs disk space info" > /dev/nullif [ $? = 0 ];then SOME_TEXT="df - View file system disk space usage\nYou can select the mount to open in the file manager" SOME_TITLE="df" df -h -T| tail -n+2 | while read fs type size used rest target; do if [[ $rest ]] ; then echo "$fs" "$type" "$size"B "$used"B "$rest"B "${target[@]}" | grep /dev/sd | # remove "grep /dev/sd |" to show all awk '{print $1,"\n",$2,"\n",$3,"\n",$4,"\n",$5,"\n",$6}BEGIN{ s = 7; e = 35; }{for (i=s; i<=e; i++) printf("%s%s", $(i), i<e ? OFS : "\n"); }' #Workaround for disk labels that contain whitespaces(number of characters that can be divided by whitespace =e-s) fi done | sed -e 's/[ \t]*$//' $1|zenity --list --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Device" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="7"| cut -d '|' -f2| tee /tmp/tempdf #With radiolist is also an option #done | sed -e 's/[ \t]*$//' $1| sed 's!^/dev/sd*!FALSE\n/dev/sd!g' | zenity --list --radiolist --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Select" --column="FS" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="8"| cut -d '|' -f2| tee /tmp/tempdf if [ -z "$(cat /tmp/tempdf)" ]; then rm -f /tmp/tempdf exit 0 fi xdg-open "$(cat /tmp/tempdf)" rm -f /tmp/tempdffiecho $selection | grep "^List Partition Tables$" > /dev/nullif [ $? = 0 ];then gksudo --message 'To run this tool your password is required. Enter your password, or press Cancel.' 'sudo fdisk -l' |tee /tmp/fdiskinfo| zenity --title="Partition Tables (sudo fdisk -l)" --text-info --width=800 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/fdiskinfo.txt) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Partition_Tables.txt" --title="Save List of the Partition Tables")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/fdiskinfofiecho $selection | grep "Display Block Devices" > /dev/nullif [ $? = 0 ];then lsblk |tee /tmp/lsblkinfo | zenity --title="Block Devices (lsblk)" --text-info --width=800 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/lsblkinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Block_Devices.txt" --title="Save Block Devices info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/lsblkinfofiecho $selection | grep "^List Partition Layout$" > /dev/nullif [ $? = 0 ];then gksudo --message 'To run this tool your password is required. Enter your password, or press Cancel.' 'sudo parted -l'|tee /tmp/partedinfo | zenity --title="Partition Layout (sudo parted -l)" --text-info --width=800 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/partedinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Partition_layout.txt" --title="Save Partition Layout info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/partedinfofiecho $selection | grep "^PCI info$" > /dev/nullif [ $? = 0 ];then lspci -vnn | tee /tmp/lspciinfo | zenity --title="PCI info (lspci -vnn)" --text-info --width=800 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/lspciinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="PCI_Devices.txt" --title="Save PCI Devices info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/lspciinfofiecho $selection | grep "^Graphics$" > /dev/nullif [ $? = 0 ];then lspci -vnn | grep VGA -A 12 | tee /tmp/lspcigraph| zenity --title="Graphics (lspci -vnn | grep VGA -A 12)" --text-info --width=800 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[3]}" -ne "1" ]; then zNewData=$(cat /tmp/lspcigraph) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Graphics_info.txt" --title="Save Graphics info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/lspcigraphfiecho $selection | grep "USB info" > /dev/nullif [ $? = 0 ];then lsusb | tee /tmp/lsusbinfo | zenity --title="USB info (lsusb)" --text-info --width=800 --height=400 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/lsusbinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="USB_info.txt" --title="Save USB info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/lsusbinfofiecho $selection | grep "32/64 bit CPU" > /dev/nullif [ $? = 0 ];then if [ "$(egrep -c ' lm ' /proc/cpuinfo)" -lt "1" ]; then bus_zen="32" else bus_zen="64" fi zenity --title="32/64 bit CPU" --info --text="This is $bus_zen bit CPU"fiecho $selection | grep "Processor info" > /dev/nullif [ $? = 0 ];then lscpu | tee /tmp/processorinfo | zenity --title="Processor info (lscpu)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/processorinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="CPU_info.txt" --title="Save Processor info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/processorinfofiecho $selection | grep "32/64 bit OS" > /dev/nullif [ $? = 0 ];then if [ "$(uname -a | egrep -c 'i386|i486|i586|i686')" -eq "1" ]; then os_zen="32" else os_zen="64" fi zenity --title="32/64 bit OS" --info --text="This is $os_zen bit OS"fiecho $selection | grep "Full info" > /dev/nullif [ $? = 0 ];then inxi -Fxz -c 0 | tee /tmp/inxifull | zenity --title="Full info (inxi -Fxz)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/inxifull) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Full_info.txt" --title="Save Full Computer info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/inxifullfiecho $selection | grep "Partition info" > /dev/nullif [ $? = 0 ];then inxi -plu -c 0 | tee /tmp/partitionsinfo| zenity --title="Partition info (inxi -plu)" --text-info --width=650 --height=400 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/partitionsinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Partition_info.txt" --title="Save Partition info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/partitionsinfofiecho $selection | grep "View Repositories" > /dev/nullif [ $? = 0 ];then inxi -r -c 0 | tee /tmp/repositorieslist | zenity --title="Repositories (inxi -r)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/repositorieslist) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Repositories.txt" --title="Save List Of The Repositories")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/repositorieslistfiecho $selection | grep "View Graphics" > /dev/nullif [ $? = 0 ];then inxi -Gxx -c 0 | tee /tmp/graphicsinfo | zenity --title="Graphics info (inxi -Gxx)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/graphicsinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Graphics_inxi.txt" --title="Save Graphic information (inxi)")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/graphicsinfofiecho $selection | grep "View Audio" > /dev/nullif [ $? = 0 ];then inxi -A -c 0 | tee /tmp/audioinfo | zenity --title="Audio info (inxi -A)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/audioinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Audio_info.txt" --title="Save Audio information (inxi)")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/audioinfofiecho $selection | grep "^View Network$" > /dev/nullif [ $? = 0 ];then inxi -nz -c 0 | tee /tmp/networkinfo | zenity --title="Network info (inxi -nz)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/networkinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Network_inxi.txt" --title="Save Network information (inxi)")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/networkinfofiecho $selection | grep "Network Configuration$" > /dev/nullif [ $? = 0 ];then ifconfig -a | tee /tmp/networkconfinfo | zenity --title="Network info (ifconfig -a)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/networkconfinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Network_conf.txt" --title="Save Network Configuration Info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/networkconfinfofiecho $selection | grep "View OpenGL configuration" > /dev/nullif [ $? = 0 ];then glxinfo | grep OpenGL | tee /tmp/openglinfo | zenity --title="View OpenGL configuration (glxinfo | grep OpenGL)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[3]}" -ne "1" ]; then zNewData=$(cat /tmp/openglinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="OpenGL_info.txt" --title="Save OpenGL Info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/openglinfofiecho $selection | grep "View lsb release" > /dev/nullif [ $? = 0 ];then lsb_release -dic| tee /tmp/lsbinfo | zenity --title="View lsb release (lsb_release -dic)" --text-info --width=850 --height=600 --ok-label="Save" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then zNewData=$(cat /tmp/lsbinfo) zSavePath=$(echo -n "$(zenity --file-selection --save --confirm-overwrite --filename="Network_conf.txt" --title="Save ls_ release Info")") echo -n "$zNewData" > "$zSavePath" fi rm /tmp/lsbinfofi
#! /bin/bash#--------------------------------------------------------------------------------------------------------# Info tool by Misko_2083 Update Sysdrum#--------------------------------------------------------------------------------------------------------#inxi installed?if [ -z "$(which inxi)" ]; then if zenity --title="Question" --question text="Inxi is not installed, do you want to install it?\nIf you choose No program will exit." then gksudo "sudo apt-get install inxi -y" | zenity --progress --title="Installing inxi" --text="please wait" --pulsate --auto-close if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error --title="Error" --text="inxi could not be installed." exit fi else exit fifi#mousepad installed?if [ $(dpkg-query -W -f='${Status}' mousepad 2>/dev/null | grep -c "ok installed") -eq 0 ];then if zenity --title="Question" --question text="Mousepad is not installed, do you want to install it?\nIf you choose No program will exit." then gksudo "sudo apt-get install mousepad -y" | zenity --progress --title="Installing Mousepad" --text="please wait" --pulsate --auto-close if [ "${PIPESTATUS[0]}" -ne "0" ]; then zenity --error --title="Error" --text="Mousepad could not be installed." exit fi else exit fifidisk_df=(FALSE "Fs disk space info" "df -Th | grep /dev/sd" "View filesystem disk space usage")FDISK=(FALSE "List Partitions" "sudo fdisk -l" "List out the partition information (password required)")BLOCKDEV=(FALSE "Display Block Devices" "lsblk" "List out information all block devices")lspci_info=(FALSE "PCI info" "lspci -vnn" "View PCI devices info")lspci_graph=(FALSE "Graphics" "lspci -vnn | grep VGA -A 12" "View graphics devices info")lsusb_info=(FALSE "USB info" "lsusb" "View usb devices info")CPU=(FALSE "32/64 bit CPU" " " "Find out is this 32 or 64 bit CPU")CPUZ=(FALSE "Processor info" "lscpu" "Display detailed info on CPU")OS=(FALSE "32/64 bit OS" "uname -a" "Find out is this 32 or 64 bit OS")inxi_full=(FALSE "Full info" "inxi -Fxz" "View system info")inxi_df=(FALSE "Partition info" "inxi -plu" "View partition info")REPOS=(FALSE "View Repositories" "inxi -r" "View repositories on this sistem")GRAPHICS=(FALSE "View Graphics" "inxi -Gxx" "View graphics on this sistem")AUDIO=(FALSE "View Audio" "inxi -A" "View audio on this sistem")NETWORK=(FALSE "View Network" "inxi -nz" "View network on this sistem")NETWORKC=(FALSE "Network Configuration" "ifconfig -a" "View network configuration on this sistem")OPENGL=(FALSE "View OpenGL configuration" "glxinfo | grep OpenGL" "View OpenGL configuration on this sistem")LSB=(FALSE "View lsb release" "lsb_release -dic" "View lsb release info")ic="/usr/share/icons/zenity-llcc.png"selection=$(zenity --window-icon="$ic" --list --radiolist --width=900 --height=700 --column="Select" --column="Name" --column="Command" \--column="Description" --text="Select the info tool you wish to use, then click the Display button." --title="Info" --ok-label="Display" --cancel-label="Quit" --separator="\n" \"${disk_df[@]}" \"${FDISK[@]}" \"${BLOCKDEV[@]}" \"${lspci_info[@]}" \"${lspci_graph[@]}" \"${lsusb_info[@]}" \"${CPU[@]}" \"${CPUZ[@]}" \"${OS[@]}" \"${inxi_full[@]}" \"${inxi_df[@]}" \"${REPOS[@]}" \"${GRAPHICS[@]}" \"${AUDIO[@]}" \"${NETWORK[@]}" \"${NETWORKC[@]}" \"${OPENGL[@]}" \"${LSB[@]}" )# If Quit is clicked then exitif [ "${PIPESTATUS[0]}" -ne "0" ]; thenexit 0fi# check if anything is selectedecho $selection | grep '[a-zA-Z0-9]'if [ "${PIPESTATUS[1]}" -ne "0" ]; thenzenity --info --title='Info' --text='Nothing was selected.'exit 0fiecho $selection | grep "^Fs disk space info" > /dev/nullif [ $? = 0 ];then SOME_TEXT="df - View file system disk space usage\nYou can select the mount to open in the file manager" SOME_TITLE="df" df -h -T| tail -n+2 | while read fs type size used rest target; do if [[ $rest ]] ; then echo "$fs" "$type" "$size"B "$used"B "$rest"B "${target[@]}" | grep /dev/sd | # remove "grep /dev/sd |" to show all awk '{print $1,"\n",$2,"\n",$3,"\n",$4,"\n",$5,"\n",$6}BEGIN{ s = 7; e = 35; }{for (i=s; i<=e; i++) printf("%s%s", $(i), i<e ? OFS : "\n"); }' #Workaround for disk labels that contain whitespaces(number of characters that can be divided by whitespace =e-s) fi done | sed -e 's/[ \t]*$//' $1|zenity --list --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Device" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="7"| cut -d '|' -f2| tee /tmp/tempdf #With radiolist is also an option #done | sed -e 's/[ \t]*$//' $1| sed 's!^/dev/sd*!FALSE\n/dev/sd!g' | zenity --list --radiolist --width=685 --height=350 --title="${SOME_TITLE}" --text="${SOME_TEXT}" --column="Select" --column="FS" --column="Type" --column="Size" --column="Used" --column="Free" --column="%Used" --column="Mount" --print-column="8"| cut -d '|' -f2| tee /tmp/tempdf if [ -z "$(cat /tmp/tempdf)" ]; then exit 0 fi xdg-open "$(cat /tmp/tempdf)" rm -f /tmp/tempdffiecho $selection | grep "List Partitions" > /dev/nullif [ $? = 0 ];then gksudo --message 'To run this tool your password is required. Enter your password, or press Cancel.' 'sudo fdisk -l' |tee /tmp/lsblkinfo.txt| zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in mousepad" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then mousepad /tmp/lsblkinfo.txt; rm /tmp/lsblkinfo.txt else exit 0 fifiecho $selection | grep "Display Block Devices" > /dev/nullif [ $? = 0 ];then lsblk | zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsblk > /tmp/lsblkinfo.txt; mousepad /tmp/lsblkinfo.txt; rm /tmp/lsblkinfo.txt else exit 0 fifiecho $selection | grep "PCI info" > /dev/nullif [ $? = 0 ];then lspci -vnn | zenity --title="PCI info" --text-info --width=800 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lspci -nn > /tmp/lspciinfo.txt; mousepad /tmp/lspciinfo.txt; rm /tmp/lspciinfo.txt else exit 0 fifiecho $selection | grep "^Graphics$" > /dev/nullif [ $? = 0 ];then lspci -vnn | grep VGA -A 12 | zenity --title="Graphics" --text-info --width=800 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then lspci -vnn | grep VGA -A 12 > /tmp/lspcigraph.txt; mousepad /tmp/lspcigraph.txt; rm /tmp/lspcigraph.txt else exit 0 fifiecho $selection | grep "USB info" > /dev/nullif [ $? = 0 ];then lsusb | zenity --title="USB info" --text-info --width=800 --height=400 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsusb > /tmp/lsusbinfo.txt; mousepad /tmp/lsusbinfo.txt; rm /tmp/lsusbinfo.txt else exit 0 fifiecho $selection | grep "32/64 bit CPU" > /dev/nullif [ $? = 0 ];then if [ "$(egrep -c ' lm ' /proc/cpuinfo)" -lt "1" ]; then bus_zen="32" else bus_zen="64" fi zenity --title="32/64 bit CPU" --info --text="This is $bus_zen bit CPU"fiecho $selection | grep "Processor info" > /dev/nullif [ $? = 0 ];then lscpu | zenity --title="Processor info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lscpu > /tmp/processorinfo.txt; mousepad /tmp//tmp/processorinfo.txt; rm /tmp/processorinfo.txt else exit 0 fifiecho $selection | grep "32/64 bit OS" > /dev/nullif [ $? = 0 ];then if [ "$(uname -a | egrep -c 'i386|i486|i586|i686')" -eq "1" ]; then os_zen="32" else os_zen="64" fi zenity --title="32/64 bit OS" --info --text="This is $os_zen bit OS"fiecho $selection | grep "Full info" > /dev/nullif [ $? = 0 ];then inxi -Fxz -c 0 | zenity --title="Full info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -Fxz -c 0 > /tmp/inxifull.txt; mousepad /tmp/inxifull.txt; rm /tmp/inxifull.txt else exit 0 fifiecho $selection | grep "Partition info" > /dev/nullif [ $? = 0 ];then inxi -plu -c 0 | zenity --title="Partition info" --text-info --width=650 --height=400 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -plu -c 0 > /tmp/partitionsinfo.txt; mousepad /tmp/partitionsinfo.txt; rm /tmp/partitionsinfo.txt else exit 0 fifiecho $selection | grep "View Repositories" > /dev/nullif [ $? = 0 ];then inxi -r -c 0| zenity --title="Repositories" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -r -c 0 > /tmp/repositorieslist.txt; mousepad /tmp/repositorieslist.txt; rm /tmp/repositorieslist.txt else exit 0 fi fiecho $selection | grep "View Graphics" > /dev/nullif [ $? = 0 ];then inxi -Gxx -c 0| zenity --title="Graphics info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -Gxx -c 0 > /tmp/graphicsinfo.txt; mousepad /tmp/graphicsinfo.txt; rm /tmp/graphicsinfo.txt else exit 0 fifiecho $selection | grep "View Audio" > /dev/nullif [ $? = 0 ];then inxi -A -c 0| zenity --title="Audio info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -A -c 0 > /tmp/audioinfo.txt; mousepad /tmp/audioinfo.txt; rm /tmp/audioinfo.txt else exit 0 fifiecho $selection | grep "^View Network$" > /dev/nullif [ $? = 0 ];then inxi -nz -c 0 | zenity --title="Network info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then inxi -nz -c 0 > /tmp/networkinfo.txt; mousepad /tmp/networkinfo.txt; rm /tmp/networkinfo.txt else exit 0 fifiecho $selection | grep "Network Configuration" > /dev/nullif [ $? = 0 ];then ifconfig -a | zenity --title="Network info" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then ifconfig -a > /tmp/networkconfinfo.txt; mousepad /tmp/networkconfinfo.txt; rm /tmp/networkconfinfo.txt else exit 0 fifiecho $selection | grep "View OpenGL configuration" > /dev/nullif [ $? = 0 ];then glxinfo | grep OpenGL| zenity --title="View OpenGL configuration" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[2]}" -ne "1" ]; then glxinfo | grep OpenGL > /tmp/openglinfo.txt; mousepad /tmp/openglinfo.txt; rm /tmp/openglinfo.txt else exit 0 fifiecho $selection | grep "View lsb release" > /dev/nullif [ $? = 0 ];then lsb_release -dic| zenity --title="lsb_release" --text-info --width=850 --height=600 --ok-label="Open in Mousepad" --cancel-label="Close" if [ "${PIPESTATUS[1]}" -ne "1" ]; then lsb_release -dic > /tmp/lsbinfo.txt; mousepad /tmp/lsbinfo.txt; rm /tmp/lsbinfo.txt else exit 0 fifi
Just do like I did in the 2nd post and then left click it.
Personally, there is no need to "reinvent the wheel".
The rest of the buttons worked OK as far as the test went. For full readout. I likeCode: [Select]inxi -zv7instead of Code: [Select]inxi -Fxz
inxi -zv7
inxi -Fxz
Nice script...works great...nice output and quick...Thanks
Personally, there is no need to "reinvent the wheel". I just add a few codes and be done with it. See
Thank you Rok, The second button was using wrong text file. That could be it. Try sudo fdisk -lhere is the new script
harry@biker1:~$ sudo fdisk -l[sudo] password for harry: WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.Disk /dev/sda: 121.3 GB, 121332826112 bytes255 heads, 63 sectors/track, 14751 cylinders, total 236978176 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000 Device Boot Start End Blocks Id System/dev/sda1 1 236978175 118489087+ ee GPTharry@biker1:~$ sudo parted -lModel: ATA APPLE SSD SM128 (scsi)Disk /dev/sda: 121GBSector size (logical/physical): 512B/512BPartition Table: gptNumber Start End Size File system Name Flags 1 1049kB 9438MB 9437MB ext4 2 9438MB 121GB 112GB ext3