├── .gitattributes
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── SCREENSHOTS.md
├── apps
├── appinstaller.sh
├── audacity.sh
├── blender.sh
├── box86.sh
├── chromium.sh
├── credits
├── etcher.sh
├── firefox.sh
├── flatpak.sh
├── flowblade.sh
├── gparted.sh
├── gsysmon.sh
├── inkscape.sh
├── kdenlive.sh
├── snap.sh
├── ssr.sh
└── zoom.sh
├── icons
├── 128x128
│ ├── logo-64 12.15.10 PM.png
│ ├── rpi-64 12.15.10 PM.png
│ └── zoom-64 12.15.10 PM.png
├── 24x24
│ └── logo-24.png
├── 64x64
│ ├── logo-64.png
│ ├── rpi-64.png
│ └── zoom-64.png
├── ascii-art.html
├── old
│ └── system-tools.png
├── pi-assistant-logopng.png
├── raspi-logo.png
├── svg
│ └── pi-assistant-logo.svg
└── zoom-icon.png
├── install.sh
├── main.sh
├── other.sh
├── passwd.sh
├── resources.md
├── screenshots
├── pi-assistant.gif
├── pi-assistant.png
├── pi-assistant2.png
├── piassist-appmenu-1.3.0.png
├── piassist-appmenu.png
├── piassist-demo-edited.mov
├── piassist-demo.gif
├── piassist-demo.mp4
├── piassist-main-menu-1.3.0.png
├── piassist-mainmenu.png
├── piassist-sys-info-1.3.0.png
├── piassist-sys-info.png
├── system-tools-1.png
├── system-tools-1a.png
├── system-tools-1b.png
├── system-tools-1c.png
├── system-tools-2.png
├── system-tools-2a.png
└── updater.png
├── sys-info.sh
├── systools.sh
├── templates
├── category-template.sh
├── dialog-template.sh
├── yad-test-2.sh
└── yad-test.sh
├── test.txt
├── uninstall.sh
├── update.sh
└── updater.sh
/.gitattributes:
--------------------------------------------------------------------------------
1 | #make Programing language bar show only shell (without it shows ~70% HTML because of the 'ascii-art.html' file
2 | * linguist-vendored
3 | *.sh linguist-vendored=false
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #useless MacOS file
2 | .DS_Store
3 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Pi-Assistants Changelog.
2 | **here all major Pi-Assistant events will be recorded, I highly recommend to read this changelog.**
3 |
4 | ### (DD/MM/YY)
5 | * **20/10/2020** - shortened time about and credits are shown by 1 second, improvements to installation scripts, install script now creates menu shortcut
6 | * **20/10/2020** - BIG UPDATE: v1.1: added more apps, changed autoremove with apt tools (containing autoremove and autoclean), when commands finish running the script returns to the main menu and more
7 | * **21/10/2020** - added updater script that runs on startup (disabled because it doesn't work) , version 1.1.1 released, added uninstall script, now you can update manually from system-tools. fixed countless bugs.
8 | * **26/10/2020** - fixed updater (might not work), bug fixes and improvements.
9 | * **1/11/2020** - renamed system-tools to Pi-Assistant, more bug fixes.
10 | * **13/11/2020** - UPDATE: v1.1.2: fixed bug where the change-password.sh script wasn't executable, more bug fixes, added more apps
11 | * **13/11/2020** - UPDATE: v1.1.3: add Balena Etcher app
12 | * **14/11/2020** - rename 'apt-tools' to 'system-tools', add 'clear swap' option to 'system-tools'
13 | * **15/11/2020** - UPDATE: v1.1.4: added Zoom with box86
14 | * **16/11/2020** - added box86 app, fixed bug with install2.sh
15 | * **25/11/2020** - UPDATE: v1.1.5: bug fixes, updated box86 installer.
16 | * **9/1/2021** - started working on v1.2 - adding a dialog gui. ~~check out [the branch](https://github.com/Itai-Nelken/Pi-Assistant/tree/dialog-gui-testing) if you want to test it.~~ edit: the branch is nonexistent, I merged it.
17 | * **10/1/2021** - GIANT UPDATE: finished rewriting everything for the 2nd time (:tired_face:) then figured out how to merge a conflicting branch (gave up so I downloaded the test branch and deleted it along with everything in the main branch, then I uploaded all the scripts again). at least now everything should work!
18 | added flags to piassist (and main.sh), run `piassist --help` to see all of them.
19 | * **19/1/2021** - UPDATE: v1.2 final, added system info script, fixed a few bugs, fixed updater at last!
20 | * **23/1/2021** - UPDATE: v1.2.1 - fixed `--no-internet` and `--no-update` flags don't work when launching using `piassist`, made startup time after option completes way shorter using the `--no-internet flag` (that make Pi-Assistant not check for internet and updates, so makes startup time way faster).
21 | * **5/2/2021** - found out why the updater refreshed the menu and desktop shortcuts even when no updates are available, pushed the fix to the beta branch.
Updated etcher install script to always download and install latest release and made it use a better system architecture detection. fixed a few typos in different files.
getting ready to merge the beta branch and release v1.3.0!
22 | * **8/2/2021** - tons of improvements over the last few days, running flags from `piassist` redirects them to `main.sh`, added shorter versions of flags (`-v` = `--versions`).
23 | * **16/2/2021** - update: 1.3.2 - fixed a bug with the appinstaller script: when installing SimpleScreenRecorder (SSR), it looked for a script called `ssr.sh` but I accidentally named it `SSR.sh`.
update: 1.3.3 - forgot to change `SSR.sh` to `ssr.sh` in the updater script.
update: 1.3.4 - forgot to bump the version in the scripts.
24 | * **16/2/2021** - opened 'beta' branch again and added flowblade video editor to the app installer.
25 | * **17/2/2021** - added neofetch as a dependency (for system information), after installing a app, return to app installer and not the main menu, system information: detect LXDE on RPiOS correctly (on RPiOS lxde is called LXDE-pi).
merged branch 'beta' into 'main': all changes from 16 - 17/2/2021 are now available.
26 | * **22/2/2021** added a option to fix duplicates in `/etc/apt/sources.list` in system tools option.
27 | * **6/3/2021** UPDATE: v1.4.0 - fixed `systools.sh`, for some very weird version it wasn't working, probably some syntax error, all changes from 16/2 - 6/3/2021.
28 |
29 | ## [Back to Readme](https://github.com/Itai-Nelken/Pi-Assistant#-pi-assistant)
30 |
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Itai-Nelken
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #
Pi-Assistant
2 |   
3 |
4 | ## *NOTE:* Pi-Assistant isn't maintained anymore. use at your own risk!
5 |
6 | Pi-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.
7 |
8 | ## links
9 |
10 | * [My blog](https://thepisite.blogspot.com/)
11 | * [My Raspberry Pi YouTube channel](https://youtube.com/channel/UCaKFjYULBDdkfEcx6oy9Gow)
12 | * [My other YouTube channel](https://youtube.com/channel/UCM4Fo6ncNybS1xhJHnWSODg)
13 |
14 | ## Installation
15 |
16 | to install Pi-Assistant, just copy the following into terminal:
17 | ```
18 | $ wget -qO- https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/main/install.sh | bash
19 | ```
20 | ### Install beta version (not always available)
21 | 1) go to the beta branch
22 | 2) download the specific beta scripts you want
23 | 3) replace the "stable" scripts with the "beta" scripts you just downloaded
24 | **Don't update Pi-Assistant or the beta scripts will be replaced with the stable ones**
25 |
26 | ## Use Pi-Assistant
27 | ### Run Pi-Assistant
28 | To run Pi-Assistant, use the menu or Desktop shortcuts. alternatively you can type in terminal (from anywhere) `piassist`
29 | when running with `piassist` you can add flags, to see a list off all flags run `piassist --help` or see the list bellow.
30 | ### Flags
31 | `--help` - show all flags and how to use them and exit.
32 | `--no-internet` - run pi-assistant without checking for internet (use when you want to start Pi-Assistant without a internet connection).
33 | `--no-update` - don't check for updates on startup.
34 | `--version` - print version and exit.
35 | `--secret` - a secret easter egg :upside_down_face:
36 | #### Some flags have shorter versions
37 | `-h` = `--help`
38 | `-ni` = `--no-internet`
39 | `-nu` = `--no-update`
40 | `-v` = `--version`
41 |
42 | ### if you have any questions, check the [FAQ](https://github.com/Itai-Nelken/Pi-Assistant#faq) before opening a issue please.
43 |
44 | ## Updates
45 |
46 | Pi-Assistant checks for updates and if there are installs them automatically on startup.
47 | To update manually, start Pi-Assistant and go to `other>update-this-tool`
48 | if that doesn't work, or you think something is broken with the scripts, run this command:
49 | ```bash
50 | $ wget -qO- https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/main/updater.sh | bash
51 | ```
52 |
53 | ## removal
54 | Pi-Assistant v1.1.1 and later has a removal script in `other>remove` if you have an earlier version or need to manually remove, open terminal and copy:
55 | ```bash
56 | $ wget -qO- https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/main/uninstall.sh | bash
57 | ```
58 |
59 | ## Screenshots
60 | 
61 |
62 | More screenshots
63 |
64 | ### The system information option
65 | 
66 | ### Demo (the output of some of the commands is outdated)
67 | 
68 | ### How a update (on startup) looks like
69 | 
70 |
71 | ### [More screenshots page](https://github.com/Itai-Nelken/Pi-Assistant/blob/main/SCREENSHOTS.md#pi-assistant-screenshots)
72 |
73 |
74 |
75 |
76 | # [CHANGELOG](https://github.com/Itai-Nelken/Pi-Assistant/blob/main/CHANGELOG.md#pi-assistants-changelog)
77 |
78 |
79 | ## Known issues and bugs
80 | * zoom menu icon doesn't work for some reason.
81 |
82 | ## Internal stuff (commands used by the scripts)
83 | ### Updater flags (meant for the internal use of the scripts)
84 | **Usage of the updater:**
85 |
86 | `~/Pi-Assistant/updater.sh --flag` but change `--flag` with a real flag or remove it to run the default.
87 | `--no-output` - update with no extra output (for example don't print 'checking for updates'). used when Pi-Assistant is starting.
88 | `--no-ask-exit-output` - don't ask to exit and don't print any extra output (has no use as of writing).
89 | `--output-no-ask-exit` - print extra output but don't ask to exit (used when manually updating).
90 | `--all-executable` - make all scripts executable (has no use as of writing).
91 |
92 | the default is to print extra output and ask to exit.
93 | the flags that have no use are there just to have all options in case I'll need them in the future.
94 |
95 | ## To do:
96 |
97 | - [x] return to main menu instead of exiting when executed command finishes
98 | - [x] add uninstall script
99 | - [x] add updater script
100 | - [x] make updater script to run on startup (disable by using the `--no-update` flag. the `--no-internet` flag disables updates as well.)
101 | - [x] add dialog GUI
102 | - [ ] add my QEMU debs.
103 | - [ ] add box86 install script for 64bit OS's
104 | - [ ] maybe change whole gui to use YAD? or make a GUI using python? or using gtk and c?
105 | - [ ] implement app "remembering" system - in other words make Pi-Assistant remember every app it installs.
106 |
107 |
108 | ## FAQ
109 |
110 | **Q:**
111 | >How can I start Pi-Assistant without a internet connection?
112 |
113 | **A:**
114 | run Pi-Assistant from terminal with this command: `piassist --no-internet` or use the shorter version like this: `piassist -ni`.
115 |
116 | **Q:**
117 | >How can I disable update on startup?
118 |
119 | **A:**
120 | run Pi-Assistant from terminal with the `--no-update` flag like this: `piassist --no-update` or use the shorter version like this: `piassist -nu`.
121 |
122 | ## Notes
123 | system-information uses a [external service](http://ipinfo.io) for checking the public IP address. the exact link the script uses is: http://ipinfo.io/ip/.
124 |
--------------------------------------------------------------------------------
/SCREENSHOTS.md:
--------------------------------------------------------------------------------
1 | # Pi-Assistant screenshots
2 | ### The main menu
3 | 
4 | ### The app installer menu
5 | 
6 | ### Pi-Assistant demo
7 | 
8 | ### The system information option
9 | 
10 | ### How a update (on startup) looks like
11 | 
12 |
13 | # [Back to Readme](https://github.com/Itai-Nelken/Pi-Assistant#screenshots)
14 |
--------------------------------------------------------------------------------
/apps/appinstaller.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #check main.sh $APPVER for a list of everything to change
8 | APPVER="v1.4.0"
9 |
10 | #variables
11 | DIRECTORY="$HOME/Pi-Assistant"
12 | APPS="$HOME/Pi-Assistant/apps"
13 |
14 | cd $DIRECTORY
15 | #variables containing the command for each app
16 | gparted="$APPS/gparted.sh"
17 | chromium="$APPS/chromium.sh"
18 | firefox="$APPS/firefox.sh"
19 | blender="$APPS/blender.sh"
20 | audacity="$APPS/audacity.sh"
21 | snap="$APPS/snap.sh"
22 | inkscape="$APPS/inkscape.sh"
23 | ssr="$APPS/ssr.sh"
24 | kdenlive="$APPS/kdenlive.sh"
25 | gsysmon="$APPS/gsysmon.sh"
26 | flatpak="$APPS/flatpak.sh"
27 | etcher="$APPS/etcher.sh"
28 | zoom="$APPS/zoom.sh"
29 | box86="$APPS/box86.sh"
30 | flowblade="$APPS/flowblade.sh"
31 | back="$APPS/appinstaller.sh"
32 | main="sleep 0.00001"
33 |
34 |
35 | #dialog variables
36 | HEIGHT=18
37 | WIDTH=130
38 | CHOICE_HEIGHT=20
39 | BACKTITLE="Pi-Assistant $APPVER:::Itai Nelken:::"
40 | TITLE="Application Installer"
41 | MENU="Choose one of the following apps to install/uninstall:"
42 |
43 | OPTIONS=(1 "back to main menu"
44 | 2 "Gparted - Partiton editor."
45 | 3 "Chromium - The open source version of google chrome."
46 | 4 "Firefox-esr - firefox-esr web browser."
47 | 5 "Blender - free and open source 3D creation suite."
48 | 6 "audacity - free and open-source digital audio editor and recording application software."
49 | 7 "snap & snap-store - app packages Linux that are secure, cross‐platform and dependency‐free."
50 | 8 "inkscape - free and open-source vector graphics editor."
51 | 9 "SimpleScreenRecorder - Qt-based screencast software made for Linux."
52 | 10 "Kdenlive - free, open-source, and powerful video editing software"
53 | 11 "Flowblade - multitrack non-linear video editor released under GPL3 license. performs slightly better the kdenlive on a pi4"
54 | 12 "GNOME system monitor - powerful system monitor with an easy-to-use interface."
55 | 13 "flatpak - app packaging system that runs each app isolated from the rest of the system."
56 | 14 "Balena Etcher - Flash OS images to SD cards & USB drives, safely and easily. (arm versions compiled by me)"
57 | 15 "Zoom - the popular video conferencing software. Linux x86 version running with box86."
58 | 16 "box86 - Linux Userspace x86 Emulator with a twist.")
59 |
60 | CHOICE=$(dialog --clear \
61 | --backtitle "$BACKTITLE" \
62 | --title "$TITLE" \
63 | --menu "$MENU" \
64 | $HEIGHT $WIDTH $CHOICE_HEIGHT \
65 | "${OPTIONS[@]}" \
66 | 2>&1 >/dev/tty)
67 |
68 | clear
69 | case $CHOICE in
70 | 1)
71 | $main
72 | ;;
73 | 2)
74 | $gparted; $back
75 | ;;
76 | 3)
77 | $chromium; $back
78 | ;;
79 | 4)
80 | $firefox; $back
81 | ;;
82 | 5)
83 | $blender; $back
84 | ;;
85 | 6)
86 | $audacity; $back
87 | ;;
88 | 7)
89 | $snap; $back
90 | ;;
91 | 8)
92 | $inkscape; $back
93 | ;;
94 | 9)
95 | $ssr; $back
96 | ;;
97 | 10)
98 | $kdenlive; $back
99 | ;;
100 | 11)
101 | $flowblade; $back
102 | ;;
103 | 12)
104 | $gsysmon; $back
105 | ;;
106 | 13)
107 | $flatpak; $back
108 | ;;
109 | 14)
110 | $etcher; $back
111 | ;;
112 | 15)
113 | $zoom; $back
114 | ;;
115 | 16)
116 | $box86; $back
117 | ;;
118 | esac
119 |
--------------------------------------------------------------------------------
/apps/audacity.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove audacity."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y audacity || error "Failed to install audacity!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y audacity || error "failed to remove audacity!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/blender.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove blender."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y blender || error "Failed to install blender!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y blender || error "failed to remove blender!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/box86.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | clear
12 | echo "this script will help you install or remove gparted."
13 | PS3='Please enter the number for install/remove (1 - 3): '
14 | options=("install" "remove" "back to app installer")
15 | select opt in "${options[@]}"
16 | do
17 | case $opt in
18 |
19 |
20 |
21 | "install")
22 |
23 | cd $HOME
24 |
25 | if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then
26 | echo "Installing arm64 etcher..."
27 | echo "unfortunately 64bit support isn't here yet, I'm still working on it." && sleep 5 && $DIRECTORY/main.sh
28 | elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then
29 | echo "OS is 32bit..."
30 | else
31 | error "Failed to detect OS CPU architecture! Something is very wrong."
32 | fi
33 |
34 | sudo apt update || error "Failed to update repos (not critical)."
35 | echo "$(tput setaf 3)box86 wont be installed if you are on TwisterOS$(tput sgr 0)"
36 | sleep 5
37 | #if box86 folder exists
38 | if [ -d box86 ];then
39 | # if OS is not twisteros, then ask
40 | if [ ! -f /usr/local/bin/twistver ];then
41 | echo -n "Box86 already exists on your system. Do you want it overwritten with the latest version? [Y/n] "
42 | read answer
43 | if [ ! -z "$answer" ] && [ "$answer" == 'n' ];then
44 | echo -e "using your pre-existing version of box86.\nBEWARE: It may be out of date and \e[1m\e[97may not run Zoom successfully!\e[0m"
45 | #os is not twister, and box86 exists, but user declined overwrite
46 | compile=0
47 | else
48 | #not twisteros, box86 does exist, and user confirmed overwrite
49 | compile=1
50 | fi
51 | else
52 | #os is twisteros and box86 folder exists
53 | compile=0
54 | fi
55 | else
56 | #os may or may not be twisteros, but box86 does not exist
57 | compile=1
58 | fi
59 |
60 | if [ $compile == 1 ];then
61 | gio trash ~/box86
62 | cd $HOME
63 | git clone https://github.com/ptitSeb/box86.git || error 'Failed to clone box86 repository!'
64 | cd box86 || error 'Failed to enter ~box86!'
65 | mkdir build || error 'Failed to make build directory!'
66 | cd build || error 'Failed to enter build directory!'
67 | cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo || error 'Failed to run cmake!'
68 | echo "Compiling box86..."
69 | make -j4 || error 'Failed to compile!'
70 | echo "Installing box86 on your system..."
71 | sudo make install || error "Failed to run sudo make install!"
72 | sudo systemctl restart systemd-binfmt
73 | elif [ $compile == 0 ];then
74 | echo "box86 wont be installed."
75 | fi
76 |
77 | break
78 | ;;
79 |
80 | "remove")
81 |
82 | echo "$(tput setaf 3)removing box86...$(tput sgr 0)"
83 | cd $HOME/box86/build
84 | sudo make uninstall
85 | sudo rm -rf $HOME/box86 || error "can't remove ~/box86"
86 | #sudo rm -f /usr/local/bin/box86 || error "can't remove /usr/local/bin/box86"
87 |
88 | break
89 | ;;
90 |
91 | "back to app installer")
92 |
93 | $APPS/appinstaller.sh
94 | break
95 | ;;
96 |
97 | *) echo "invalid option $REPLY";;
98 | esac
99 | done
100 |
101 | sleep 1
102 |
--------------------------------------------------------------------------------
/apps/chromium.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove the special optimize chromium version for the rpi."
12 | PS3='Please enter the number for install/remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 | "install")
19 |
20 | sudo apt update || error "Failed to update repos (not critical)."
21 | sudo apt install -y chromium-browser chromium-chromedriver chromium-codecs-ffmpeg-extra rpi-chromium-mods || error "Failed to install chromium!"
22 | sleep 2
23 |
24 | break
25 | ;;
26 |
27 | "remove")
28 |
29 | sudo apt purge -y chromium-browser || error "Failed to remove chromium!"
30 | sleep 2
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 | sleep 1
46 |
--------------------------------------------------------------------------------
/apps/credits:
--------------------------------------------------------------------------------
1 | etcher debs compiled by Itai Nelken.
2 | scripts, and Idea by Itai Nelken.
3 |
--------------------------------------------------------------------------------
/apps/etcher.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | function download_latest_release_armhf() {
8 | echo "Downloading latest armhf release..."
9 | curl -s https://api.github.com/repos/$1/releases/latest \
10 | | grep "browser_download_url.*armv7l.deb" \
11 | | cut -d : -f 2,3 \
12 | | tr -d \" \
13 | | wget -qi -
14 | }
15 |
16 | function download_latest_release_arm64() {
17 | echo "Downloading latest arm64 release..."
18 | curl -s https://api.github.com/repos/$1/releases/latest \
19 | | grep "browser_download_url.*armv64.deb" \
20 | | cut -d : -f 2,3 \
21 | | tr -d \" \
22 | | wget -qi -
23 | }
24 |
25 | #variables
26 | DIRECTORY="$HOME/Pi-Assistant"
27 | APPS="$HOME/Pi-Assistant/apps"
28 |
29 | echo "this script will help you install or remove BalenaEtcher."
30 | PS3='Please enter the number for install or remove (1 - 4): '
31 | options=("install" "compile" "remove" "back to app installer")
32 | select opt in "${options[@]}"
33 | do
34 | case $opt in
35 |
36 |
37 |
38 | "install")
39 |
40 | sudo apt update || error "Failed to update repos (not critical)."
41 |
42 | #determine if host system is 64 bit arm64 or 32 bit armhf
43 | if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then
44 | echo "Installing arm64 etcher..."
45 | cd $HOME || error "Failed to change to home directory (not super critical)"
46 | download_latest_release_arm64 Itai-Nelken/Etcher-arm-32-64 || error "Failed to Download etcher!"; read -p "press enter to exit"; exit 1
47 | sudo apt -f -y install ./balena-etcher-electron*arm64.deb || error "Failed to install etcher deb!"; read -p "press enter to exit"; exit 1
48 | rm -f balena-etcher-electron*arm64.deb || error "Failed to delete etcher deb (not critical)"
49 | elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then
50 | echo "Installing armhf etcher..."
51 | cd $HOME || error "Failed to change to home directory (not super critical)"
52 | download_latest_release_armhf Itai-Nelken/Etcher-arm-32-64 || error "Failed to Download etcher!"; read -p "press enter to exit"; exit 1
53 | sudo apt -f -y ./install balena-etcher-electron*armv7l.deb || error "Failed to install etcher deb!"; read -p "press enter to exit"; exit 1
54 | rm -f balena-etcher-electron*armv7l.deb || error "Failed to delete etcher deb (not critical)"
55 | else
56 | error "Failed to detect OS CPU architecture! Something is very wrong."
57 | fi
58 |
59 | #if $(uname -m | grep '64'); then
60 | #
61 | # wget https://github.com/Itai-Nelken/Etcher-arm-32-64/releases/download/realease/balena-etcher-electron_1.5.110+1f8f7ad7_arm64.deb -O ~/etcher64.deb || error "Failed to download!"
62 | #
63 | # sudo apt install -y --fix-broken ~/etcher64.deb || error "failed to install deb file!"
64 | # rm -f ~/etcher64.deb
65 | #else
66 | # wget https://github.com/Itai-Nelken/Etcher-arm-32-64/releases/download/realease/balena-etcher-electron_1.5.110+1f8f7ad7_armv7l.deb -O ~/etcher32.deb || error "Failed to download!"
67 | #
68 | # sudo apt install -y --fix-broken ~/etcher32.deb || error "failed to install deb file!"
69 | # rm -f ~/etcher32.deb
70 | #
71 | #fi
72 |
73 | break
74 | ;;
75 |
76 | "compile")
77 |
78 | wget -qO- https://raw.githubusercontent.com/Itai-Nelken/Etcher-arm-32-64/main/compile-etcher_v1.5.116.sh | bash || error "Failed to download and run compile sctipt!"
79 | read -p "do you want to install etcher from the deb you just compiled (y/n)?" choice
80 | case "$choice" in
81 | y|Y ) echo "installing etcher..." && cd $HOME/Downloads/etcher/dist && sudo apt install -y --fix-missing balena-etcher-electron*.deb;;
82 | n|N ) echo "deb file is in ~/Downloads/etcher/dist" && sleep 5;;
83 | * ) echo "invalid";;
84 | esac
85 |
86 |
87 | break
88 | ;;
89 |
90 |
91 | "remove")
92 |
93 | sudo apt purge -y balena-etcher-electron || error "failed to remove etcher!"
94 |
95 | break
96 | ;;
97 |
98 | "back to app installer")
99 |
100 | $APPS/appinstaller.sh
101 |
102 | break
103 | ;;
104 |
105 | *) echo "invalid option $REPLY";;
106 | esac
107 | done
108 |
109 | sleep 2
110 | clear
111 |
--------------------------------------------------------------------------------
/apps/firefox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove firefox-esr."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y firefox-esr || error "Failed to install firefox-esr!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y firefox-esr || error "failed to remove firefox-esr!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/flatpak.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove flatpak and add its flathub repository."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y flatpak || error "Failed to install flatpak!"
24 | echo "$(tput setaf 3)adding flathub repository... $(tput sgr 0)"
25 | flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || error "Failed to add flathub flatpak repository!"
26 | yad --width=300 --height=60 --button=skip:0 --button=Reboot:1 --title "installing flatpak..." --text="You need to reboot to complete installation of flatpak." --text="do you want to reboot now?" --center --on-top
27 | if [[ $button -eq 1 ]]; then
28 | yad --timeout=5 --timeout-indicator=top --no-buttons --on-top --center --title="Rebooting..." --text="rebooting in 5 seconds"
29 |
30 | elif [[ $button -eq 0 ]]; then
31 | yad --timeout=15 --timeout-indicator=top --no-buttons --on-top --center --title="installing flatpak" --text="please reboot later or menu shortcuts won't appear"
32 | fi
33 |
34 | break
35 | ;;
36 |
37 | "remove")
38 |
39 | sudo apt purge -y flatpak || error "failed to remove flatpak!"
40 |
41 | break
42 | ;;
43 |
44 | "back to app installer")
45 |
46 | $APPS/appinstaller.sh
47 |
48 | break
49 | ;;
50 |
51 | *) echo "invalid option $REPLY";;
52 | esac
53 | done
54 |
55 | sleep 2
56 | clear
57 |
--------------------------------------------------------------------------------
/apps/flowblade.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove flowblade."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y flowblade || error "Failed to install flowblade!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y flowblade || error "failed to remove flowblade!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/gparted.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | clear
12 | echo "this script will help you install or remove gparted."
13 | PS3='Please enter the number for install/remove (1 - 3): '
14 | options=("install" "remove" "back to app installer")
15 | select opt in "${options[@]}"
16 | do
17 | case $opt in
18 |
19 |
20 |
21 | "install")
22 |
23 | echo "$(tput setaf 3)installing gparted...$(tput sgr 0)"
24 | sudo apt update || error "failed to update repositories (not critical)."
25 | sudo apt install -y gparted || error "Failed to install gparted!"
26 |
27 | break
28 | ;;
29 |
30 | "remove")
31 |
32 | echo "$(tput setaf 3)removing gparted...$(tput sgr 0)"
33 | sudo apt purge -y gparted || error "Failed to remove gparted"
34 | sleep 2
35 | clear
36 |
37 | break
38 | ;;
39 |
40 | "back to app installer")
41 |
42 | $APPS/appinstaller.sh
43 | break
44 | ;;
45 |
46 | *) echo "invalid option $REPLY";;
47 | esac
48 | done
49 |
50 | sleep 1
51 |
--------------------------------------------------------------------------------
/apps/gsysmon.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove GNOME system monitor."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y gnome-system-monitor || error "Failed to install gnome-system-monitor!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y gnome-system-monitor || error "failed to remove gnome-system-monitor!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/inkscape.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove inkscape."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y inkscape || error "Failed to install inkscape!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y inkscape || error "failed to remove inkscape!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/kdenlive.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove kdenlive."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y kdenlive || error "Failed to install kdenlive!"
24 |
25 | break
26 | ;;
27 |
28 | "remove")
29 |
30 | sudo apt purge -y kdenlive || error "failed to remove kdenlive!"
31 |
32 | break
33 | ;;
34 |
35 | "back to app installer")
36 |
37 | $APPS/appinstaller.sh
38 |
39 | break
40 | ;;
41 |
42 | *) echo "invalid option $REPLY";;
43 | esac
44 | done
45 |
46 | sleep 2
47 | clear
48 |
--------------------------------------------------------------------------------
/apps/snap.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove snap and snap-store."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 |
20 | "install")
21 |
22 | sudo apt update || error "Failed to update repos (not critical)."
23 | sudo apt install -y snapd || error "Failed to install snapd!"; sleep 30; $APPS/appinstaller.sh
24 | sudo snap install core || error "Failed to install snap core!"
25 | sudo snap install snap-store || error "Failed to install snap-store!"
26 | button=$?
27 | yad --width=300 --height=60 --button=skip:0 --button=Reboot:1 --title "installing snap..." --text="You need to reboot to complete installation of snap." --text="do you want to reboot now?" --center --on-top
28 | if [[ $button -eq 1 ]]; then
29 | yad --timeout=15 --timeout-indicator=top --no-buttons --on-top --center --title="Rebooting..." --text="rebooting in 5 seconds"
30 |
31 | elif [[ $button -eq 0 ]]; then
32 | yad --timeout=15 --timeout-indicator=top --no-buttons --on-top --center --title="installing snap" --text="please reboot later or menu shortcuts won't appear"
33 | fi
34 |
35 | break
36 | ;;
37 |
38 | "remove")
39 |
40 | sudo snap remove snap-store || error "failed to remove snap-store!"
41 | sudo snap remove core || error "failed to remove snap core!"
42 | rm -rf ~/snap || error "failed to delete ~/snap, trying again as root."
43 | sudo rm -rf ~/snap || error "failed to delete ~/snap as root!"
44 | sudo apt purge -y snapd || error "failed to remove snapd!"
45 |
46 | break
47 | ;;
48 |
49 | "back to app installer")
50 |
51 | $APPS/appinstaller.sh
52 |
53 | break
54 | ;;
55 |
56 | *) echo "invalid option $REPLY";;
57 | esac
58 | done
59 |
60 | sleep 2
61 | clear
62 |
--------------------------------------------------------------------------------
/apps/ssr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove simplescreenrecorder."
12 | PS3='Please enter the number for install or remove (1 - 3): '
13 | options=("install" "remove" "back to app installer")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 | "install")
19 |
20 | sudo apt update || error "Failed to update repos (not critical)."
21 | sudo apt install -y simplescreenrecorder || error "Failed to install simplescreenrecorder!"
22 |
23 | break
24 | ;;
25 |
26 | "remove")
27 |
28 | sudo apt purge -y simplescreenrecorder || error "failed to remove simplescreenrecorder!"
29 |
30 | break
31 | ;;
32 |
33 | "back to app installer")
34 |
35 | $APPS/appinstaller.sh
36 |
37 | break
38 | ;;
39 |
40 | *) echo "invalid option $REPLY";;
41 | esac
42 | done
43 |
44 | sleep 2
45 | clear
46 |
--------------------------------------------------------------------------------
/apps/zoom.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you install or remove zoom Linux x86 client running with box86."
12 | echo -e "$(tput setaf 3)$(tput bold)Audio input isn't working for some people!$(tput sgr 0)"
13 | PS3='Please enter the number for install or remove (1 - 3): '
14 | options=("install" "remove" "back to app installer")
15 | select opt in "${options[@]}"
16 | do
17 | case $opt in
18 |
19 |
20 |
21 | "install")
22 |
23 | cd $HOME
24 |
25 | #determine if host system is 64 bit arm64 or 32 bit armhf
26 | if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then
27 | #64 bit
28 | echo "unfortunately 64bit support isn't here yet, I'm still working on it." && sleep 5 && $DIRECTORY/main.sh --no-internet
29 | elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then
30 | #32 bit
31 | echo "OS is 32bit"
32 | else
33 | error "Failed to detect OS CPU architecture! Something is very wrong." && sleep 5 && $DIRECTORY/main.sh --no-internet
34 | fi
35 |
36 | sudo apt update || error "Failed to update repos (not critical)."
37 |
38 | #if box86 folder exists
39 | if [ -d box86 ];then
40 | # if OS is not twisteros, then ask
41 | if [ ! -f /usr/local/bin/twistver ];then
42 | echo -n "Box86 already exists on your system. Do you want it overwritten with the latest version? [Y/n] "
43 | read answer
44 | if [ ! -z "$answer" ] && [ "$answer" == 'n' ];then
45 | echo -e "using your pre-existing version of box86.\nBEWARE: It may be out of date and \e[1m\e[97may not run Zoom successfully!\e[0m"
46 | #os is not twister, and box86 exists, but user declined overwrite
47 | compile=0
48 | else
49 | #not twisteros, box86 does exist, and user confirmed overwrite
50 | compile=1
51 | fi
52 | else
53 | #os is twisteros and box86 folder exists
54 | compile=0
55 | fi
56 | else
57 | #os may or may not be twisteros, but box86 does not exist
58 | compile=1
59 | fi
60 |
61 | #check if ~/zoom folde exists (check if zoom is already installed)
62 | if [ -d "${HOME}/zoom" ];then
63 | echo -ne "${HOME}/zoom already exists on your system. Do you want it overwritten with the latest version? [Y/n] "
64 | read answer
65 | if [ ! -z "$answer" ] && [ "$answer" == 'n' ];then
66 | dlzoom=0
67 | else
68 | download=1
69 | fi
70 | else
71 | download=1
72 | fi
73 |
74 | echo "installing dependencies..."
75 | sudo apt install -y -f libxcb-xtest0 libxcb-xfixes0 cmake
76 | #refresh lib list
77 | sudo ldconfig
78 | if [ $download == 1 ];then
79 | echo "Downloading zoom..."
80 | rm -rf "${HOME}/zoom" ~/zoomx86.tar.xz
81 | wget https://github.com/Itai-Nelken/Pi-Assistant-files/raw/main/files/zoom.tar.xz -O zoomx86.tar.xz || error 'Failed to download Zoom!'
82 | echo "extracting zoom..."
83 | tar -xf zoomx86.tar.xz || error 'Failed to extract Zoom!'
84 | rm -f zoomx86.tar.xz
85 | fi
86 |
87 | echo "Creating zoom launcher script..."
88 | echo "#!/bin/bash
89 | function error {
90 | echo -e "\\e[91m$1\\e[39m"
91 | exit 1
92 | }
93 |
94 | if [ -d ~/box86 ]; then
95 |
96 | echo "box86 installed..."
97 |
98 | else
99 | echo "Box86 missing! please install"
100 | exit 1
101 |
102 | fi
103 |
104 | if [ -d ~/zoom ]; then
105 |
106 | echo "zoom folder exists..."
107 |
108 | else
109 | echo "zoom folder is missing! please reinstall zoom"
110 | exit 1
111 |
112 | fi
113 |
114 | #go to zoom directory (~/zoom)
115 | cd $HOME/zoom || error 'Failed to change directory to ~/zoom!'
116 | echo "$(tput setaf 3)close this window to exit zoom$(tput sgr 0)"
117 | sleep 1
118 | echo "$(tput setaf 2)starting zoom...$(tput sgr 0)"
119 | sleep 1
120 | #start zoom with box86
121 | pulseaudio --start
122 | box86 zoom || error "can't start zoom!"
123 | echo "$(tput setaf 2)exiting in 5 seconds.($(tput sgr 0)"
124 | sleep 5' > "${HOME}/zoom/startzoom.sh"
125 | sudo chmod +x "${HOME}/zoom/startzoom.sh"
126 |
127 | if [ $compile == 1 ];then
128 | gio trash ~/box86
129 | cd $HOME
130 | git clone https://github.com/ptitSeb/box86.git || error 'Failed to clone box86 repository!'
131 | cd box86 || error 'Failed to enter ~box86!'
132 | mkdir build || error 'Failed to make build directory!'
133 | cd build || error 'Failed to enter build directory!'
134 | cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo || error 'Failed to run cmake!'
135 | echo "Compiling box86..."
136 | make -j4 || error 'Failed to compile!'
137 | echo "Installing box86 on your system..."
138 | sudo make install || error "Failed to run sudo make install!"
139 | fi
140 |
141 | echo "Restarting systemd-binfmt service..."
142 | sudo systemctl restart systemd-binfmt || error "Failed to restart systemd-binfmt service! please reboot before running zoom"
143 |
144 | echo "Creating Menu shortcut..."
145 | echo '[Desktop Entry]
146 | Name=Zoom
147 | Exec="$HOME/zoom/startzoom.sh"
148 | Icon="${DIRECTORY}/icons/64x64/zoom-64.png"
149 | Path="${HOME}/zoom/"
150 | Type=Application
151 | Terminal=true
152 | StartupNotify=true
153 | Comment="Linux x86 version of Zoom clud meetings client using Box86"
154 | Categories=Network;
155 | StartupNotify=true' > ~/.local/share/applications/zoom.desktop
156 |
157 | read -p "Do you want to create a shortcut on your Desktop (y/n)?" choice
158 | case "$choice" in
159 | y|Y ) echo "creating desktop shortcut" && cp ~/.local/share/applications/zoom.desktop ~/Desktop && sudo chmod +x ~/Desktop/zoom.desktop || error "failed to copy desktop shortcut";;
160 | n|N ) echo "skipping desktop shortcut" ;;
161 | * ) echo "invalid";;
162 | esac
163 |
164 | echo "installation complete!"
165 | sleep 5
166 |
167 | break
168 | ;;
169 |
170 | "remove")
171 |
172 | rm ~/.local/share/applications/zoom.desktop
173 | rm $HOME/Desktop/zoom.desktop || error "failed to remove Desktop shortcut, probably doesn't exist. (not critical)"
174 | read -p "Do you want to remove box86 (y/n)?" choice
175 | case "$choice" in
176 | y|Y ) cd $HOME/box86/build && sudo make uninstall && rm -rf $HOME/box86;;
177 | n|N ) echo "box86 won't be removed" ;;
178 | * ) echo "invalid";;
179 | esac
180 | read -p "Do you want to remove dependencies (libxcb-xtest0 libxcb-xfixes0 cmake) (y/n)?" choice
181 | case "$choice" in
182 | y|Y ) sudo apt purge -y libxcb-xtest0 libxcb-xfixes0 cmake || error "failed to remove gnome-system-monitor!";;
183 | n|N ) echo "dependencies wont be removed." ;;
184 | * ) echo "invalid";;
185 | esac
186 |
187 | break
188 | ;;
189 |
190 | "back to app installer")
191 |
192 | $APPS/appinstaller.sh
193 |
194 | break
195 | ;;
196 |
197 | *) echo "invalid option $REPLY";;
198 | esac
199 | done
200 |
201 | sleep 2
202 | clear
203 |
--------------------------------------------------------------------------------
/icons/128x128/logo-64 12.15.10 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/128x128/logo-64 12.15.10 PM.png
--------------------------------------------------------------------------------
/icons/128x128/rpi-64 12.15.10 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/128x128/rpi-64 12.15.10 PM.png
--------------------------------------------------------------------------------
/icons/128x128/zoom-64 12.15.10 PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/128x128/zoom-64 12.15.10 PM.png
--------------------------------------------------------------------------------
/icons/24x24/logo-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/24x24/logo-24.png
--------------------------------------------------------------------------------
/icons/64x64/logo-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/64x64/logo-64.png
--------------------------------------------------------------------------------
/icons/64x64/rpi-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/64x64/rpi-64.png
--------------------------------------------------------------------------------
/icons/64x64/zoom-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/64x64/zoom-64.png
--------------------------------------------------------------------------------
/icons/ascii-art.html:
--------------------------------------------------------------------------------
1 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
13 | @@@#@@#@&///////////(#@@#@@#@@#@%%&&%&&%&&%&&%@@#@@#@@#@@#@@#@@#@@#@@#@@#@@#@@@@
14 | @%@@%@@%@@#/////////////@%@@%@@%%&%&&%&&%&&%&&%@@%@@%@@%@@%@@%@@%@@%@@%@@%@@%@@@
15 | @%@@#@@#@@#@@#@//////////@@@@@@@@@&&&%&&%&&%&&@@@@@@@@@@@@#@@#@@#@@#@@#@@#@@&@@@
16 | @@%@@%@@%@@%@@%@////@@@@(((((((((((#&@@&%%@@@((((((((((((@@@@&%%@%@@%@@%@@%@@@@@
17 | @@%@@%@@%@@%@@%(////@@(((((&((((((((((#@&@(((((((((((#(((((@@&%&%%@@#@@#@@#@@@@@
18 | @#///(%@@%@@%@///////@@(((((((((@%(((((@@@(((((&@(((((((((@@%&&%%&%&@%@@%@@%@@@@
19 | @@////////////////////@&(((((((((((@@@@@@@@&@%((((((((((#@@&%&&%%&%&&#@@#@@#@@@@
20 | @#@/////////////////////@@@#(((((((%@@@@@@@@@#(((((((#@@@&%&%%&&%&&%@@%@@%@@%@@@
21 | @%@@%//////////////////////@@@@@@@@@@&#####@@@@@@@@@@&&%&&%&&%&&%@@%@@%@@%@@%@@@
22 | @@#@@#@@////////////////@@######&@&###########@@######@@%&&%&&%&%%@@%@@%@@%@@@@@
23 | @@%@@%@@%@@%@@%&@%@///(@&#####@@@@@@#########@@@@@#####%@&&%&&%&%%&@%@@%@@%@@@@@
24 | @@@#@@#@@#&&%&&%%&%@@#@@##@@@@#######@@@@@@%######&@@@##@@&&%&&%%&%&@#@@#@@#@@@@
25 | @@&%&&%&&%&&%&&%&&%&@@@&@@@@###########@@@###########@@@#@@@%&&%%&%&&%&&%&&%@@@@
26 | @%&&&&&%&&%&&%&&%&&@@####@@############@@@############@&####@@&&%&&%&&%&&%&&%@@@
27 | @%&&%&&%&&%&&%&&%&@@#####@@###########@@@@@###########@@####&@&&%&&%&&%&&%&&%@@@
28 | @&%&%&%&%&%&%&%&%&@@####@@@@########@@@@@@@@@#######@@@@####@@%&%%%&%&%%%&%&@@@@
29 | @@%&&%&&%&&%&&%&&%&@@##@@@@@@@@@@@@##########%@@@@@@@@@@@%#@@&%&%%&&%&&%&&%&@@@@
30 | @@&(&%&&%&&&&&&&%&&&@@@######@@@@@#############@@@%######@@@&&&&%&%&&&&%&&@#@@@@
31 | @@@%@@%@@%&&%&&%&&%&&@@########%@@#############@&########@@@%@@%@@%@@%@@%@@%@@@@
32 | @&@#%@%%@%%&&&&&%&&&&&@@#########@@@#########@@@########%@&///////////#@&#@&@@@@
33 | @%@@%@@%@@%@&%&&%&&%&&%&@@&######@@@@@@@@@@@@@@@######@@@///////////////@%@@%@@@
34 | @#%@#%@#%@#%&&&&%&&&&&&&&&&&@@@@@@&###########@@@@@@@/////////////////////#@@@@@
35 | @@%@@%@@%&&%&&%&&%&&%&&%&&%&&%&&@@@##########@@@@@(//////////////%@@///////@@@@@
36 | @@#&@#&@#&&&%&&&%&&&%&&&%&&&%&&&%&&&@@@@@@@@@&&&&@////////////#%@#%@#%@#///%@@@@
37 | @@@%@@%@@%@&%&&%&&%&&%&&%&&%&&%&%%&&%&&%&&%&&%&&%@///////////@@%@@%@@%@@%@@%@@@@
38 | @@@(&@(&@(&@(&&&%&&&&&&@#%&&&&&&%&&&&&&&&&&&&&&&#%///////////%@#%@#%@#%@%%@%@@@@
39 | @%@@%@@%@@%@@%@@%&&%@@%@@%@@%@@%%&%&&%&&%&&%&&%@@%@////////////@%@@%@@%@@%@@%@@@
40 | @%@@#@@#@@#@@#@@#@@#@@#@@#@@#@@#%&&&&&&&%&&&&&#@@#@@#//////////////(&@(&@(&@@@@@
41 | @@%@@%@@%@@%@@%@@%@@%@@%@@%@@%@@%&&%&&%&&%&&%&@%@@%@@%@@%#////////&@%@@%@@%@@@@@
42 | @@#@@#@@#@@#@@#@@#@@#@@#@@#@@#@@#@@%&&%&&%&@#@@#@@#@@#@@#&@#&@#&@#&@#&@#&@#&@@@@
43 |
--------------------------------------------------------------------------------
/icons/old/system-tools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/old/system-tools.png
--------------------------------------------------------------------------------
/icons/pi-assistant-logopng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/pi-assistant-logopng.png
--------------------------------------------------------------------------------
/icons/raspi-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/raspi-logo.png
--------------------------------------------------------------------------------
/icons/zoom-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/icons/zoom-icon.png
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | cd $HOME
8 | echo "cloning repo..."
9 | git clone https://github.com/Itai-Nelken/Pi-Assistant.git
10 |
11 | #variables for the main app folders. DIRECTORY is the main folder, APP is the apps folder ($DIRECTORY/apps)
12 | DIRECTORY="$HOME/Pi-Assistant"
13 | APPS="$HOME/Pi-Assistant/apps"
14 |
15 | #install dependencies for main menu windows and pop-up windows
16 | echo "installing dependencies..."
17 | if ! which yad >/dev/null ; then
18 | sudo apt install -y yad
19 | #echo "installed">~/Pi-Assistant/data/yad
20 | elif ! which dialog >/dev/null ; then
21 | sudo apt install -y dialog
22 | #echo "installed">~/Pi-Assistant/data/dialog
23 | elif ! which xdg-open >/dev/null ; then
24 | sudo apt install -y xdg-utils
25 | #echo "installed">~/Pi-Assistant/data/xdg
26 | elif ! which neofetch >/dev/null ; then
27 | sudo apt install -y neofetch
28 | #echo "installed">~/Pi-Assistant/data/neofetch
29 | else
30 | echo "dependencies already installed..."
31 | fi
32 | echo "dependencies installed..."
33 |
34 | #create menu shortcut
35 | echo "[Desktop Entry]
36 | StartupNotify=true
37 | Terminal=true
38 | Type=Application
39 | Name=Pi-Assistant
40 | Exec="$HOME/Pi-Assistant/main.sh"
41 | Icon="$HOME/Pi-Assistant/icons/64x64/logo-64.png"
42 | Categories=Utility;
43 | Comment="Pi-Assistant v1.4.0"" > ~/.local/share/applications/piassist.desktop
44 | #copy menu shortcut to desktop
45 | cp ~/.local/share/applications/piassist.desktop ~/Desktop/
46 | sudo chmod +x ~/Desktop/piassist.desktop
47 |
48 | #add startup from terminal using 'piassist'
49 | echo "creating /usr/local/bin/piassist"
50 | echo '#!/bin/bash
51 | cd ~/Pi-Assistant
52 | #flags
53 | if [[ $1 = "--version" ]] || [[ $1 == "-v" ]]; then
54 | ./main.sh --version
55 | elif [[ $1 = "--secret" ]]; then
56 | ./main.sh --secret
57 | elif [[ $1 = "--no-internet" ]] || [[ $1 == "-ni" ]]; then
58 | ./main.sh --no-internet
59 | elif [[ $1 = "--help" ]] || [[ $1 == "-h" ]]; then
60 | ./main.sh --help
61 | elif [[ $1 = "--no-update" ]] || [[ $1 == "-nu" ]]; then
62 | ./main.sh --no-update
63 | else
64 | clear && $HOME/Pi-Assistant/main.sh
65 | fi' > ~/Downloads/piassist
66 | sudo mv ~/Downloads/piassist /usr/local/bin/
67 | sudo chmod +x /usr/local/bin/piassist
68 |
69 | #mark all scripts as executables
70 | echo "marking all scripts as executable..."
71 | cd $DIRECTORY
72 | sudo chmod +x *.sh
73 | sudo chmod +x apps/*.sh
74 | #print in green 'installation succesful' and in orange how to run Pi-Assistant
75 | echo "$(tput setaf 2)Installation succesful! $(tput sgr 0)"
76 | echo -e "$(tput setaf 3)to run Pi-Assistant, run the desktop shortcut or main menu>other>Pi-Assistant
77 | or type 'piassist' in terminal. to see a list of all commands, run 'piassist --help' in terminal$(tput sgr 0)"
78 |
--------------------------------------------------------------------------------
/main.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #########################################################################################
4 | #██████╗░██╗░░░░░░░█████╗░░██████╗░██████╗██╗░██████╗████████╗░█████╗░███╗░░██╗████████╗#
5 | #██╔══██╗██║░░░░░░██╔══██╗██╔════╝██╔════╝██║██╔════╝╚══██╔══╝██╔══██╗████╗░██║╚══██╔══╝#
6 | #██████╔╝██║█████╗███████║╚█████╗░╚█████╗░██║╚█████╗░░░░██║░░░███████║██╔██╗██║░░░██║░░░#
7 | #██╔═══╝░██║╚════╝██╔══██║░╚═══██╗░╚═══██╗██║░╚═══██╗░░░██║░░░██╔══██║██║╚████║░░░██║░░░#
8 | #██║░░░░░██║░░░░░░██║░░██║██████╔╝██████╔╝██║██████╔╝░░░██║░░░██║░░██║██║░╚███║░░░██║░░░#
9 | #╚═╝░░░░░╚═╝░░░░░░╚═╝░░╚═╝╚═════╝░╚═════╝░╚═╝╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░#
10 | #########################################################################################
11 |
12 | function error {
13 | echo -e "\e[91m$1\e[39m"
14 | }
15 |
16 | #version variable (change $APPVER in main.sh, appinstaller.sh).
17 | APPVER="v1.4.0"
18 |
19 | #check for updates variable
20 | UPDATE=1
21 |
22 | #set NOINTERNETCHECK variable to 0 (check)
23 | if [ ! "$NOINTERNETCHECK" == 1 ]; then
24 | NOINTERNETCHECK=0
25 | fi
26 |
27 | #check if dialog is installed
28 | if ! command -v dialog > /dev/null; then
29 | error "dialog isn't installed! Pi-Assistant cannot run without it!"
30 | echo -e "$(tput setaf 3)$(tput bold)you can install it by running: sudo apt install dialog -y$(tput sgr 0)"
31 | read -p "Press [ENTER] to exit."
32 | exit 1
33 | else
34 | true
35 | fi
36 |
37 | #variables
38 | DIRECTORY="$HOME/Pi-Assistant"
39 | APPS="$HOME/Pi-Assistant/apps"
40 |
41 | #flags
42 | if [[ $1 = "--version" ]] || [[ $1 == "-v" ]]; then
43 | echo -e "$(tput bold)$(tput setaf 4)Pi-Assistant\n$APPVER\nby Itai Nelken$(tput sgr 0)"
44 | exit 0
45 | elif [[ $1 = "--secret" ]]; then
46 | xdg-open ~/Pi-Assistant/icons/ascii-art.html
47 | sleep 10
48 | clear -x
49 | read -p "press [ENTER] to exit"
50 | exit 0
51 | elif [[ $1 = "--no-internet" ]] || [[ $1 == "-ni" ]]; then
52 | NOINTERNETCHECK=1
53 | UPDATE=0
54 | elif [[ $1 = "--help" ]] || [[ $1 == "-h" ]]; then
55 | echo -e "
56 | $(tput setaf 6)$(tput bold)usage:$(tput sgr 0)
57 | piassist [flag]
58 |
59 | $(tput setaf 6)$(tput bold)available flags:$(tput sgr 0)
60 | --no-internet - dont check for internet connection and updates on startup (of the app).
61 | --no-update - don't check for updates on startup (of the app).
62 | --version - show version (in ascii art text) and exit.
63 | --secret - secret easter egg.
64 | --help - show this help info and exit.
65 |
66 | $(tput setaf 6)$(tput bold)some of the flags also have shorter versions:$(tput sgr 0)
67 | -ni = --no-internet
68 | -nu = --no-update
69 | -v = --version
70 | -h = --help
71 |
72 | $(tput setaf 6)$(tput bold)examples:$(tput sgr 0)
73 | piassist --secret
74 | piassist -h
75 | "
76 | exit
77 | elif [[ $1 = "--no-update" ]] || [[ $1 == "-nu" ]]; then
78 | UPDATE=0
79 | fi
80 |
81 | #check if exit variable equals 1, if yes exit
82 | if [[ "$exit" == 1 ]]; then
83 | exit 0
84 | fi
85 |
86 | #print a "loading screen"
87 | echo "$(tput setaf 2)$(tput bold)LOADING...$(tput sgr 0)"
88 |
89 |
90 | #check for internet connection (disable with -ni flag)
91 | if [[ "$NOINTERNETCHECK" != 1 ]]; then
92 | PINGOUTPUT=$(ping -c 1 8.8.8.8 >/dev/null && echo '...')
93 | if [ ! "$PINGOUTPUT" = '...' ]; then
94 | UPDATE=0
95 | echo -e "Internet connection required but not detected.\nthis could be caused by:\n * a weak wifi signal\n * no internet connection.\nTry the don't check for internet flag (--no-internet) usage: piassist --no-internet\n"
96 | read -p "Press [Enter] to exit..."
97 | NOINTERNETCHECK=0
98 | exit
99 | fi
100 | fi
101 |
102 | #check for updates and update if update available
103 | if [[ "$UPDATE" == 1 ]]; then
104 | cd $DIRECTORY
105 | . ./updater.sh --no-output
106 | elif [[ "$UPDATE" == 0 ]]; then
107 | echo " "
108 | fi
109 |
110 | #set NOINTERNETCHECK variable to 0 (check)
111 | if [ $NOINTERNETCHECK == "1" ]; then
112 | NOINTERNETCHECK=0
113 | fi
114 |
115 |
116 | cd "$HOME/Pi-Assistant"
117 | #variables containing the command for each option
118 | main="$DIRECTORY/main.sh --no-internet"
119 | update="$DIRECTORY/update.sh"
120 | passwd="$DIRECTORY/passwd.sh"
121 | apps="$APPS/appinstaller.sh" #apps variable used for my testing.
122 | systools="$DIRECTORY/systools.sh"
123 | sysinfo="$DIRECTORY/sys-info.sh"
124 | other="$DIRECTORY/other.sh"
125 | exit="exit 0"
126 |
127 | #change to $DIRECTORY (for $COMMIT to work)
128 | cd $DIRECTORY
129 | #dialog variables
130 | HEIGHT=15
131 | WIDTH=40
132 | CHOICE_HEIGHT=7
133 | BACKTITLE="Pi-Assistant $APPVER,"
134 | COMMIT="$(git log -1 | grep commit* | cut -c1-14)::::::Itai Nelken::::::"
135 | #TAG="$(curl --silent https://api.github.com/repos/Itai-Nelken/Pi-Assistant/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')" #same as $APPVER
136 | #CPU="CPU `lscpu | grep "Model name*"`"
137 | #MODEL="`cat /proc/cpuinfo | grep "Raspberry*"`"
138 | SPACER="_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_"
139 | TITLE="Main Menu"
140 | MENU="Choose one of the following options:"
141 |
142 | OPTIONS=(1 "Update OS"
143 | 2 "Change password"
144 | 3 "Application installer"
145 | 4 "System tools"
146 | 5 "System Information"
147 | 6 "Other"
148 | 7 "exit Pi-Assistant")
149 |
150 | CHOICE=$(dialog --clear \
151 | --backtitle "$BACKTITLE $COMMIT $SPACER" \
152 | --title "$TITLE" \
153 | --menu "$MENU" \
154 | $HEIGHT $WIDTH $CHOICE_HEIGHT \
155 | "${OPTIONS[@]}" \
156 | 2>&1 >/dev/tty)
157 |
158 | clear
159 | case $CHOICE in
160 | 1)
161 | $update; $main
162 | ;;
163 | 2)
164 | $passwd; $main
165 | ;;
166 | 3)
167 | $apps; $main
168 | ;;
169 | 4)
170 | $systools; $main
171 | ;;
172 | 5)
173 | $sysinfo; $main
174 | ;;
175 |
176 | 6)
177 | $other; $main 2> /dev/null #send output to /dev/null because after uninstalling you will get a "directory not found" error.
178 | ;;
179 |
180 | 7) $exit
181 | ;;
182 | esac
183 |
--------------------------------------------------------------------------------
/other.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 | echo "this script will help you update or uninstall Pi-Assistant."
12 | PS3='Please enter the number above for operation you would like to perform (1 - 3): '
13 | options=("update Pi-Assistant" "uninstall Pi-Assistant" "back to main menu")
14 | select opt in "${options[@]}"
15 | do
16 | case $opt in
17 |
18 |
19 | "update Pi-Assistant")
20 |
21 | source $DIRECTORY/updater.sh --output-no-ask-exit
22 | echo "You have to restart Pi-Assistant to apply the update."
23 | read -p "Press [CTRL+C] to exit."
24 |
25 | break
26 | ;;
27 |
28 |
29 | "uninstall Pi-Assistant")
30 |
31 | $DIRECTORY/uninstall.sh
32 |
33 | break
34 | ;;
35 |
36 |
37 |
38 |
39 | "back to main menu")
40 |
41 | sleep 0.0001
42 |
43 | break
44 | ;;
45 |
46 |
47 |
48 |
49 | *) echo "invalid option $REPLY";;
50 | esac
51 | done
52 |
--------------------------------------------------------------------------------
/passwd.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | #variables
8 | DIRECTORY="$HOME/Pi-Assistant"
9 | APPS="$HOME/Pi-Assistant/apps"
10 |
11 |
12 | echo "this script will help you change your user and root passwords."
13 | PS3='Please enter the number above for operation you would like to perform (1 - 5): '
14 | options=("user password" "root password" "back to main menu")
15 | select opt in "${options[@]}"
16 | do
17 | case $opt in
18 |
19 |
20 | "user password")
21 |
22 | passwd || error "error occured! couldn't complete operation"
23 |
24 | break
25 | ;;
26 |
27 |
28 | "root password")
29 |
30 | echo "you can use the same password as your user account if you wish"
31 | sudo passwd || error "error occured! couldn't complete operation"
32 |
33 | break
34 | ;;
35 |
36 |
37 |
38 |
39 | "back to main menu")
40 |
41 | sleep 0.0001
42 |
43 | break
44 | ;;
45 |
46 |
47 |
48 |
49 | *) echo "invalid option $REPLY";;
50 | esac
51 | done
52 |
--------------------------------------------------------------------------------
/resources.md:
--------------------------------------------------------------------------------
1 | # Links to resources I used:
2 | ## ascii art banners
3 | https://manytools.org/hacker-tools/ascii-banner/
4 | https://manytools.org/hacker-tools/convert-images-to-ascii-art/
5 | http://www.patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20
6 | ## stack exchange questions that I asked/found that helped me (not only with Pi-Assistant)
7 | https://unix.stackexchange.com/questions/166052/usage-of-set-e-in-bash
8 | https://unix.stackexchange.com/questions/631805/how-to-hold-package-from-updating-with-postinst-script-in-deb
9 | https://unix.stackexchange.com/questions/632890/how-to-pass-variables-between-2-bash-scripts-export-doesnt-work
10 | https://unix.stackexchange.com/questions/632337/how-to-check-if-a-program-version-is-equal-to-or-smaller-than-x/
11 | ### unanswered
12 | https://unix.stackexchange.com/questions/630716/how-to-cross-compile-qemu-for-armhf-arm64-on-x86-64
13 |
14 | ## other unrelated links
15 | https://raspberrypi.stackexchange.com/questions/120833/pi4-crashes-when-running-any-qt-apps-like-rpi-imager-vlc-obs
16 | https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=302170&p=1811670
17 |
18 | ## Some scripts
19 | ### do something if command succeeds/fails
20 | **Usage:** `./script.sh command` but change `script.sh` with the scripts name and `command` with a command.
21 | EXAMPLE: `./script.sh "echo test"
22 | ```bash
23 | #!/bin/bash
24 |
25 | $1 2> /dev/null
26 | RESULT=$?
27 | if [ $RESULT == 0 ]; then
28 | echo "command '$1' is a ran successfuly"
29 | else
30 | echo "command '$1' failed"
31 | fi
32 |
33 | ```
--------------------------------------------------------------------------------
/screenshots/pi-assistant.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/pi-assistant.gif
--------------------------------------------------------------------------------
/screenshots/pi-assistant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/pi-assistant.png
--------------------------------------------------------------------------------
/screenshots/pi-assistant2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/pi-assistant2.png
--------------------------------------------------------------------------------
/screenshots/piassist-appmenu-1.3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-appmenu-1.3.0.png
--------------------------------------------------------------------------------
/screenshots/piassist-appmenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-appmenu.png
--------------------------------------------------------------------------------
/screenshots/piassist-demo-edited.mov:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-demo-edited.mov
--------------------------------------------------------------------------------
/screenshots/piassist-demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-demo.gif
--------------------------------------------------------------------------------
/screenshots/piassist-demo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-demo.mp4
--------------------------------------------------------------------------------
/screenshots/piassist-main-menu-1.3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-main-menu-1.3.0.png
--------------------------------------------------------------------------------
/screenshots/piassist-mainmenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-mainmenu.png
--------------------------------------------------------------------------------
/screenshots/piassist-sys-info-1.3.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-sys-info-1.3.0.png
--------------------------------------------------------------------------------
/screenshots/piassist-sys-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/piassist-sys-info.png
--------------------------------------------------------------------------------
/screenshots/system-tools-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-1.png
--------------------------------------------------------------------------------
/screenshots/system-tools-1a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-1a.png
--------------------------------------------------------------------------------
/screenshots/system-tools-1b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-1b.png
--------------------------------------------------------------------------------
/screenshots/system-tools-1c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-1c.png
--------------------------------------------------------------------------------
/screenshots/system-tools-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-2.png
--------------------------------------------------------------------------------
/screenshots/system-tools-2a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/system-tools-2a.png
--------------------------------------------------------------------------------
/screenshots/updater.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Itai-Nelken/Pi-Assistant/7d50e4ed06b252a5acc3b088c37c437a9227b423/screenshots/updater.png
--------------------------------------------------------------------------------
/sys-info.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #clear the screen
4 | clear
5 |
6 | #print "loading screen"
7 | echo -e "$(tput setaf 2)$(tput bold)GETTING INFO...$(tput sgr0)"
8 |
9 | #loading bar
10 | echo ' '
11 |
12 | #clear the screen again
13 | #clear
14 |
15 | #print another message
16 | #echo -e "$(tput setaf 2)FORMATING INFO...$(tput sgr 0)"
17 |
18 | #variables
19 | DE="$(env | grep DESKTOP_SESSION)"
20 | USER="$(env | grep USER)"
21 | KERNEL="$(uname -r)"
22 | KARCH="$(uname -m)"
23 | NETNAME="$(uname -n)"
24 | KRELEASE="$(uname -v)"
25 | sleep 0.1
26 | echo -ne '(0%)[### ](100%)\r'
27 | CPU="$(lscpu | grep "Model name:")"
28 | MEM="`echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 * 1024)))`"
29 | MODEL="$(cat /proc/cpuinfo | grep Model)"
30 | sleep 0.1
31 | echo -ne '(0%)[##### ](100%)\r'
32 | CSPEED="$(lscpu | grep "CPU max" | cut -c22-25)"
33 | OS="$(cat /etc/*-release | grep PRETTY | cut -c14-43)"
34 | sleep 0.1
35 | echo -ne '(0%)[######## ](100%)\r'
36 | SOC="$(cat /proc/cpuinfo | grep Hardware | cut -c12-18)"
37 | CORES="$(nproc)"
38 | SOCREV="$(cat /proc/cpuinfo | grep Revision | cut -c12-18)"
39 | sleep 0.1
40 | echo -ne '(0%)[############## ](100%)\r'
41 | LOCALIP="$(hostname -I | awk '{print $1}')"
42 | PUBLICIP="$(wget -qO- ipinfo.io/ip)"
43 | FREEMEM="$(free -h -m --si| awk '{ print $7}'|sed '/^$/d')"
44 | sleep 0.1
45 | echo -ne '(0%)[#################### ](100%)\r'
46 | DRES="$(neofetch | grep Resolution | cut -c50-70 | cut -c4-21)"
47 | CPUTEMP="$(cat /sys/class/thermal/thermal_zone*/temp | cut -c1-2)"
48 | sleep 0.1
49 | echo -ne '(0%)[##########################](100%)\r'
50 | sleep 0.5
51 | echo -ne '\n'
52 |
53 | #determine if OS is TwisterOS or not
54 | if [ ! -f "/usr/local/bin/twistver" ]; then
55 | TWISTER=0
56 | else
57 | TWISTER=1
58 | fi
59 |
60 |
61 | #determine GPU model
62 | if [[ "$MODEL" == *"Raspberry Pi 4"* ]]; then
63 | GPU="Broadcom® VideoCore® VI"
64 | elif [[ "$MODEL" == *"Raspberry Pi 3"* ]]; then
65 | GPU="Broadcom® VideoCore® IV"
66 | elif [[ "$MODEL" == *"Raspberry Pi 2"* ]]; then
67 | GPU="Broadcom® VideoCore® IV"
68 | else
69 | GPU="0"
70 | fi
71 |
72 | #get gpu 3d block (v3d) clock speed
73 | if [ -f "/opt/vc/bin/vcgencmd" ]; then
74 | GPUSPEED="$(/opt/vc/bin/vcgencmd measure_clock v3d | cut -c15-23 | cut -c1-3)"
75 | else
76 | GPUSPEED=0
77 | fi
78 |
79 | #get GPU memory
80 | if [ -f "/opt/vc/bin/vcgencmd" ]; then
81 | GPUMEM="$(vcgencmd get_mem gpu)"
82 | else
83 | GPUMEM=0
84 | fi
85 |
86 |
87 | #determine if host system is 64 bit arm64 or 32 bit armhf
88 | if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then
89 | OSARCH=64
90 | elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then
91 | OSARCH=32
92 | else
93 | OSARCH=e
94 | fi
95 |
96 | #clear screen again
97 | clear
98 |
99 | ############### DISPLAY EVERYTHING ################
100 |
101 | printf "$(tput bold)\\e[3;4;37mBasic information:\\n\\e[0m$(tput sgr 0)"
102 |
103 | #display username
104 | echo "Username is: ${USER:5}"
105 | #display model name
106 | echo "Device model name is: ${MODEL:9}"
107 | #display network name
108 | echo "Device network name is: $NETNAME"
109 | #display IP address
110 | echo "Your local IP address is: $LOCALIP"
111 | echo "Your public IP address is: $PUBLICIP"
112 |
113 |
114 | echo -e " "
115 |
116 | printf "$(tput bold)\\e[3;4;37mSystem architectures:\\n\\e[0m$(tput sgr 0)"
117 | #display OS arch
118 | if [[ "$OSARCH" == 32 ]]; then
119 | echo "OS architecture is: 32bit ARM"
120 | elif [[ "$OSARCH" == 64 ]]; then
121 | echo "OS architecture is: 64bit ARM"
122 | elif [[ "$OSARCH" == e ]]; then
123 | echo "Can't detect OS architecture, something is very very wrong!"
124 | fi
125 | #display kernel arch
126 | echo "Kernel architecture is: $KARCH"
127 |
128 | echo -e " "
129 |
130 | printf "$(tput bold)\\e[3;4;37mHardware information:\\n\\e[0m$(tput sgr 0)"
131 | #display CPU info
132 | printf "\\e[3;4;37mCPU:\\n\\e[0m"
133 | echo "System on Chip (SOC): $SOC, Revision $SOCREV"
134 | echo "Number of CPU cores is: $CORES"
135 | echo "Processor (CPU) core/s name is: ${CPU:21}"
136 | echo "Processor maximum clock speed is: $CSPEED mhz"
137 | echo "CPU temperature is: $CPUTEMP °C"
138 | #display GPU info
139 | printf "\\e[3;4;37mGPU:\\n\\e[0m"
140 | if [[ "$GPU" != 0 ]]; then
141 | echo "GPU model is: $GPU"
142 | fi
143 | if [[ "$GPUSPEED" != 0 ]]; then
144 | echo "Current GPU clock speed is: $GPUSPEED mhz"
145 | fi
146 | #display memory info
147 | if [[ "$GPUMEM" != 0 ]]; then
148 | echo "GPU memory is: ${GPUMEM:4}"
149 | fi
150 | echo "Memory (RAM) size is $MEM mb"
151 | echo "amount of free Memory: $FREEMEM"
152 | echo "Display resolution and refresh rate: $DRES"
153 |
154 | echo " "
155 |
156 | printf "$(tput bold)\\e[3;4;37mSoftware information:\\n\\e[0m$(tput sgr 0)"
157 | printf "\\e[3;4;37mOperating system:\\n\\e[0m"
158 | #display OS
159 | echo "OS name is: $OS"
160 | if [[ "$TWISTER" == 1 ]]; then
161 | TWISTVER="`twistver | cut -c20-24`"
162 | echo "OS mod is: TwisterOS version $TWISTVER"
163 | fi
164 | printf "\\e[3;4;37mKernel:\\n\\e[0m"
165 | #display kernel
166 | echo "Kernel: $KERNEL, release: $KRELEASE"
167 |
168 | echo " "
169 | #display DE
170 | if [[ $DE == *"xfce"* ]]; then
171 | echo "Desktop Environment is: XFCE"
172 | elif [[ $DE == *"LXDE"* ]]; then
173 | echo "Desktop Environment is: LXDE"
174 | elif [[ $DE == *"gnome"* ]]; then
175 | echo "Desktop Environment is: GNOME"
176 | else
177 | echo "Unknown Desktop Environment!"
178 | fi
179 |
180 | echo -e "----------------------------"
181 |
182 | #display "press any key to exit"
183 | echo -e "$(tput setaf 6)you can scroll up and down using the mouse or scrollbar (if present).$(tput sgr 0)"
184 | read -n 1 -s -r -p "Press any key to exit"
185 | echo -e "\n"
186 |
--------------------------------------------------------------------------------
/systools.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error() {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | function error-sleep() {
8 | echo -e "\e[91m$1\e[39m"
9 | echo "press [CTRL+C] to exit."
10 | sleep $2
11 | }
12 |
13 | echo "this script will help you execute system maintenance tasks"
14 | PS3='Please enter the number above for task you would like to perform (1 - 6): '
15 | options=("autoremove" "autoclean" "fix broken install" "clear swap" "fix duplicates in sources.list" "back to main menu")
16 | select opt in "${options[@]}"
17 | do
18 | case $opt in
19 |
20 |
21 | "autoremove")
22 |
23 | sudo apt autoremove -y || error-sleep "error occured!" 10
24 |
25 | break
26 | ;;
27 |
28 |
29 | "autoclean")
30 |
31 | sudo apt autoclean || error-sleep "error occured!" 10
32 | sudo apt clean || error "error occured!"
33 |
34 | break
35 | ;;
36 |
37 |
38 |
39 |
40 | "fix broken install")
41 |
42 | sudo apt -f install || error-sleep "error occured!" 10
43 | sudo dpkg --configure -a || error "error occured!"
44 |
45 | break
46 | ;;
47 |
48 |
49 |
50 | "clear swap")
51 |
52 | while true; do
53 | echo -e "$(tput setaf 3)$(tput bold)WARNING: clearing swap isn't recommended!$(tput sgr 0)"
54 | read -p "Do you want to continue? [y/n]" answer
55 | if [[ "$answer" == "y" ]]; then
56 | echo "clearing swap..."
57 | echo -ne '(0%)[## ](100%)\r'
58 | sleep 0.1
59 | echo -ne '(0%)[###### ](100%)\r'
60 | sudo systemctl restart dphys-swapfile || error-sleep "Failed to clear swap!" 10
61 | sleep 0.1
62 | echo -ne '(0%)[############### ](100%)\r'
63 | sleep 0.3
64 | echo -ne '(0%)[######################## ](100%)\r'
65 | sleep 0.1
66 | echo -ne '(0%)[##########################](100%)\r'
67 | sleep 0.8
68 | clear -x
69 | echo -e "$(tput bold)DONE!$(tput sgr 0)"
70 | break
71 | elif [[ "$answer" == "n" ]]; then
72 | #echo "$DIRECTORY/main.sh --no-internet"
73 | break
74 | else
75 | echo "invalid option '$answer'."
76 | fi
77 | done
78 |
79 | break
80 | ;;
81 |
82 | "fix duplicates in sources.list")
83 |
84 | while true; do
85 | echo -e "$(tput setaf 3)$(tput bold)WARNING: this option is experimental and isn't recommended! if your sources.list\ngets messed up because of this script, you can delete it\nand replace it with the backup this script creates at '/etc/apt/sources.list.bak'.$(tput sgr 0)"
86 | read -p "Do you want to continue? [y/n]" answer
87 | if [[ "$answer" == "y" ]]; then
88 | echo "deleting duplicates in '/etc/apt/sources.list'..."
89 | echo -ne '(0%)[# ](100%)\r'
90 | sudo rm -f ~/sources.list /etc/apt/sources.list.bak
91 | sleep 0.3
92 | #the part that actually deletes the dupicates
93 | awk '/^$/ {print; next} {if ($1 in a) next; a[$1]=$0; print}' /etc/apt/sources.list > ~/sources.list
94 | echo -ne '(0%)[######### ](100%)\r'
95 | sleep 0.2
96 | sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
97 | echo -ne '(0%)[################### ](100%)\r'
98 | sleep 0.1
99 | sudo mv ~/sources.list /etc/apt/sources.list
100 | echo -ne '(0%)[######################## ](100%)\r'
101 | sleep 0.1
102 | echo -ne '(0%)[######################### ](100%)\r'
103 | sleep 0.1
104 | echo -ne '(0%)[##########################](100%)\r'
105 | sleep 0.7
106 | echo -e "\n\n$(tput bold)DONE!$(tput sgr 0)"
107 | echo "there is a backup of your previous sources.list in $(tput bold)/etc/apt/sources.list.bak$(tput sgr 0)"
108 | sleep 10
109 | break
110 | elif [[ "$answer" == "n" ]]; then
111 | sleep 0.001
112 | break
113 | else
114 | echo "invalid option '$answer'."
115 | fi
116 | done
117 |
118 | break
119 | ;;
120 |
121 | "back to main menu")
122 |
123 | sleep 0.0001
124 |
125 | break
126 | ;;
127 |
128 |
129 |
130 | *) echo "invalid option $REPLY";;
131 | esac
132 | done
133 |
--------------------------------------------------------------------------------
/templates/category-template.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | echo "this script will help you do something"
8 | PS3='Please enter the number above for operation you would like to perform (1 - 5): '
9 | options=("operation 1" "operation 2" "operation 3" "operation 4" "operation 5")
10 | select opt in "${options[@]}"
11 | do
12 | case $opt in
13 |
14 |
15 | "operation 1")
16 |
17 | echo "you selected option 1" || error "Failed to do something!"
18 | break
19 | ;;
20 |
21 |
22 | "operation 2")
23 |
24 | echo "you selected option 2" || error "Failed to do something!"
25 | break
26 | ;;
27 |
28 |
29 |
30 |
31 | "operation 3")
32 |
33 | echo "you selected option 3" || error "Failed to do something!"
34 | break
35 | ;;
36 |
37 |
38 |
39 | "operation 4")
40 |
41 | echo "you selected option 4" || error "Failed to do something!"
42 | break
43 | ;;
44 |
45 | "operation 5")
46 |
47 | echo "you selected option 5" || error "Failed to do something!"
48 |
49 | break
50 | ;;
51 |
52 |
53 |
54 |
55 | *) echo "invalid option $REPLY";;
56 | esac
57 | done
58 |
--------------------------------------------------------------------------------
/templates/dialog-template.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | #variables
5 | DIRECTORY=~/Pi-Assistant
6 | APPS=~/Pi-Assistant/apps
7 |
8 | cd $DIRECTORY
9 | #variables containing the command for each option
10 | update=./update.sh
11 | passwd=./change-password.sh
12 | apps=cd $APPS; ./app-installer.sh
13 | systools=./apt-tools.sh
14 | other=./other.sh
15 |
16 | #dialog variables
17 | HEIGHT=15
18 | WIDTH=40
19 | CHOICE_HEIGHT=5
20 | BACKTITLE="Pi-Assistant v1.2-beta 1. author: Itai Nelken."
21 | TITLE="Main Menu"
22 | MENU="Choose one of the following options:"
23 |
24 | OPTIONS=(1 "Update"
25 | 2 "Change password"
26 | 3 "Application installer"
27 | 4 "System tools"
28 | 5 "Other")
29 |
30 | CHOICE=$(dialog --clear \
31 | --backtitle "$BACKTITLE" \
32 | --title "$TITLE" \
33 | --menu "$MENU" \
34 | $HEIGHT $WIDTH $CHOICE_HEIGHT \
35 | "${OPTIONS[@]}" \
36 | 2>&1 >/dev/tty)
37 |
38 | clear
39 | case $CHOICE in
40 | 1)
41 | $update
42 | ;;
43 | 2)
44 | $passwd
45 | ;;
46 | 3)
47 | $apps
48 | ;;
49 | 4)
50 | $systools
51 | ;;
52 | 5)
53 | $other
54 | ;;
55 | esac
56 |
--------------------------------------------------------------------------------
/templates/yad-test-2.sh:
--------------------------------------------------------------------------------
1 | yad --timeout=15 --timeout-indicator=top --button=cancel:1 --on-top --center --title="installing snap-store" --text="to complete installation you need to reboot. you can always reboot later."
2 |
3 | button=$?
4 |
5 | if [[ $button -eq 1 ]]; then
6 | echo "won't reboot. please reboot later"
7 | else
8 | echo "sudo reboot"
9 | fi
10 |
--------------------------------------------------------------------------------
/templates/yad-test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | yad --width=300 --height=60 --button=cancel:0 --button=continue:1 --title "example" --text="example text, click continue to see what comes next" --center
3 |
4 | button=$?
5 |
6 |
7 | if [[ $button -eq 1 ]]; then
8 | yad --width=300 --button=exit:0 --title "example ended" --text="test" --on-top
9 |
10 | elif [[ $button -eq 0 ]]; then
11 | exit
12 | fi
--------------------------------------------------------------------------------
/test.txt:
--------------------------------------------------------------------------------
1 | test file for test commits to test certain features.
2 | this test commit is for testing the new and improved updater.
3 | testing updater again
4 | I think I fixed it!
5 | now I really fixed it! the error was that the $DIRECTORY variable was defind after it was needed.
6 | and I needed to fix some typos in the code.
7 | stupid updater
8 | I finally fixed the updater, for real this time and I really mean it!
9 | I'm now improving the look and feel of the updaters output.
10 | testing updater really exits fix.
11 | it works!
12 | it doesn't exit for some reason.
13 | I found out why the updater doesn't exit everything: https://unix.stackexchange.com/questions/632890/how-to-pass-variables-between-2-bash-scripts-export-doesnt-work
14 | Pi-Assistant is finally in a stage that I would call it almost stable!
15 | testing the manual updater.
16 |
--------------------------------------------------------------------------------
/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | bold=$(tput bold)
4 | normal=$(tput sgr0)
5 |
6 | sudo rm /usr/local/bin/piassist
7 | sudo rm -f ~/Desktop/piassist.desktop || error "failed to remove desktop shortcut!"
8 | sudo rm -f ~/.local/share/applications/piassist.desktop || error "failed to remove menu button!"
9 |
10 | read -p "Do you want to uninstall the dependencies (dialog, yad) (y/n)?" choice
11 | case "$choice" in
12 | y|Y ) sudo apt purge dialog yad -y;;
13 | n|N ) echo "dependencies (dialog, yad) won't be removed."; sleep 2;;
14 | * ) echo "invalid";;
15 | esac
16 |
17 | rm -rf ~/Pi-Assistant || error "failed to remove Pi-Assistant folder!"
18 | echo -e "${bold}Pi-Assistant removed:(${normal}"
19 | echo -e "${bold}if Pi-Assistant didn't work for you${normal} \033[33;5;7mPLEASE\033[0m ${bold}submit a bug report here:${normal}"
20 | echo -e "\e[96mhttps://github.com/Itai-Nelken/Pi-Assistant/issues/new\e[39m"
21 | read -n 1 -s -r -p "Press any key to exit">/dev/null
--------------------------------------------------------------------------------
/update.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #variables
4 | DIRECTORY="$HOME/Pi-Assistant"
5 | APPS="$HOME/Pi-Assistant/apps"
6 |
7 | function error {
8 | echo -e "\\e[91m$1\\e[39m"
9 | }
10 |
11 | sudo apt update --fix-missing || error "failed to update repos!"
12 | sudo apt upgrade -y || error "error occured are you connected to the internet?"
13 | echo -en && sudo apt install -f && sudo dpkg --configure -a
14 | sudo apt autoremove -y
15 | sleep 2
16 | clear
17 |
18 | if [ ! -f /usr/bin/snap ];then
19 | sleep 0.001
20 | else
21 | echo "updating snap-store and snap core"
22 | sudo snap refresh snap-store || error "Failed to update snap-store!"
23 | sudo snap refresh core || error "Failed to update snap core!"
24 | fi
25 |
26 | sleep 1
27 | clear
28 | echo "system updated"
29 | sleep 2
30 | clear
--------------------------------------------------------------------------------
/updater.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function error() {
4 | echo -e "\e[91m$1\e[39m"
5 | }
6 |
7 | DIRECTORY="$HOME/Pi-Assistant"
8 | APPS="$HOME/Pi-Assistant/apps"
9 |
10 | #update function with ask to exit
11 | function update() {
12 | echo "Checking for updates..."
13 | cd $DIRECTORY
14 | localhash="$(git rev-parse HEAD)"
15 | latesthash="$(git ls-remote https://github.com/Itai-Nelken/Pi-Assistant HEAD | awk '{print $1}')"
16 | if [ "$localhash" != "$latesthash" ] && [ ! -z "$latesthash" ] && [ ! -z "$localhash" ];then
17 | echo "Out of date, updating now..."
18 | git clean -fd
19 | git reset --hard
20 | git pull https://github.com/Itai-Nelken/Pi-Assistant.git HEAD || error 'Unable to update, please check your internet connection!'
21 | make-all-executable || error "Unable to mark all scripts as executables! Pi-Assistant won't work properly! please report this error."
22 | refresh-shortcuts || error "Failed to refresh menu and desktop shortcuts!"
23 | export exit=1
24 | ask-exit
25 | else
26 | echo "Up to date."
27 | fi
28 | }
29 |
30 | #update function without ask to exit
31 | function update-no-ask-exit() {
32 | echo "Checking for updates..."
33 | cd $DIRECTORY
34 | localhash="$(git rev-parse HEAD)"
35 | latesthash="$(git ls-remote https://github.com/Itai-Nelken/Pi-Assistant HEAD | awk '{print $1}')"
36 | if [ "$localhash" != "$latesthash" ] && [ ! -z "$latesthash" ] && [ ! -z "$localhash" ];then
37 | echo "Out of date, updating now..."
38 | git clean -fd
39 | git reset --hard
40 | git pull https://github.com/Itai-Nelken/Pi-Assistant.git HEAD || error 'Unable to update, please check your internet connection!'
41 | make-all-executable || error "Unable to mark all scripts as executables! Pi-Assistant won't work properly! please report this error."
42 | refresh-shortcuts || error "Failed to refresh menu and desktop shortcuts!"
43 | else
44 | echo "Up to date."
45 | fi
46 | }
47 |
48 | #update function with no extra output
49 | function update-no-output() {
50 | cd $DIRECTORY
51 | localhash="$(git rev-parse HEAD)"
52 | latesthash="$(git ls-remote https://github.com/Itai-Nelken/Pi-Assistant HEAD | awk '{print $1}')"
53 | if [ "$localhash" != "$latesthash" ] && [ ! -z "$latesthash" ] && [ ! -z "$localhash" ];then
54 | git clean -fd
55 | git reset --hard
56 | git pull https://github.com/Itai-Nelken/Pi-Assistant.git HEAD || error 'Unable to update, please check your internet connection'
57 | make-all-executable || error "Unable to mark all scripts as executables! Pi-Assistant won't work properly! please report this error."
58 | refresh-shortcuts || error "Failed to refresh menu and desktop shortcuts!"
59 | export exit=1
60 | ask-exit
61 | fi
62 | }
63 |
64 | #update function with no extra output or ask to exit
65 | function update-no-output-ask-exit() {
66 | cd $DIRECTORY
67 | localhash="$(git rev-parse HEAD)"
68 | latesthash="$(git ls-remote https://github.com/Itai-Nelken/Pi-Assistant HEAD | awk '{print $1}')"
69 | if [ "$localhash" != "$latesthash" ] && [ ! -z "$latesthash" ] && [ ! -z "$localhash" ];then
70 | git clean -fd
71 | git reset --hard
72 | git pull https://github.com/Itai-Nelken/Pi-Assistant.git HEAD || error 'Unable to update, please check your internet connection'
73 | make-all-executable || error "Unable to mark all scripts as executables! Pi-Assistant won't work properly! please report this error."
74 | refresh-shortcuts || error "Failed to refresh menu and desktop shortcuts!"
75 | fi
76 | }
77 |
78 | #make all scripts executable function
79 | function make-all-executable() {
80 | sudo chmod +x main.sh
81 | sudo chmod +x passwd.sh
82 | sudo chmod +x systools.sh
83 | sudo chmod +x other.sh
84 | sudo chmod +x install.sh
85 | sudo chmod +x update.sh
86 | sudo chmod +x updater.sh
87 | sudo chmod +x uninstall.sh
88 | sudo chmod +x sys-info.sh
89 | sudo chmod +x apps/appinstaller.sh
90 | sudo chmod +x apps/gparted.sh
91 | sudo chmod +x apps/chromium.sh
92 | sudo chmod +x apps/firefox.sh
93 | sudo chmod +x apps/blender.sh
94 | sudo chmod +x apps/audacity.sh
95 | sudo chmod +x apps/inkscape.sh
96 | sudo chmod +x apps/snap.sh
97 | sudo chmod +x apps/ssr.sh
98 | sudo chmod +x apps/kdenlive.sh
99 | sudo chmod +x apps/gsysmon.sh
100 | sudo chmod +x apps/flatpak.sh
101 | sudo chmod +x apps/etcher.sh
102 | sudo chmod +x apps/zoom.sh
103 | sudo chmod +x apps/box86.sh
104 | sudo chmod +x apps/flowblade.sh
105 | }
106 |
107 | #refresh menu and desktop shortcuts function
108 | function refresh-shortcuts() {
109 | rm ~/.local/share/applications/piassist.desktop
110 | rm ~/Desktop/piassist.desktop
111 |
112 | #update menu shortcut
113 | echo "[Desktop Entry]
114 | StartupNotify=true
115 | Terminal=true
116 | Type=Application
117 | Name=Pi-Assistant
118 | Exec="$HOME/Pi-Assistant/main.sh"
119 | Icon="$HOME/Pi-Assistant/icons/64x64/logo-64.png"
120 | Categories=Utility;
121 | Comment="Pi-Assistant v1.3.0"" > ~/.local/share/applications/piassist.desktop
122 | cp ~/.local/share/applications/piassist.desktop ~/Desktop/piassist.desktop
123 | sudo chmod +x ~/Desktop/piassist.desktop
124 |
125 | sudo rm /usr/local/bin/piassist
126 | #update startup from terminal using 'piassist'
127 | echo '#!/bin/bash
128 | cd ~/Pi-Assistant
129 | #flags
130 | if [[ $1 = "--version" ]] || [[ $1 == "-v" ]]; then
131 | ./main.sh --version
132 | elif [[ $1 = "--secret" ]]; then
133 | ./main.sh --secret
134 | elif [[ $1 = "--no-internet" ]] || [[ $1 == "-ni" ]]; then
135 | ./main.sh --no-internet
136 | elif [[ $1 = "--help" ]] || [[ $1 == "-h" ]]; then
137 | ./main.sh --help
138 | elif [[ $1 = "--no-update" ]] || [[ $1 == "-nu" ]]; then
139 | ./main.sh --no-update
140 | else
141 | clear && $HOME/Pi-Assistant/main.sh
142 | fi' > ~/Downloads/piassist
143 | sudo mv ~/Downloads/piassist /usr/local/bin/
144 | sudo chmod +x /usr/local/bin/piassist
145 | }
146 |
147 | #ask to restart Pi-Assistant to apply update, press enter to exit function.
148 | function ask-exit() {
149 | echo ' '
150 | echo -e "$(tput setaf 6)You have to restart Pi-Assistant to apply the Update.$(tput sgr 0)"
151 | read -p "press [ENTER] to exit."
152 | exit
153 | }
154 |
155 | # flags. default is to update with extra output and ask to exit.
156 | if [[ "$1" == "--no-output" ]]; then
157 | update-no-output
158 | elif [[ "$1" == "--no-ask-exit-output" ]]; then
159 | update-no-output-ask-exit
160 | elif [[ "$1" == "--output-no-ask-exit" ]]; then
161 | update-no-ask-exit
162 | elif [[ "$1" == "--all-executable" ]]; then
163 | make-all-executable
164 | else
165 | update
166 | fi
167 |
168 |
169 | #echo "$(tput setaf 3)finished...$(tput sgr 0)"
170 |
--------------------------------------------------------------------------------