Revamp browser install scripts with snap/flatpak support and merge reset-theme into global-theme#1338
Revamp browser install scripts with snap/flatpak support and merge reset-theme into global-theme#1338thepinak503 wants to merge 4 commits into
Conversation
…theme - Brave: Ubuntu snap, apt repo, flatpak fallback - Chromium: Ubuntu snap, Debian apt, flatpak fallback - Firefox: Ubuntu snap removal + Mozilla APT repo, Debian firefox-esr - Google Chrome: wget ca-certificates dep, /tmp download, flatpak fallback - Thorium: fix typo (installThrorium -> installThorium), wget --no-hsts - Vivaldi: Ubuntu snap, apt repo, flatpak fallback - Zen Browser: Ubuntu snap (candidate), Debian/flatpak fallback - Waterfox: apt-get|nala -> flatpak (no .deb exists) - Lynx: fix indentation in case block - common-script.sh: add checkSnap() helper - global-theme.sh: integrate reset theme with menu (dark/reset/cancel) supporting 18+ DEs/WMs with distro-specific defaults - brave-origin.sh: restored from upstream (was deleted in fork)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 725640deaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for wm_dir in i3 bspwm qtile dwm; do | ||
| rm -f "$HOME/.config/$wm_dir/config" "$HOME/.config/$wm_dir/theme" 2>/dev/null || true |
There was a problem hiding this comment.
Do not delete WM configs during a theme reset
When the user chooses the new reset option under i3/bspwm/qtile/dwm, and also after the Sway/Hyprland reset paths call this helper, this removes the user's entire WM config/theme files without a backup or a specific destructive prompt. Those files commonly contain keybindings, autostart commands, monitor layout, and application rules, so a "Reset Theme" action can unexpectedly destroy unrelated desktop configuration.
Useful? React with 👍 / 👎.
| if command_exists snap && snap list firefox 2>/dev/null | grep -q firefox; then | ||
| printf "%b\n" "${YELLOW}Removing Snap Firefox...${RC}" | ||
| "$ESCALATION_TOOL" snap remove firefox |
There was a problem hiding this comment.
Replace snap Firefox before the generic installed check
On Ubuntu systems that already have the default Firefox snap, firefox is usually on PATH, so the outer if ! command_exists firefox sends execution to the "already installed" branch before this snap-removal block can run. In that common case the script never removes the snap or installs the Mozilla APT package, which defeats the new Ubuntu behavior added here.
Useful? React with 👍 / 👎.
| URIs: https://packages.mozilla.org/apt | ||
| Suites: mozilla | ||
| Components: main | ||
| Signed-By: /etc/apt/keyrings/packages.mozilla.org.gpg |
There was a problem hiding this comment.
Point Signed-By at the fallback key file
If gpg is missing or --dearmor fails, the fallback copies the downloaded key to packages.mozilla.org.asc, but the source stanza still uses Signed-By: /etc/apt/keyrings/packages.mozilla.org.gpg. On those Ubuntu installs apt update will fail because the referenced key file was never created; either ensure gpg is installed or make the stanza reference the actual fallback file.
Useful? React with 👍 / 👎.
| apt-get|nala) | ||
| "$ESCALATION_TOOL" rm -fv /etc/apt/sources.list.d/thorium.list | ||
| "$ESCALATION_TOOL" curl http://dl.thorium.rocks/debian/dists/stable/thorium.list -o /etc/apt/sources.list.d/thorium.list | ||
| "$ESCALATION_TOOL" wget --no-hsts -P /etc/apt/sources.list.d/ http://dl.thorium.rocks/debian/dists/stable/thorium.list |
There was a problem hiding this comment.
Check or install wget before using it
In the apt/nala path this now calls wget, but checkEnv only requires curl and this branch does not install or validate wget first. Minimal Debian/Ubuntu environments that lack wget will abort here before the Thorium repo is added, so use the already-required curl or install/check wget before this command.
Useful? React with 👍 / 👎.
Summary
This PR overhauls the browser installation scripts across the board and merges the reset theme functionality directly into
global-theme.sh— no more separate script needed.Browser changes
Every browser script now properly handles Debian-based distros with smart package manager routing:
curl | shapproachwget ca-certificatesdeps, downloads to/tmpinstead of cwd, flatpak as fallbackcurltowget --no-hstsfor repo setupGlobal theme revamp
global-theme.shnow has a clean menu:The reset function detects the desktop environment automatically and restores default themes, icons, cursors, fonts, wallpapers, and panel layouts. It also cleans up GTK/QT config files and theme environment variables that might have been left behind. Supports GNOME, KDE, XFCE, Cinnamon, MATE, Budgie, LXDE, LXQt, Deepin, Pantheon, Sway, Hyprland, i3, bspwm, dwm, qtile, Openbox, Enlightenment, UKUI, Lomiri, and COSMIC.
Other bits
checkSnap()helper tocommon-script.shalongside the existingcheckFlatpak()brave-origin.shthat was missing from the forkbash -n