Skip to content

Commit 7cbe85f

Browse files
authored
Merge branch 'main' into main
2 parents 6a8bfdc + 2880715 commit 7cbe85f

6 files changed

+132
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ scripts/installer.iss
2121
Glia_cap.py
2222
lazyass_minecraft_script.py
2323
scripts/example_build_app_and_installer.bat
24+
/BabbleApp/venv

BabbleApp/babbleapp.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
winmm = windll.winmm
4444
except OSError:
4545
print(f'\033[91m[{lang._instance.get_string("log.error")}] {lang._instance.get_string("error.winmm")}.\033[0m')
46+
4647
os.system("color") # init ANSI color
4748

4849
# Random environment variable to speed up webcam opening on the MSMF backend.

BabbleApp/camera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def start_serial_connection(self, port):
266266
try:
267267
rate = 115200 if sys.platform == "darwin" else 3000000 # Higher baud rate not working on macOS
268268
conn = serial.Serial(baudrate=rate, port=port, xonxoff=False, dsrdtr=False, rtscts=False)
269-
# Set explicit buffer size for serial.
269+
# Set explicit buffer size for serial. This function is Windows only!
270270
if is_nt:
271271
conn.set_buffer_size(rx_size=BUFFER_SIZE, tx_size=BUFFER_SIZE)
272272

