-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·112 lines (86 loc) · 1.99 KB
/
install.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
PIPXPKGLIST="$(which pipx 2> /dev/null && pipx list | grep package | awk '{print $2}')"
PACMANPKGLIST="$(pacman -Qq)"
run() {
local hook="$1"
shift
local package="$1"
if [[ -f "$package/$hook.sh" ]]; then
local wd="$(pwd)"
cd "$package"
echo sh "$hook.sh" $@
sh "$hook.sh" $@
cd "$wd"
fi
}
install() {
local root="$1"
local package="$2"
shift 2
run prepare "$package" "$root"
echo stow --verbose $@ --target "$root" "$package"
stow --verbose $@ --target "$root" "$package"
run post "$package" "$root"
}
installifexec() {
local root="$1"
local package="$2"
local exe="$3"
shift 3
if which "$exe" > /dev/null; then
install "$root" "$package" "$@"
fi
}
_installifneeded() {
local root="$1"
local package="$2"
local pkglist="$3"
shift 3
if grep -q "$package" <<< "$pkglist"; then
install "$root" "$package" "$@"
fi
}
_installconfig() {
_installifneeded "$(getconfig)" "$@"
}
installhome() {
_installifneeded "$HOME" "$@" "$PACMANPKGLIST"
}
getconfig() {
echo "${XDG_CONFIG_HOME:-$HOME/.config}"
}
installconfig() {
_installconfig "$@" "$PACMANPKGLIST"
}
pipxinstallconfig() {
_installconfig "$@" "$PIPXPKGLIST"
}
installhome stow &
installconfig autorandr &
installconfig droidcam &
installconfig ferium &
installconfig flameshot &
installconfig lazygit &
installconfig neovim &
installconfig opentabletdriver &
installconfig polybar &
installconfig stow &
installconfig tmux &
installconfig xdg-desktop-portal &
installconfig yazi &
installconfig sc-controller &
installconfig starship &
installconfig polkit-gnome &
installconfig qbittorrent &
installconfig gpu-screen-recorder-git &
installconfig wezterm &
# Workaround for nvim builded from source
installifexec "$(getconfig)" neovim nvim &
# Workaround for wakatime installed by neovim
installifexec "$HOME" wakatime ~/.wakatime/wakatime-cli &
installhome vim &
installhome zsh &
installhome git &
installhome i3 &
pipxinstallconfig pyload-ng &
wait $(jobs -p)