-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[Unit] | ||
Description=Google Assistant-Voice | ||
Wants=network-online.target | ||
After=network-online.target | ||
|
||
[Service] | ||
Environment=VIRTUAL_ENV=/home/__USER__/env | ||
Environment=PATH=/home/__USER__/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ExecStart=/home/pi/env/bin/python -u /home/pi/googlesamples-assistant-hotword --project-id 'projectid' --device-model-id 'modelid' [--nickname SmartDisplayPi] | ||
|
||
WorkingDirectory=/home/__USER__/ | ||
StandardOutput=inherit | ||
StandardError=inherit | ||
Restart=always | ||
User=__USER__ | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
echo "Visit https://developers.google.com/assistant/sdk/guides/library/python/embed/config-dev-project-and-account" | ||
echo "If you need help setting up your Google Assistant SDK credentials." | ||
echo "This is designed for ARM v7 devices (If you have a Raspberry Pi 4, try using GassistPi.)" | ||
echo "" | ||
read -r -p "Please include your credential file with the .json file." configfile | ||
echo "" | ||
read -r -p "Enter your project id from Google Cloud Console." projid | ||
echo "" | ||
read -r -p "Enter the modelid from your Actions on Google Console." modelid | ||
sudo apt-get update | ||
sudo apt-get install python3-dev python3-venv portaudio19-dev libffi-dev libssl-dev libmpg123-dev -y | ||
python3 -m venv env | ||
env/bin/python -m pip install --upgrade pip setuptools wheel | ||
source env/bin/activate | ||
python -m pip install --upgrade google-assistant-library==1.0.1 | ||
python -m pip install --upgrade google-assistant-sdk[samples]==0.5.1 | ||
python -m pip install --upgrade google-auth-oauthlib[tool] | ||
google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype \ | ||
--scope https://www.googleapis.com/auth/gcm \ | ||
--save --headless --client-secrets $configfile | ||
echo "We are almost done, hang on tight!" | ||
sed -i 's/modelid/'$modelid'/g' /home/pi/SmartDisplayPi/systemd/assistant.service | ||
sed -i 's/projectid/'$projid'/g' /home/pi/SmartDisplayPi/systemd/assistant.service | ||
sudo mv /home/pi/SmartDisplayPi/assistant.service /lib/systemd/system/assistant.service | ||
sudo systemctl enable assistant.service | ||
sudo systemctl start assistant.service | ||
echo "The script is officially done. You can now reboot if you want." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,5 @@ | ||
#!/bin/bash | ||
xset s noblank | ||
xset s off | ||
xset -dpms | ||
|
||
unclutter -root & | ||
|
||
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences | ||
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences | ||
|
||
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --user-agent="Mozilla/5.0 (SMART-TV; Linux; Tizen 4.0.0.2) AppleWebkit/605.1.15 (KHTML, like Gecko) SamsungBrowser/9.2 TV Safari/605.1.15" --kiosk file:///home/pi/SmartDisplayPi/Web/index2.html& | ||
|
||
while true; do | ||
xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab; | ||
sleep 10 | ||
done | ||
xset s noblank | ||
sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser Default/Preferences | ||
chromium-browser --noerrdialogs --kiosk file:///home/pi/SmartDisplayPi/Web/index2.html --window-size=800,480 --window-position=0,0 |