-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathconfig.sh
executable file
·55 lines (44 loc) · 1.87 KB
/
config.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
#!/bin/bash
set -eo pipefail
# sets desktop background and blurred version for login screen
export DESKTOP_BACKGROUND=groot.png
# directory to use to download / clone anything for easy cleanup if necessary
export TWEAKS_DIR=${HOME}/.${USER}-tweaks
# nordic theme subtype darker|Polar|bluish-accent
export NORDIC_THEME_SUBTYPE=bluish-accent
# ------------------------------------------------------------------------------------------------------------------------------------
mkdir -p ${TWEAKS_DIR}
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# assume we've run ./reblur.sh and this exists
db_blurred=$(basename -- "$DESKTOP_BACKGROUND")
db_blurred_ext="${db_blurred##*.}"
db_blurred="${db_blurred%.*}"
export DESKTOP_BACKGROUND_BLURRED="${db_blurred}.blurred.${db_blurred_ext}"
# set up theme-related vars
if [[ ! -z "${NORDIC_THEME_SUBTYPE}" ]]; then
export NORDIC_THEME_SUBTYPE="-${NORDIC_THEME_SUBTYPE}"
fi
export NORDIC_THEME="Nordic${NORDIC_THEME_SUBTYPE}-standard-buttons"
export NORDIC_VERSION=$(get_latest_release EliverLara/Nordic)
# set up os indentification vars
export BOOTSTRAP_OS=$(uname | tr '[[:upper:]]' '[[:lower:]]')
if [[ "${BOOTSTRAP_OS}" = "linux" ]]; then
if [[ -f /etc/os-release ]]; then
export LINUX_DISTRO=$(cat /etc/os-release |grep -E '^ID' |sed -e 's/^ID=//g')
else
echo "you're running on some non-systemd linux distribution dude: no /etc/os-release" >&2
exit 1
fi
elif [[ "${BOOTSTRAP_OS}" = "darwin" ]]; then
export LINUX_DISTRO=na
else
echo "you're running on some bullshit os dude: ${BOOTSTRAP_OS}" >&2
exit 1
fi
if [[ -n "${NOCONFIRM}" ]]; then
export NOCONFIRM=--noconfirm
fi