From 1d94c514925921bec8d57187f6d0ad8b7b3137b3 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:30:09 +0200 Subject: [PATCH 01/12] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 67c5069..fe7a6e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ #make Programing language bar show only shell (without it shows ~70% HTML because of the 'ascii-art.html' file +* linguist-vendored *.sh linguist-vendored=false From ece5886b2290e6c41862c2f329dae43a505f50b9 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:32:18 +0200 Subject: [PATCH 02/12] Add files via upload --- sys-info.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sys-info.sh diff --git a/sys-info.sh b/sys-info.sh new file mode 100644 index 0000000..5586763 --- /dev/null +++ b/sys-info.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#variables +DE="`env | grep DESKTOP_SESSION`" +USER="`env | grep USER`" +KERNEL="`uname -rm`" + +#display everything +echo "username: $USER" +if [[ $DE == *"xfce"* ]]; then + echo "Desktop Environment is: XFCE" +elif [[ $DE == *"lxde"* ]]; then + echo "Desktop Environment is: LXDE" +elif [[ $DE == *"gnome"* ]]; then + echo "Desktop Environment is: GNOME" +else + echo "Cant detect Desktop Environment!" +fi +echo "kernel: $KERNEL" From b8fa632d155f4e9f7921ac9ecd9707f48bc3cfc6 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:34:33 +0200 Subject: [PATCH 03/12] Update main.sh --- main.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index d18ae5e..b7b499d 100755 --- a/main.sh +++ b/main.sh @@ -97,6 +97,7 @@ update="$DIRECTORY/update.sh" passwd="$DIRECTORY/passwd.sh" apps="$APPS/appinstaller.sh" #apps variable used for my testing. systools="$DIRECTORY/systools.sh" +sysinfo="$DIRECTORY/sys-info.sh" other="$DIRECTORY/other.sh" exit="exit 1" @@ -118,8 +119,9 @@ OPTIONS=(1 "Update OS" 2 "Change password" 3 "Application installer" 4 "System tools" - 5 "Other" - 6 "exit Pi-Assistant") + 5 "System Information" + 6 "Other" + 7 "exit Pi-Assistant") CHOICE=$(dialog --clear \ --backtitle "$BACKTITLE $COMMIT $SPACER" \ @@ -144,9 +146,13 @@ case $CHOICE in $systools; $main ;; 5) + $sysinfo; $main + ;; + + 6) $other; $main>/dev/null ;; - 6) $exit + 7) $exit ;; esac From fe14b6e0b0405e64572e920e889312989ced4e14 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:35:32 +0200 Subject: [PATCH 04/12] Update install.sh --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 087ae0b..4011f65 100644 --- a/install.sh +++ b/install.sh @@ -94,6 +94,7 @@ sudo chmod +x install.sh sudo chmod +x update.sh sudo chmod +x updater.sh sudo chmod +x uninstall.sh +sudo chmod +x sys-info.sh sudo chmod +x apps/appinstaller.sh sudo chmod +x apps/gparted.sh sudo chmod +x apps/chromium.sh From 86f45dc90974ca868e5bf065ea210d6ca98dbf3a Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:36:19 +0200 Subject: [PATCH 05/12] Update main.sh --- main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.sh b/main.sh index b7b499d..6d45941 100755 --- a/main.sh +++ b/main.sh @@ -106,7 +106,7 @@ cd $DIRECTORY #dialog variables HEIGHT=15 WIDTH=40 -CHOICE_HEIGHT=6 +CHOICE_HEIGHT=7 BACKTITLE="Pi-Assistant $APPVER," COMMIT="`git log -1 | grep commit* | cut -c1-14`::::::Itai Nelken::::::" #CPU="CPU `lscpu | grep "Model name*"`" From 22314d180723aff3b9b8f2b43069835727792970 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:38:31 +0200 Subject: [PATCH 06/12] Update updater.sh --- updater.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/updater.sh b/updater.sh index 8f06e73..9ba4d34 100644 --- a/updater.sh +++ b/updater.sh @@ -63,6 +63,7 @@ sudo chmod +x install.sh sudo chmod +x update.sh sudo chmod +x updater.sh sudo chmod +x uninstall.sh +sudo chmod +x sys-info.sh sudo chmod +x apps/appinstaller.sh sudo chmod +x apps/gparted.sh sudo chmod +x apps/chromium.sh @@ -78,4 +79,4 @@ sudo chmod +x apps/flatpak.sh sudo chmod +x apps/etcher.sh sudo chmod +x apps/zoom.sh sudo chmod +x apps/box86.sh -#echo "$(tput setaf 3)finished...$(tput sgr 0)" \ No newline at end of file +#echo "$(tput setaf 3)finished...$(tput sgr 0)" From 0d4e3abafb47877d67bf9af157cf8cfe45d186e1 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:41:31 +0200 Subject: [PATCH 07/12] Update sys-info.sh --- sys-info.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys-info.sh b/sys-info.sh index 5586763..0c8548d 100644 --- a/sys-info.sh +++ b/sys-info.sh @@ -17,3 +17,5 @@ else echo "Cant detect Desktop Environment!" fi echo "kernel: $KERNEL" + +read -n 1 -s -r -p "Press any key to exit" From 52925363ec0ba2f062c1809a4182a3c44d1fe33d Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Mon, 18 Jan 2021 23:47:43 +0200 Subject: [PATCH 08/12] Update sys-info.sh --- sys-info.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys-info.sh b/sys-info.sh index 0c8548d..c9a2d88 100644 --- a/sys-info.sh +++ b/sys-info.sh @@ -6,7 +6,7 @@ USER="`env | grep USER`" KERNEL="`uname -rm`" #display everything -echo "username: $USER" +echo "${USER:5}" if [[ $DE == *"xfce"* ]]; then echo "Desktop Environment is: XFCE" elif [[ $DE == *"lxde"* ]]; then @@ -18,4 +18,4 @@ else fi echo "kernel: $KERNEL" -read -n 1 -s -r -p "Press any key to exit" +read -n 1 -s -r -p "Press any key to go back to main menu" From 096c4ab3a885d6695281213ce28e13fe20fc4a56 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Tue, 19 Jan 2021 00:51:23 +0200 Subject: [PATCH 09/12] Update sys-info.sh --- sys-info.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/sys-info.sh b/sys-info.sh index c9a2d88..d3b4dc4 100644 --- a/sys-info.sh +++ b/sys-info.sh @@ -1,12 +1,70 @@ -#!/bin/bash +##!/bin/bash #variables DE="`env | grep DESKTOP_SESSION`" USER="`env | grep USER`" -KERNEL="`uname -rm`" +KERNEL="`uname -r`" +KARCH="`uname -m`" +NETNAME="`uname -n`" +KRELEASE="`uname -v`" +CPU="`lscpu | grep "Model name:"`" +MEM="`echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 * 1024)))`" +MODEL="`cat /proc/cpuinfo | grep Model`" +CSPEED="`lscpu | grep "CPU max" | cut -c22-25`" -#display everything -echo "${USER:5}" +#determine if host system is 64 bit arm64 or 32 bit armhf +if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then + OSARCH=64 +elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then + OSARCH=32 +else + OSARCH=e +fi + + +### DISPLAY EVERYTHING ### + +printf "$(tput bold)\\e[3;4;37mBasic information:\\n\\e[0m$(tput sgr 0)" + +#display username +echo "username is: ${USER:5}" +#display model name +echo "Device model name is: ${MODEL:9}" +#display network name +echo "device network name is: $NETNAME" + + +echo -e " " + +printf "$(tput bold)\\e[3;4;37mSystem architectures:\\n\\e[0m$(tput sgr 0)" +#display OS arch +if [[ "$OSARCH" == 32 ]]; then + echo "OS architecture is: 32bit ARM" +elif [[ "$OSARCH" == 64 ]]; then + echo "OS architecture is: 64bit ARM" +elif [[ "$OSARCH" == e ]]; then + echo "can't detect OS architecture, something is very very wrong!" +fi +#display kernel arch +echo "kernel architecture is: $KARCH" + +echo -e " " + +printf "$(tput bold)\\e[3;4;37mHardware information:\\n\\e[0m$(tput sgr 0)" +#display CPU name and speed +echo "Processor (CPU) model name is: ${CPU:21}" +echo "Processor clock speed is: $CSPEED mhz" +#display memory +echo "memory (RAM) size is $MEM mb" + +echo " " + +printf "$(tput bold)\\e[3;4;37mSoftware information:\\n\\e[0m$(tput sgr 0)" +printf "\\e[3;4;37mKernel:\\n\\e[0m" +#display kernel +echo "kernel: $KERNEL, release: $KRELEASE" +echo " " +#display DE if [[ $DE == *"xfce"* ]]; then echo "Desktop Environment is: XFCE" elif [[ $DE == *"lxde"* ]]; then @@ -14,8 +72,11 @@ elif [[ $DE == *"lxde"* ]]; then elif [[ $DE == *"gnome"* ]]; then echo "Desktop Environment is: GNOME" else - echo "Cant detect Desktop Environment!" + echo "Unknown Desktop Environment!" fi -echo "kernel: $KERNEL" -read -n 1 -s -r -p "Press any key to go back to main menu" +echo -e "----------------------------" + +#display "press any key to exit" +read -n 1 -s -r -p "Press any key to exit" +echo -e "\n" From 22a4cf6ee85ae4cd5ed19fe016cfb7632450d9ae Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Tue, 19 Jan 2021 00:52:03 +0200 Subject: [PATCH 10/12] Update other.sh --- other.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other.sh b/other.sh index 2323519..350a0cd 100644 --- a/other.sh +++ b/other.sh @@ -10,7 +10,7 @@ APPS="$HOME/Pi-Assistant/apps" echo "this script will help you update or uninstall Pi-Assistant." -PS3='Please enter the number above for operation you would like to perform (1 - 5): ' +PS3='Please enter the number above for operation you would like to perform (1 - 3): ' options=("update Pi-Assistant" "uninstall Pi-Assistant" "back to main menu") select opt in "${options[@]}" do From 0c0ebab935f46760928943c0da5577233518dfc6 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Tue, 19 Jan 2021 00:53:27 +0200 Subject: [PATCH 11/12] Update sys-info.sh --- sys-info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-info.sh b/sys-info.sh index d3b4dc4..5f27bb5 100644 --- a/sys-info.sh +++ b/sys-info.sh @@ -78,5 +78,5 @@ fi echo -e "----------------------------" #display "press any key to exit" -read -n 1 -s -r -p "Press any key to exit" +read -n 1 -s -r -p "Press any key to go back to main menu" echo -e "\n" From 33b69680c8b89f7dfb7150df3b167490212a6ba2 Mon Sep 17 00:00:00 2001 From: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> Date: Tue, 19 Jan 2021 00:55:27 +0200 Subject: [PATCH 12/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 927f38e..71c795b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # logo Pi-Assistant -Pi-Assistant is a simple terminal app made for the Raspberry Pi that makes updating the system, installing apps and more, easier and faster, especially if you are new to the Linux command line or you forget the commands. +PPi-Assistant is a simple terminal app made for the Raspberry Pi that makes updating the system, installing apps, viewing system information, and more easier and faster, especially if you are new to the Linux command line or you forget the commands. ## links