Boxy SVG now using Boxy-SVG-RPi script

pull/179/head
Botspot 4 years ago
parent 21bd3ac485
commit daa15ccedf

@ -7,72 +7,4 @@ function error {
exit 1
}
if command -v chromium-browser;then
browser="$(command -v chromium-browser)"
elif command -v chromium;then
browser="$(command -v chromium)"
else
error "You must have Chromium Browser installed to use the Boxy SVG Chrome App!"
fi
git clone https://github.com/Botspot/Boxy-SVG-RPi || error "Failed to clone repository!"
cd Boxy-SVG-RPi
unzip ./boxysvgrpi.zip || error "Failed to extract boxysvgrpi.zip!"
if [ -f "$HOME/.config/chromium/Default/Preferences" ];then
pref_file="$HOME/.config/chromium/Default/Preferences"
foundpref=1
elif [ -f "$HOME/snap/chromium/common/chromium/Default/Preferences" ];then
pref_file="$HOME/snap/chromium/common/chromium/Default/Preferences"
foundpref=1
else
foundpref=0
echo "Preferences file not found."
fi
if [ $foundpref == 1 ];then
echo "Enabling Extension Developer Mode in Chromium..."
if [ -z "$(cat "$pref_file" | grep developer_mode)" ];then
sed -i 's/},"first_run_tabs"/,"ui":{"developer_mode":true}},"first_run_tabs"/g' "$pref_file"
else
sed -i 's/"developer_mode":false/"developer_mode":true/g' "$pref_file"
fi
if [ -z "$(cat "$pref_file" | grep 'developer_mode":true')" ];then
foundpref=0
echo "Tried to enable developer mode in chromium but it failed."
fi
fi
if [ $foundpref == 0 ];then
echo "Failed to enable developer mode in chromium's preferences file. Please launch Chromium, go to the chrome://extensions website, and enable Developer Mode manually."
sleep 5
echo -n "Press Enter once you've done this. "
read enter
else
pkill chromium
fi
echo "Now installing Boxy SVG..."
$browser &
sleep 10
$browser --load-and-launch-app=$(pwd)/boxysvgrpi &
if [ -f ~/.local/share/applications/chrome-gaoogdonmngmdlbinmiclicjpbjhgomg-Default.desktop ];then
echo "Categories=Graphics;" > ~/.local/share/applications/chrome-gaoogdonmngmdlbinmiclicjpbjhgomg-Default.desktop
else
echo "Warning: Chromium did not create a menu button for Boxy SVG for some reason."
sleep 3
echo "Forcibly creating the menu button now, but it might not work."
echo "#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Boxy SVG
Exec=$browser --profile-directory=Default --app-id=gaoogdonmngmdlbinmiclicjpbjhgomg
Icon=chrome-gaoogdonmngmdlbinmiclicjpbjhgomg-Default
StartupWMClass=crx_gaoogdonmngmdlbinmiclicjpbjhgomg
Categories=Graphics;" > ~/.local/share/applications/chrome-gaoogdonmngmdlbinmiclicjpbjhgomg-Default.desktop
fi
wget -qO- https://raw.githubusercontent.com/Botspot/Boxy-SVG-RPi/main/install.sh | bash

Loading…
Cancel
Save