README.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,48 @@ By defualt Project Babble is under a non-commerical license! Please contact us a
2323
### Windows
2424
Head to the releases section and [download the latest installer](https://github.com/Project-Babble/ProjectBabble/releases/latest).
2525

26-
### Linux
27-
Install `git`, `curl` and a version of `python` greater than `3.8` for your distro.
26+
### MacOS and Linux
27+
Install `git`, `curl` and a version of `python` (between `3.8` and `3.12`) for your distro.
2828

2929
Then, copy paste and run the following script into the terminal of your choice:
3030

31+
#### For the latest commit:
32+
33+
```bash
34+
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/e1bce63cd6be1e8645c3b3adfd5b71a6/raw/26561da3b2bcf738f580176229e4853c18ddf554/project-babble-installer-latest.sh)"
35+
```
36+
37+
#### For the latest tagged release:
38+
3139
```bash
32-
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/a92a3caae24c1bfab1c7544537a654c5/raw/fc30aa550c3c7aa83c37a72168e75ef92388e39b/project-babble-install.sh)"
40+
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/a92a3caae24c1bfab1c7544537a654c5/raw/63573d5c882b4152c9434b9dd4bc888573fe9e98/project-babble-installer-tagged.sh)"
3341
```
3442

3543
Once it's finished installing, you can update and run the Babble app by typing `babble-app` into your terminal.
3644

3745
*You should also be able to run the Windows executable through Wine!*
3846

39-
#### Notes:
47+
#### Notes on Linux:
48+
49+
##### KDE Plasma
50+
51+
If your GUI window shows just the top row of radio buttons, set a resolution for the Babble App manually in KDE's Window Settings. 800x600y is a good starting point with plenty of empty space.
52+
53+
---
54+
55+
##### v4l2/v4l-linux
56+
4057
If you receive a `["Error listing UVC devices on Linux ... No such file or directory"]` when choosing/changing your camera, you'll need to install video4linux (`v4l-utils`) for your distro.
4158

4259
For Ubuntu or other distros with apt:
4360
```bash
4461
sudo apt-get install v4l-utils
4562
```
4663

64+
---
65+
66+
##### tkinter
67+
4768
If you receive a `ModuleNotFoundError: No module named 'tkinter'` error message on run, you'll need to install `tkinter` for your distro.
4869

4970
For Ubuntu or other distros with apt:
@@ -57,6 +78,12 @@ sudo dnf install python3-tkinter
5778

5879
You can read more about this [here](https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter).
5980

81+
---
82+
83+
##### udev
84+
85+
If you have trouble connecting to your Babble Board (IE being denied permission to access it), you will need to set up and configure [udev](https://docs.platformio.org/en/latest/core/installation/udev-rules.html) rules.
86+
6087
## Usage
6188
We have integrations for [VRChat](https://docs.babble.diy/docs/software/integrations/vrc), [Resonite](https://docs.babble.diy/docs/software/integrations/resonite) and [ChilloutVR](https://docs.babble.diy/docs/software/integrations/chilloutVR)!
6289

babbleapp-installer-latest.sh

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
3+
# Check if running on a supported operating system
4+
if [[ "$OSTYPE" != "linux-gnu"* ]] && [[ "$OSTYPE" != "darwin"* ]]; then
5+
echo "Error: This script is only compatible with Linux and macOS operating systems."
6+
exit 1
7+
fi
8+
9+
# Check Python version
10+
if ! command -v python3 &> /dev/null; then
11+
echo "Error: Python is not installed. Please install Python 3.8 or higher."
12+
exit 1
13+
fi
14+
15+
python_version_major=$(python3 -c 'import platform; print(platform.python_version_tuple()[0])')
16+
python_version_minor=$(python3 -c 'import platform; print(platform.python_version_tuple()[1])')
17+
if (( python_version_major < 3 || python_version_minor < 8 )); then
18+
echo "Error: Your Python version is too low! Please install 3.8 or higher."
19+
exit 1
20+
fi
21+
22+
install_dir="$HOME/.local/share/project-babble"
23+
bin_dir="$HOME/.local/bin"
24+
25+
# Create installation directory if it doesn't exist
26+
mkdir -p "$install_dir"
27+
28+
# Function to install requirements
29+
install_requirements() {
30+
cd "$install_dir"
31+
cd BabbleApp
32+
echo "Installing requirements..."
33+
# Create a temporary requirements file without the Windows-only package
34+
grep -v "onnxruntime-directml" requirements.txt > unix_requirements.txt
35+
pip install -r unix_requirements.txt --quiet
36+
rm unix_requirements.txt
37+
}
38+
39+
# Function to get the latest commit hash
40+
get_latest_commit() {
41+
git fetch origin main
42+
git rev-parse origin/main
43+
}
44+
45+
# Function to get the current commit hash
46+
get_current_commit() {
47+
git rev-parse HEAD
48+
}
49+
50+
# Function to update the repository
51+
update_repo() {
52+
echo "Checking for updates..."
53+
git fetch origin main
54+
local_commit=$(get_current_commit)
55+
remote_commit=$(get_latest_commit)
56+
57+
if [ "$local_commit" != "$remote_commit" ]; then
58+
echo "New version available"
59+
echo "Current commit: ${local_commit:0:8}"
60+
echo "Latest commit: ${remote_commit:0:8}"
61+
echo "Updating to the latest version..."
62+
git checkout main
63+
git pull origin main
64+
echo "Updating dependencies..."
65+
source venv/bin/activate
66+
install_requirements
67+
deactivate
68+
echo "Project Babble has been updated successfully to commit ${remote_commit:0:8}!"
69+
else
70+
echo "Project Babble is already at the latest commit: ${local_commit:0:8}"
71+
fi
72+
}
73+
74+
# Ensure we're in the correct directory
75+
cd "$install_dir"
76+
cd BabbleApp
77+
78+
# Create venv if it does not exist
79+
if ! [ -d "venv" ]; then
80+
python3 -m venv venv
81+
fi
82+
83+
# Use the correct activation script based on OS
84+
source venv/bin/activate
85+
update_repo
86+
echo "Verifying dependencies. This might take a second!"
87+
install_requirements
88+
echo "Starting Babble app..."
89+
python3 babbleapp.py

babbleapp.sh babbleapp-installer-tagged.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
# Check if running on Linux
4-
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
5-
echo "Error: This script is only compatible with Linux operating systems."
3+
# Check if running on a supported operating system
4+
if [[ "$OSTYPE" != "linux-gnu"* ]] && [[ "$OSTYPE" != "darwin"* ]]; then
5+
echo "Error: This script is only compatible with Linux and macOS operating systems."
66
exit 1
77
fi
88

@@ -19,12 +19,15 @@ if (( python_version_major < 3 || python_version_minor < 8 )); then
1919
exit 1
2020
fi
2121

22-
# Set installation directory
2322
install_dir="$HOME/.local/share/project-babble"
23+
bin_dir="$HOME/.local/bin"
24+
25+
# Create installation directory if it doesn't exist
26+
mkdir -p "$install_dir"
2427

2528
# Function to install requirements
2629
install_requirements() {
27-
cd $install_dir
30+
cd "$install_dir"
2831
cd BabbleApp
2932
echo "Installing requirements..."
3033
# Create a temporary requirements file without the Windows-only package
@@ -62,7 +65,7 @@ update_repo() {
6265
}
6366

6467

65-
cd $install_dir
68+
cd "$install_dir"
6669
cd BabbleApp
6770

6871
# Create venv if it does not exists

0 commit comments

Comments
 (0)