22# -*- coding: UTF-8 -*-
33# # Helper script to streamline gtk/gnome-shell communitheme build and install
44# # 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)
65# # -d, --dotfiles <path> path to dotfiles folders [default: ~/dotfiles]
6+ # # -p, --project <path> path yaru folders [default: ~/workspace/yaru]
77
88# GENERATED_CODE: start
99# Default values
1010_dotfiles=~ /dotfiles
11-
12- # No-arguments is not allowed
13- [ $# -eq 0 ] && sed -ne ' s/^## \(.*\)/\1/p' $0 && exit 1
11+ _project=~ /workspace/yaru
1412
1513# Converting long-options into short ones
1614for arg in " $@ " ; do
1715 shift
1816 case " $arg " in
19- " --project" ) set -- " $@ " " -p" ;;
2017" --dotfiles" ) set -- " $@ " " -d" ;;
18+ " --project" ) set -- " $@ " " -p" ;;
2119 * ) set -- " $@ " " $arg "
2220 esac
2321done
@@ -27,12 +25,12 @@ function print_illegal() {
2725}
2826
2927# Parsing flags and arguments
30- while getopts ' hp:d :' OPT; do
28+ while getopts ' hd:p :' OPT; do
3129 case $OPT in
3230 h) sed -ne ' s/^## \(.*\)/\1/p' $0
3331 exit 1 ;;
34- p) _project=$OPTARG ;;
3532 d) _dotfiles=$OPTARG ;;
33+ p) _project=$OPTARG ;;
3634 \? ) print_illegal $@ >&2 ;
3735 echo " ---"
3836 sed -ne ' s/^## \(.*\)/\1/p' $0
@@ -42,8 +40,8 @@ while getopts 'hp:d:' OPT; do
4240done
4341# GENERATED_CODE: end
4442
43+
4544_cmd=" $_dotfiles /vim/vim/snippets/communitheme.py"
4645
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