Skip to content

Commit fa5110c

Browse files
committed
Added new script to build communitheme
1 parent c206389 commit fa5110c

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

communitheme-build.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
# -*- coding: UTF-8 -*-
3+
## Helper script to streamline gtk/gnome-shell communitheme build and install
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+
## -d, --dotfiles <path> path to dotfiles folders [default: ~/dotfiles]
7+
8+
# GENERATED_CODE: start
9+
# Default values
10+
_dotfiles=~/dotfiles
11+
12+
# No-arguments is not allowed
13+
[ $# -eq 0 ] && sed -ne 's/^## \(.*\)/\1/p' $0 && exit 1
14+
15+
# Converting long-options into short ones
16+
for arg in "$@"; do
17+
shift
18+
case "$arg" in
19+
"--project") set -- "$@" "-p";;
20+
"--dotfiles") set -- "$@" "-d";;
21+
*) set -- "$@" "$arg"
22+
esac
23+
done
24+
25+
function print_illegal() {
26+
echo Unexpected flag in command line \"$@\"
27+
}
28+
29+
# Parsing flags and arguments
30+
while getopts 'hp:d:' OPT; do
31+
case $OPT in
32+
h) sed -ne 's/^## \(.*\)/\1/p' $0
33+
exit 1 ;;
34+
p) _project=$OPTARG ;;
35+
d) _dotfiles=$OPTARG ;;
36+
\?) print_illegal $@ >&2;
37+
echo "---"
38+
sed -ne 's/^## \(.*\)/\1/p' $0
39+
exit 1
40+
;;
41+
esac
42+
done
43+
# GENERATED_CODE: end
44+
45+
_cmd="$_dotfiles/vim/vim/snippets/communitheme.py"
46+
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"

0 commit comments

Comments
 (0)