-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·77 lines (64 loc) · 1.98 KB
/
setup.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#########################################
# FUNCTIONS #
#########################################
cleanup () {
# remove all freecad config folders and files
rm -rf ~/.local/share/FreeCAD
rm -rf ~/.config/FreeCAD
rm -rf ~/.cache/FreeCAD
rm -rf ~/.cache/qtshadercache-x86_64-little_endian-lp64
rm -rf ~/.cache/mesa_shader_cache
rm -rf ~/.cache/qt_compose_cache_little_endian_*
}
setup_freecad () {
# copy included freecad config (user.cfg)
mkdir -p ~/.config/FreeCAD
cp ./config/user.cfg ~/.config/FreeCAD/user.cfg
# copy macro folder from git repo to home folder
mkdir -p ~/.local/share/FreeCAD/Macro
cp -r ./macro/. ~/.local/share/FreeCAD/Macro/
}
addons () {
# install addons
mkdir -p ~/.local/share/FreeCAD/Mod
git clone -q https://github.com/DanMiel/QuickMeasure.git ~/.local/share/FreeCAD/Mod/QuickMeasure && echo "QuickMeasure installed"
git clone -q https://github.com/obelisk79/OpenTheme.git ~/.local/share/FreeCAD/Mod/OpenTheme && echo "OpenTheme installed"
}
usage () {
# help/usage info
echo "Usage: sh setup.sh [ -f ] full howie freecad setup (remove all freecad config files)
[ -d ] default freecad setup (remove all freecad config files)
[ -q ] quick howie freecad setup (do not install addons)
[ -h ] help"
}
#########################################
# MAIN #
#########################################
# navigate to current directory
cd "$(dirname "$(realpath "$0")")" || exit
while getopts 'fdqh' OPTION; do
case "$OPTION" in
f)
cleanup
setup_freecad
addons
echo "FreeCAD howie setup complete"
;;
d)
cleanup
echo "FreeCAD restored to default setup."
;;
q)
cleanup
setup_freecad
echo "FreeCAD quick setup complete (no addons installed)"
;;
h)
usage
;;
?)
usage
;;
esac
done