-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·31 lines (28 loc) · 1.04 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·31 lines (28 loc) · 1.04 KB
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
#!/usr/bin/env bash
# api/ only needs building when you iterate on the IPC client lib:
# make -C api && sudo make -C api install
set -e
# we also want this to work regardless if the user is root or noot
as_root() {
if [ "$(id -u)" -eq 0 ]; then
"$@"
elif esc=$(command -v sudo) || esc=$(command -v doas); then
"$esc" "$@"
else
echo "no sudo or doas, trying su" >&2
su root -c "$*"
fi
}
make
as_root make install
# lets the event loop ask for SCHED_RR, which is about input latency under
# load, not client framerate. optional: ragnar logs a warning and runs at
# normal priority without it. skipped when libcap is not installed.
if command -v setcap >/dev/null; then
as_root setcap cap_sys_nice=ep /usr/bin/ragnar ||
echo "setcap failed, ragnar will run at normal priority" >&2
else
echo "no setcap (libcap), ragnar will run at normal priority" >&2
fi
# we do not need the make config anymore; logic unified.
echo "Successfully installed ragnarwm."