-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 changed file
with
91 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/usr/bin/env bash | ||
|
||
version="0.8.3" | ||
envdir="osenv" | ||
|
||
if [ -d $envdir ]; then | ||
read -p "The $envdir directory already exists, remove it? [y|n]" -n 1 -s remove | ||
echo | ||
if [ $remove = "y" ]; then | ||
rm -rf $envdir | ||
else | ||
echo "Activate the virtualenv and execute outspline:" | ||
echo " $ cd $envdir" | ||
echo " $ ./bin/activate" | ||
echo " $ ./bin/outspline --config ./outspline.conf" | ||
echo | ||
echo "Deactivate the virtualenv when done:" | ||
echo " $ deactivate" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
if ! python2 -c "import wx" &> /dev/null; then | ||
echo "Install wxPython for this distribution." | ||
echo "For example on Ubuntu:" | ||
echo " # apt-get install python-wxgtk3.0" | ||
echo | ||
echo "Or on Arch:" | ||
echo " # pacman -S wxpython" | ||
exit 1 | ||
fi | ||
|
||
if command -v pacman &> /dev/null; then | ||
# Arch | ||
if ! pacman -Q python2-gobject &> /dev/null; then | ||
echo "Install python2-gobject to support notifications:" | ||
echo " # pacman -S python2-gobject" | ||
read -p "Continue without notifications? [y|n]" -n 1 -s cont | ||
echo | ||
if [ $cont != "y" ]; then | ||
exit 1 | ||
fi | ||
fi | ||
elif command -v dpkg &> /dev/null; then | ||
# Ubuntu | ||
if ! dpkg -s python-gobject &> /dev/null; then | ||
echo "Install python-gobject to support notifications:" | ||
echo " # apt-get install python-gobject" | ||
read -p "Continue without notifications? [y|n]" -n 1 -s cont | ||
echo | ||
if [ $cont != "y" ]; then | ||
exit 1 | ||
fi | ||
fi | ||
fi | ||
|
||
if command -v virtualenv2 &> /dev/null; then | ||
# Arch | ||
virtualenv2 --system-site-packages $envdir | ||
else | ||
# Ubuntu | ||
virtualenv --system-site-packages $envdir | ||
fi | ||
|
||
cd $envdir | ||
source ./bin/activate | ||
|
||
package="http://downloads.sourceforge.net/project/outspline/main/outspline-$version.tar.bz2" | ||
|
||
if command -v curl &> /dev/null; then | ||
# Arch | ||
curl -LO $package | ||
else | ||
# Ubuntu... | ||
wget $package | ||
fi | ||
|
||
tar xjf "outspline-$version.tar.bz2" | ||
cd "outspline-$version" | ||
../bin/python setup.py install --optimize=1 | ||
cd .. | ||
|
||
# On the main system the icon cache may have to be refreshed | ||
#gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor | ||
|
||
# Also, without root rights, icons can't be installed in /usr/share/icons, | ||
# therefore e.g. the tray icon doesn't appear | ||
|
||
./bin/outspline --config ./outspline.conf | ||
|
||
deactivate |