chore: cleanup shellcheck warnings (#1181)
This commit is contained in:
parent
befb5d8d19
commit
102ff6983e
9 changed files with 23 additions and 19 deletions
|
|
@ -6,7 +6,7 @@ set -oue pipefail
|
|||
wget https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo
|
||||
|
||||
# 39 gets VRR and Ptyxis
|
||||
if [ ${FEDORA_MAJOR_VERSION} -eq "39" ]; then
|
||||
if [ "${FEDORA_MAJOR_VERSION}" -eq "39" ]; then
|
||||
wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-gnome-vrr-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo
|
||||
rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr mutter mutter-common gnome-control-center gnome-control-center-filesystem
|
||||
rm -f /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo
|
||||
|
|
@ -21,7 +21,7 @@ if [ ${FEDORA_MAJOR_VERSION} -eq "39" ]; then
|
|||
fi
|
||||
|
||||
# 40 gets Ptyxis and patched Mutter
|
||||
if [ ${FEDORA_MAJOR_VERSION} -eq "40" ]; then
|
||||
if [ "${FEDORA_MAJOR_VERSION}" -eq "40" ]; then
|
||||
rpm-ostree override replace \
|
||||
--experimental \
|
||||
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ name="$1"
|
|||
default="$2"
|
||||
palette="$3"
|
||||
|
||||
# shellcheck disable=2154
|
||||
for check in "${!known_container[@]}"; do
|
||||
if test "$check" = "$name"; then
|
||||
guid=${known_container[$check]}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
# Script Version
|
||||
VER=1
|
||||
VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/flatpak_manager_version"
|
||||
VER_RAN=$(cat $VER_FILE)
|
||||
VER_RAN=$(cat "$VER_FILE")
|
||||
|
||||
mkdir -p "$(dirname "$VER_FILE")" || exit 1
|
||||
|
||||
# Run script if updated
|
||||
if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then
|
||||
if [[ -f $VER_FILE && $VER = "$VER_RAN" ]]; then
|
||||
echo "Flatpak manager v$VER has already ran. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
|
@ -18,4 +18,4 @@ flatpak --system update -y
|
|||
|
||||
notify-send "Welcome to Bluefin" "Your computer is ready!" --app-name="Flatpak Manager Service" -u NORMAL
|
||||
|
||||
echo $VER >$VER_FILE
|
||||
echo $VER >"$VER_FILE"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# shellcheck disable=2046
|
||||
echo -n $(jq -r '"\(.["image-name"]):\(.["image-tag"])"' < /usr/share/ublue-os/image-info.json)
|
||||
|
||||
if [[ $(rpm-ostree status --booted) =~ "signed" ]]; then
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ escape() {
|
|||
sed 's/[&/\]/\\&/g' <<< "$1"
|
||||
}
|
||||
|
||||
TIP_FILE=$(ls "/usr/share/ublue-os/motd/tips/"*".md" | shuf -n 1)
|
||||
TIP_FILE=$(find /usr/share/ublue-os/motd/tips/*.md | shuf -n 1)
|
||||
if [[ -f "$TIP_FILE" ]]; then
|
||||
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
|
||||
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
|
||||
|
|
@ -18,6 +18,7 @@ if [[ -f "$TIP_FILE" ]]; then
|
|||
DIFFERENCE=$((CURRENT_SECONDS - IMAGE_DATE_SECONDS))
|
||||
MONTH=$((30 * 24 * 60 * 60))
|
||||
if [ "$DIFFERENCE" -ge "$MONTH" ]; then
|
||||
#shellcheck disable=2016
|
||||
TIP='# Your current image is over 1 month old, run `ujust update`'
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@
|
|||
timedatectl set-ntp true
|
||||
|
||||
# Allow Tailscale Control
|
||||
tailscale set --operator="$(getent passwd $PKEXEC_UID | cut -d: -f1)"
|
||||
tailscale set --operator="$(getent passwd "$PKEXEC_UID" | cut -d: -f1)"
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ IMAGE_FLAVOR=$(jq -r '."image-flavor"' < $IMAGE_INFO)
|
|||
# SCRIPT VERSION
|
||||
HWS_VER=2
|
||||
HWS_VER_FILE="/etc/ublue/hws_version"
|
||||
[[ -f HWS_VER_FILE ]] && HWS_VER_RAN=$(cat $HWS_VER_FILE)
|
||||
[[ -f "$HWS_VER_FILE" ]] && HWS_VER_RAN=$(cat $HWS_VER_FILE)
|
||||
|
||||
# IMAGE IDENTIFIERS
|
||||
KNOWN_IMAGE_NAME_FILE="/etc/ublue/image_name"
|
||||
[[ -f KNOWN_IMAGE_NAME_FILE ]] && KNOWN_IMAGE_NAME=$(cat $KNOWN_IMAGE_NAME_FILE)
|
||||
[[ -f "$KNOWN_IMAGE_NAME_FILE" ]] && KNOWN_IMAGE_NAME=$(cat $KNOWN_IMAGE_NAME_FILE)
|
||||
KNOWN_IMAGE_FLAVOR_FILE="/etc/ublue/image_flavor"
|
||||
[[ -f KNOWN_IMAGE_FLAVOR_FILE ]] && KNOWN_IMAGE_FLAVOR=$(cat $KNOWN_IMAGE_FLAVOR_FILE)
|
||||
[[ -f "$KNOWN_IMAGE_FLAVOR_FILE" ]] && KNOWN_IMAGE_FLAVOR=$(cat $KNOWN_IMAGE_FLAVOR_FILE)
|
||||
|
||||
# Run script if updated
|
||||
if [[ -f "$HWS_VER_FILE" && "$HWS_VER" = "$HWS_VER_RAN" ]]; then
|
||||
|
|
|
|||
|
|
@ -3,30 +3,31 @@
|
|||
# SCRIPT VERSION
|
||||
USER_SETUP_VER=5
|
||||
USER_SETUP_VER_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/ublue/user-setup"
|
||||
USER_SETUP_VER_RAN=$(cat $USER_SETUP_VER_FILE)
|
||||
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")
|
||||
|
||||
mkdir -p "$(dirname "$USER_SETUP_VER_FILE")" || exit 1
|
||||
|
||||
echo "$(dirname "$USER_SETUP_VER_FILE")"
|
||||
dirname "$USER_SETUP_VER_FILE"
|
||||
|
||||
# Upgrade from v1 to v2 changes only the location of the USER_SETUP_VER.
|
||||
# Exit if v1 file is present.
|
||||
USER_SETUP_VER_FILE_V1="$HOME/.ublue-configured"
|
||||
if [[ -f $USER_SETUP_VER_FILE_V1 ]]; then
|
||||
echo "User setup v1 has already run. Exiting..."
|
||||
rm $USER_SETUP_VER_FILE_V1
|
||||
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE
|
||||
rm "$USER_SETUP_VER_FILE_V1"
|
||||
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run script if updated
|
||||
if [[ -f $USER_SETUP_VER_FILE && $USER_SETUP_VER = $USER_SETUP_VER_RAN ]]; then
|
||||
if [[ -f "$USER_SETUP_VER_FILE" && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
|
||||
echo "User setup v$VER has already run. Exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
|
||||
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
|
||||
# Currently unused
|
||||
# IMAGE_INFO="/usr/share/ublue-os/image-info.json"
|
||||
# IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
|
||||
|
||||
# Ensure custom ptyxis theme is present
|
||||
PTYXIS_THEME_DIR="/usr/etc/skel/.local/share/org.gnome.Ptyxis/palettes"
|
||||
|
|
@ -41,4 +42,4 @@ pkexec /usr/libexec/ublue-privileged-user-setup
|
|||
|
||||
# Prevent future executions
|
||||
echo "Writing state file"
|
||||
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE
|
||||
echo $USER_SETUP_VER > "$USER_SETUP_VER_FILE"
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"separator": " ",
|
||||
"color": {
|
||||
"keys": "bright_cyan"
|
||||
},
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue