-
Notifications
You must be signed in to change notification settings - Fork 7
/
install
executable file
·42 lines (33 loc) · 1005 Bytes
/
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
#!/bin/sh
if ! ls "$HOME"/.config/shadowreplay;then
cp example_config "$HOME"/.config/shadowreplay
fi
DIR=$(dirname "$0")
# Install dependencies on Arch
if [ -e "/etc/arch-release" ]; then
echo "Installing dependencies"
sudo pacman --noconfirm -S ffmpeg libnotify
fi
# move shadowreplay to /usr/local/bin
sudo install "$DIR/shadowreplay" /usr/local/bin
# Save the xbindkeys config
# if xbindkeys is installed
if ls /bin/xbindkeys;then
echo """
# make F9 save ShadowRePlay replay
"killall --user "$USER" --ignore-case --signal SIGTERM ffmpeg"
F9
# make F10 kill ShadowRePlay
"killall -s1 ffmpeg"
F10
""" >> "$HOME/.xbindkeysrc"
fi
# Install systemd user service
mkdir -p "$HOME/.config/systemd/user/"
cp "$DIR/shadowreplay.service" "$HOME/.config/systemd/user/"
# Start shadowreplay service
systemctl --user enable --now shadowreplay
systemctl --user restart --now shadowreplay
echo """
Installation is complete!
Press F9 to save a replay"""