mirror of
https://github.com/andwati/dotfiles.git
synced 2026-10-18 02:52:52 +00:00
Switch Slack to Flathub instead of the packagecloud apt repo
Adds a shared ensure_flatpak helper in lib.sh (installs flatpak + adds the Flathub remote) and reuses it from both the slack module and desnap.sh's unmapped-snap fallback instead of duplicating the setup.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Ian Andwati
|
||||
Copyright (c) 2026 Ian Andwati
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -127,11 +127,7 @@ fi
|
||||
|
||||
if [[ ${#unmapped[@]} -gt 0 ]]; then
|
||||
warn "no apt equivalent known for: ${unmapped[*]} — setting up Flatpak/Flathub so you can still get them"
|
||||
apt_install flatpak
|
||||
if has_cmd gnome-shell; then
|
||||
apt_install gnome-software-plugin-flatpak
|
||||
fi
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
ensure_flatpak
|
||||
warn "search/install with: flatpak search <name> && flatpak install flathub <app-id>"
|
||||
for s in "${unmapped[@]}"; do
|
||||
warn " - $s"
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ declare -A MODULE_DESC=(
|
||||
[zig]="Zig + zls (language server)"
|
||||
[chrome]="Google Chrome"
|
||||
[discord]="Discord"
|
||||
[slack]="Slack"
|
||||
[slack]="Slack (Flathub)"
|
||||
[firefox]="Firefox (Mozilla apt repo, not snap)"
|
||||
[postman]="Postman"
|
||||
[jetbrains-toolbox]="JetBrains Toolbox"
|
||||
|
||||
@@ -48,6 +48,17 @@ apt_install() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ensure_flatpak — installs flatpak (+ GNOME Software integration when
|
||||
# running GNOME) and adds the Flathub remote system-wide. Shared by any
|
||||
# module that prefers a verified Flathub app id over a vendor's own apt repo.
|
||||
ensure_flatpak() {
|
||||
apt_install flatpak
|
||||
if has_cmd gnome-shell; then
|
||||
apt_install gnome-software-plugin-flatpak
|
||||
fi
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
}
|
||||
|
||||
# apt_add_repo <list-name> <keyring-path> <key-url> <repo-line>
|
||||
# Registers a signed apt repo the way every vendor's official install docs do
|
||||
# it (dearmor the key into /etc/apt/keyrings or similar, write a .list file),
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
install_slack() {
|
||||
if has_cmd slack; then ok "slack already installed"; return; fi
|
||||
apt_add_repo slack /etc/apt/trusted.gpg.d/slack.gpg \
|
||||
https://packagecloud.io/slacktechnologies/slack/gpgkey \
|
||||
"deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie main"
|
||||
apt_install slack-desktop
|
||||
if flatpak list --app 2>/dev/null | grep -q com.slack.Slack; then
|
||||
ok "slack already installed"
|
||||
return
|
||||
fi
|
||||
|
||||
ensure_flatpak
|
||||
sudo flatpak install -y flathub com.slack.Slack
|
||||
rollback_push "sudo flatpak uninstall -y com.slack.Slack"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user