Migrate more apps to flatpaks
This commit is contained in:
1 parent
78e195ccde
commit
66a43ca3dd
1 file changed
+77
-101
+77
-101
@@ -8,67 +8,68 @@ exec > >(tee -a "$LOGFILE") 2>&1
|
|||||||
echo "=== Fedora New Machine Setup Started at $(date --iso-8601=seconds) ==="
|
echo "=== Fedora New Machine Setup Started at $(date --iso-8601=seconds) ==="
|
||||||
|
|
||||||
if [[ ${EUID:-$(id -u)} -eq 0 ]]; then
|
if [[ ${EUID:-$(id -u)} -eq 0 ]]; then
|
||||||
SUDO=""
|
SUDO=""
|
||||||
REAL_USER="${SUDO_USER:-root}"
|
REAL_USER="${SUDO_USER:-root}"
|
||||||
REAL_HOME="$(getent passwd "$REAL_USER" | cut -d: -f6)"
|
REAL_HOME="$(getent passwd "$REAL_USER" | cut -d: -f6)"
|
||||||
else
|
else
|
||||||
SUDO="sudo"
|
SUDO="sudo"
|
||||||
REAL_USER="$USER"
|
REAL_USER="$USER"
|
||||||
REAL_HOME="$HOME"
|
REAL_HOME="$HOME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FEDORA_VER="$(rpm -E %fedora)"
|
FEDORA_VER="$(rpm -E %fedora)"
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
echo
|
echo
|
||||||
echo ">>> $*"
|
echo ">>> $*"
|
||||||
"$@"
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
echo "WARNING: $*" >&2
|
echo "WARNING: $*" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
have_cmd() {
|
have_cmd() {
|
||||||
command -v "$1" >/dev/null 2>&1
|
command -v "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_installed() {
|
pkg_installed() {
|
||||||
rpm -q "$1" >/dev/null 2>&1
|
rpm -q "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
local to_install=()
|
local to_install=()
|
||||||
local pkg
|
local pkg
|
||||||
|
|
||||||
for pkg in "$@"; do
|
for pkg in "$@"; do
|
||||||
if ! pkg_installed "$pkg"; then
|
if ! pkg_installed "$pkg"; then
|
||||||
to_install+=("$pkg")
|
to_install+=("$pkg")
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if ((${#to_install[@]} == 0)); then
|
|
||||||
echo "Packages already installed: $*"
|
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
run $SUDO dnf install -y "${to_install[@]}" || warn "Some packages failed to install: ${to_install[*]}"
|
if ((${#to_install[@]} == 0)); then
|
||||||
|
echo "Packages already installed: $*"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
run $SUDO dnf install -y "${to_install[@]}" || warn "Some packages failed to install: ${to_install[*]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
flatpak_install() {
|
flatpak_install() {
|
||||||
local ref
|
local ref
|
||||||
for ref in "$@"; do
|
|
||||||
if flatpak info "$ref" >/dev/null 2>&1; then
|
for ref in "$@"; do
|
||||||
echo "Flatpak already installed: $ref"
|
if flatpak info "$ref" >/dev/null 2>&1; then
|
||||||
else
|
echo "Flatpak already installed: $ref"
|
||||||
run flatpak install -y flathub "$ref" || warn "Flatpak failed: $ref"
|
else
|
||||||
fi
|
run flatpak install -y flathub "$ref" || warn "Flatpak failed: $ref"
|
||||||
done
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
write_vscode_repo() {
|
write_vscode_repo() {
|
||||||
run $SUDO rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
run $SUDO rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||||
run $SUDO tee /etc/yum.repos.d/vscode.repo >/dev/null <<'EOF'
|
run $SUDO tee /etc/yum.repos.d/vscode.repo >/dev/null <<'EOF'
|
||||||
[code]
|
[code]
|
||||||
name=Visual Studio Code
|
name=Visual Studio Code
|
||||||
baseurl=https://packages.microsoft.com/yumrepos/vscode
|
baseurl=https://packages.microsoft.com/yumrepos/vscode
|
||||||
@@ -87,7 +88,7 @@ echo "Creating mount points..."
|
|||||||
run $SUDO mkdir -p /mnt/games /mnt/media
|
run $SUDO mkdir -p /mnt/games /mnt/media
|
||||||
|
|
||||||
if have_cmd systemctl; then
|
if have_cmd systemctl; then
|
||||||
run $SUDO systemctl daemon-reload || true
|
run $SUDO systemctl daemon-reload || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
@@ -97,9 +98,9 @@ pkg_install dnf-plugins-core
|
|||||||
echo
|
echo
|
||||||
echo "Installing RPM Fusion repos..."
|
echo "Installing RPM Fusion repos..."
|
||||||
run $SUDO dnf install -y \
|
run $SUDO dnf install -y \
|
||||||
"https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VER}.noarch.rpm" \
|
"https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VER}.noarch.rpm" \
|
||||||
"https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VER}.noarch.rpm" \
|
"https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VER}.noarch.rpm" \
|
||||||
|| warn "RPM Fusion install failed or repos may already exist"
|
|| warn "RPM Fusion install failed or repos may already exist"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Enabling Flatpak + Flathub..."
|
echo "Enabling Flatpak + Flathub..."
|
||||||
@@ -114,28 +115,26 @@ echo
|
|||||||
echo "Installing multimedia codecs..."
|
echo "Installing multimedia codecs..."
|
||||||
run $SUDO dnf swap -y ffmpeg-free ffmpeg --allowerasing || warn "ffmpeg swap failed"
|
run $SUDO dnf swap -y ffmpeg-free ffmpeg --allowerasing || warn "ffmpeg swap failed"
|
||||||
run $SUDO dnf install -y \
|
run $SUDO dnf install -y \
|
||||||
mozilla-openh264 \
|
mozilla-openh264 \
|
||||||
gstreamer1-plugins-bad-freeworld \
|
gstreamer1-plugins-bad-freeworld \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
|| warn "Codec package install failed"
|
|| warn "Codec package install failed"
|
||||||
run $SUDO dnf update -y @multimedia --setopt=install_weak_deps=False --exclude=PackageKit-gstreamer-plugin \
|
run $SUDO dnf update -y @multimedia --setopt=install_weak_deps=False --exclude=PackageKit-gstreamer-plugin \
|
||||||
|| warn "Multimedia group update failed"
|
|| warn "Multimedia group update failed"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing common RPM apps..."
|
echo "Installing common RPM apps..."
|
||||||
pkg_install \
|
pkg_install \
|
||||||
filezilla \
|
git \
|
||||||
git \
|
hugo \
|
||||||
hugo \
|
NetworkManager-openvpn \
|
||||||
NetworkManager-openvpn \
|
openvpn \
|
||||||
openvpn \
|
qbittorrent \
|
||||||
qbittorrent \
|
steam \
|
||||||
steam \
|
oh-my-posh \
|
||||||
thunderbird \
|
openrgb \
|
||||||
oh-my-posh \
|
screenfetch \
|
||||||
openrgb \
|
yt-dlp
|
||||||
screenfetch \
|
|
||||||
yt-dlp
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing fonts..."
|
echo "Installing fonts..."
|
||||||
@@ -148,57 +147,34 @@ write_vscode_repo
|
|||||||
run $SUDO dnf makecache -y || warn "dnf makecache failed"
|
run $SUDO dnf makecache -y || warn "dnf makecache failed"
|
||||||
pkg_install code
|
pkg_install code
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Installing optional RPM apps..."
|
|
||||||
pkg_install discord || warn "discord not available from enabled repos"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Installing Flatpaks..."
|
echo "Installing Flatpaks..."
|
||||||
flatpak_install \
|
flatpak_install \
|
||||||
org.signal.Signal \
|
org.signal.Signal \
|
||||||
com.bitwarden.desktop \
|
com.bitwarden.desktop \
|
||||||
io.github.martinrotter.rssguard \
|
io.github.martinrotter.rssguard \
|
||||||
com.spotify.Client \
|
com.spotify.Client \
|
||||||
io.github.Archeb.opentrace
|
io.github.Archeb.opentrace \
|
||||||
|
org.filezillaproject.Filezilla \
|
||||||
|
org.mozilla.Thunderbird \
|
||||||
|
com.discordapp.Discord
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Setting ownership hint for /mnt/games..."
|
echo "Configuring Flatpak access to mounted media..."
|
||||||
echo "After you mount the ext4 games partition, you may want:"
|
run flatpak override --user --filesystem=/mnt/media org.filezillaproject.Filezilla \
|
||||||
echo " sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games"
|
|| warn "Could not grant FileZilla access to /mnt/media"
|
||||||
|
|
||||||
cat <<EOF
|
echo
|
||||||
|
echo "Setting ownership hint for mounted directories..."
|
||||||
|
echo "After you mount the ext4 games/media partitions, you may want:"
|
||||||
|
echo " sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games /mnt/media"
|
||||||
|
|
||||||
=== Setup completed at $(date --iso-8601=seconds) ===
|
echo
|
||||||
Check log: $LOGFILE
|
echo "qBittorrent note: keep the RPM build for host-level VPN adapter binding."
|
||||||
|
echo "After connecting OpenVPN, select its tun interface in qBittorrent:"
|
||||||
|
echo " Tools -> Options -> Advanced -> Network interface"
|
||||||
|
echo "Then restart qBittorrent and verify transfers stop when the VPN disconnects."
|
||||||
|
|
||||||
Manual mount follow-up:
|
echo
|
||||||
|
echo "=== Fedora New Machine Setup Finished at $(date --iso-8601=seconds) ==="
|
||||||
1. Find UUIDs:
|
echo "Log saved to: $LOGFILE"
|
||||||
lsblk -f
|
|
||||||
|
|
||||||
2. Back up fstab:
|
|
||||||
sudo cp /etc/fstab /etc/fstab.bak
|
|
||||||
|
|
||||||
3. Add entries like these:
|
|
||||||
|
|
||||||
# ext4 games partition
|
|
||||||
UUID=XXXXXX-XXXX /mnt/games ext4 defaults,nofail 0 2
|
|
||||||
|
|
||||||
# example media partition if still NTFS
|
|
||||||
UUID=YYYYYY-YYYY /mnt/media ntfs defaults,nofail,uid=1000,gid=1000 0 0
|
|
||||||
|
|
||||||
4. Test mounts:
|
|
||||||
sudo mount -a
|
|
||||||
|
|
||||||
5. For the ext4 games partition, fix ownership if needed:
|
|
||||||
sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games
|
|
||||||
|
|
||||||
6. Reboot and verify.
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- /mnt/games is assumed to be ext4.
|
|
||||||
- Signal Desktop is installed via Flatpak only.
|
|
||||||
- ext4 stores ownership/permissions in the filesystem itself.
|
|
||||||
- Use KDE Partition Manager or GNOME Disks if you prefer a GUI.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
Reference in new issue
Block a user