forked from andreykaere/ixwindow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·74 lines (55 loc) · 1.18 KB
/
install
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
#!/bin/bash
usage () {
printf "%s" "\
USAGE:
install [OPTIONS] [ARGS]
ARGS:
<WM>
Window managers, for which you want to install files.
OPTIONS:
-h, --help
Show this message.
--prefix
Used for specifying installation directory.
--clean
When specified, this script cleans directory specified in '--prefix'
option.
"
exit 1
}
init_config_file () {
mkdir --parents "$XDG_CONFIG_HOME/ixwindow"
cp "examples/ixwindow.toml" "$XDG_CONFIG_HOME/ixwindow/ixwindow.toml"
}
install () {
if [ "$CLEAN" -eq 1 ]; then
rm -r "$PREFIX"
fi
# Remove ixwindow file from previous installation
rm -r "$PREFIX/ixwindow" 2> /dev/null
cargo build --release
mkdir -p "$PREFIX"
cp -r target/release/ixwindow "$PREFIX"
}
CLEAN=0
PREFIX="$HOME/.config/polybar/scripts/ixwindow"
while [ $# -gt 0 ];
do
case "$1" in
"--help" | "-h")
usage
;;
"--clean")
CLEAN=1
shift
;;
"--prefix")
PREFIX="$2"
shift 2
;;
*)
;;
esac
done
install
init_config_file