Skip to content

Revamp browser install scripts with snap/flatpak support and merge reset-theme into global-theme#1338

Closed
thepinak503 wants to merge 4 commits into
ChrisTitusTech:mainfrom
thepinak503:main
Closed

Revamp browser install scripts with snap/flatpak support and merge reset-theme into global-theme#1338
thepinak503 wants to merge 4 commits into
ChrisTitusTech:mainfrom
thepinak503:main

Conversation

@thepinak503

Copy link
Copy Markdown
Contributor

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:

  • Brave: Native apt repo on Debian, snap on Ubuntu, flatpak fallback — replaces the bare curl | sh approach
  • Chromium: Snap on Ubuntu, apt everywhere else
  • Firefox: Removes the snap Firefox on Ubuntu and sets up the Mozilla apt repo with proper pin priority, installs the real Firefox. Debian stays on firefox-esr
  • Google Chrome: Added missing wget ca-certificates deps, downloads to /tmp instead of cwd, flatpak as fallback
  • Vivaldi: Snap on Ubuntu, apt repo on Debian
  • Zen Browser: Snap on Ubuntu (candidate channel), flatpak elsewhere
  • Waterfox: Flatpak install for apt-based distros (no deb exists upstream)
  • Thorium: Fixed function name typo and switched from curl to wget --no-hsts for repo setup
  • Lynx: Fixed indentation in case block
  • Other scripts (LibreWolf, Tor) left as-is — they already worked fine

Global theme revamp

global-theme.sh now has a clean menu:

  • Option 1: Apply dark theme (original behavior)
  • Option 2: Reset theme to distribution defaults
  • Option 3: Cancel

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

  • Added checkSnap() helper to common-script.sh alongside the existing checkFlatpak()
  • Restored brave-origin.sh that was missing from the fork
  • Syntax-verified all changed scripts with bash -n

…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)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +471 to +472
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +34 to +36
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant