2
2
# -*- coding: UTF-8 -*-
3
3
# # Helper script to streamline gtk/gnome-shell communitheme build and install
4
4
# # options:
5
- # # -p, --project <name> either gtk or shell (this is mapped to the folder name, so if you change default folders' names, this won't work anymore)
6
5
# # -d, --dotfiles <path> path to dotfiles folders [default: ~/dotfiles]
6
+ # # -p, --project <path> path yaru folders [default: ~/workspace/yaru]
7
7
8
8
# GENERATED_CODE: start
9
9
# Default values
10
10
_dotfiles=~ /dotfiles
11
-
12
- # No-arguments is not allowed
13
- [ $# -eq 0 ] && sed -ne ' s/^## \(.*\)/\1/p' $0 && exit 1
11
+ _project=~ /workspace/yaru
14
12
15
13
# Converting long-options into short ones
16
14
for arg in " $@ " ; do
17
15
shift
18
16
case " $arg " in
19
- " --project" ) set -- " $@ " " -p" ;;
20
17
" --dotfiles" ) set -- " $@ " " -d" ;;
18
+ " --project" ) set -- " $@ " " -p" ;;
21
19
* ) set -- " $@ " " $arg "
22
20
esac
23
21
done
@@ -27,12 +25,12 @@ function print_illegal() {
27
25
}
28
26
29
27
# Parsing flags and arguments
30
- while getopts ' hp:d :' OPT; do
28
+ while getopts ' hd:p :' OPT; do
31
29
case $OPT in
32
30
h) sed -ne ' s/^## \(.*\)/\1/p' $0
33
31
exit 1 ;;
34
- p) _project=$OPTARG ;;
35
32
d) _dotfiles=$OPTARG ;;
33
+ p) _project=$OPTARG ;;
36
34
\? ) print_illegal $@ >&2 ;
37
35
echo " ---"
38
36
sed -ne ' s/^## \(.*\)/\1/p' $0
@@ -42,8 +40,8 @@ while getopts 'hp:d:' OPT; do
42
40
done
43
41
# GENERATED_CODE: end
44
42
43
+
45
44
_cmd=" $_dotfiles /vim/vim/snippets/communitheme.py"
46
45
47
- set -x
48
- [ " $_project " = " gtk" ] && python " $_cmd " gtk-communitheme && theme-refresh.sh
49
- [ " $_project " = " shell" ] && python " $_cmd " gnome-shell-communitheme && echo " ALT-F2 + rt"
46
+ set -xe
47
+ python " $_cmd " " $_project " && echo " ALT-F2 + rt"
0 commit comments