-
Notifications
You must be signed in to change notification settings - Fork 1
/
ubuntuIntaller.sh
62 lines (48 loc) · 2.69 KB
/
ubuntuIntaller.sh
1
2
3
4
5
6
7
8
9
10
11
12
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# run this file with sudo sh ubuntuIntegration.sh
# auto-integration (launchers, menus, etc.) under ubuntu with python 2.7
# still some issue with mim-type integration (so .pyslices and .sympyslices files associate and get little icons)
# install wx_py with setuptools; it's fine if this has been run already
sudo python setup.py install
# Make sure the script files are executable
chmod +x ./wx_py/PyCrust.py
chmod +x ./wx_py/PyShell.py
chmod +x ./wx_py/SymPySlices.py
chmod +x ./wx_py/PySlices.py
chmod +x ./wx_py/PySlicesShell.py
chmod +x ./wx_py/SymPySlices.py
# Make any OS directories that don't already exist
sudo mkdir /usr/local
sudo mkdir /usr/local/share
sudo mkdir /usr/local/share/pixmaps
sudo mkdir /usr/local/share/applications
sudo mkdir /usr/local/share/icons
sudo mkdir /usr/local/share/icons/gnome
sudo mkdir /usr/local/share/icons/gnome/scalable
sudo mkdir /usr/local/share/icons/gnome/scalable/mimetypes
sudo mkdir /usr/local/share/mime
sudo mkdir /usr/local/share/mime/packages
# Link executables
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/PyCrust.py /usr/local/bin/pycrust
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/PyCrust.py /usr/local/bin/pyshell
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/PySlices.py /usr/local/bin/pyslices
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/PySlices.py /usr/local/bin/pysliceshell
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/SymPySlices.py /usr/local/bin/sympyslices
# Link icons
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/icons/PyCrust.svg /usr/local/share/pixmaps/PyCrust.svg
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/icons/PySlices.svg /usr/local/share/pixmaps/PySlices.svg
sudo ln -s /usr/local/lib/python2.7/dist-packages/wx_py/icons/SymPySlices.svg /usr/local/share/pixmaps/SymPySlices.svg
# Link the .desktop launchers
sudo cp ./desktop/* > /usr/local/share/applications/
### MIME type integration ###
# Copy the icons
sudo cp /usr/local/lib/python2.7/dist-packages/wx_py/icons/PySlices.svg /usr/local/share/icons/gnome/scalable/mimetypes/application-pyslices.svg
sudo cp /usr/local/lib/python2.7/dist-packages/wx_py/icons/SymPySlices.svg /usr/local/share/icons/gnome/scalable/mimetypes/application-sympyslices.svg
# Copy the .xml MIME data
sudo cp ./mime/* /usr/local/share/mime/packages/
# Try to associate the applications with xgd-mime
xdg-mime default /usr/local/share/applications/PySlices.desktop application/pyslices
xdg-mime default /usr/local/share/applications/SymPySlices.desktop application/sympyslices
# Update the MIME database
sudo update-mime-database /usr/local/share/mime
# Sadly, you still need to manually associate the files in nautilus
# I'm still working on this