Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'main' of https://github.com/Itai-Nelken/Pi-Assistant in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
Itai-Nelken committed Jan 18, 2021
2 parents dc3bc26 + 33b6968 commit 8cf5098
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <img src="/icons/pi-assistant-logopng.png" alt="logo" width="60"/> 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

Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -105,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*"`"
Expand All @@ -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" \
Expand All @@ -144,9 +146,13 @@ case $CHOICE in
$systools; $main
;;
5)
$sysinfo; $main
;;

6)
$other; $main>/dev/null
;;

6) $exit
7) $exit
;;
esac
2 changes: 1 addition & 1 deletion other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
82 changes: 82 additions & 0 deletions sys-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
##!/bin/bash

#variables
DE="`env | grep DESKTOP_SESSION`"
USER="`env | grep USER`"
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`"

#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
echo "Desktop Environment is: LXDE"
elif [[ $DE == *"gnome"* ]]; then
echo "Desktop Environment is: GNOME"
else
echo "Unknown Desktop Environment!"
fi

echo -e "----------------------------"

#display "press any key to exit"
read -n 1 -s -r -p "Press any key to go back to main menu"
echo -e "\n"
3 changes: 2 additions & 1 deletion updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
#echo "$(tput setaf 3)finished...$(tput sgr 0)"

0 comments on commit 8cf5098

Please sign in to comment.