Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Last active April 10, 2022 02:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexdelorenzo/041f1d28df63419527bd189390a0595a to your computer and use it in GitHub Desktop.
Save alexdelorenzo/041f1d28df63419527bd189390a0595a to your computer and use it in GitHub Desktop.
Install Firefox with Global Menu patches on Ubuntu derived Linux distributions.
#!/usr/bin/env bash
# Copyright 2022 Alex DeLorenzo. Licensed under the AGPLv3.
# This script requires Bash, byobu, curl, and pup. You can find the latter here:
# For more information, see
# Usage:
# $ ./ amd64
readonly ARCH="${1:-amd64}"
readonly URL="$ARCH/firefox/download"
readonly DEB_PATH="div#content > ul > li > a attr{href}"
readonly debUrl="$(curl -s "$URL" | pup "$DEB_PATH")"
readonly debFile="$(basename "$debUrl")"
# download if file does not exist
test -e "$debFile" || {
printf "Downloading %s\n" "$debUrl"
curl -O "$debUrl"
# get current and downloaded firefox versions
currVer="$(apt show firefox | grep Version | col2 | cut -d- -f1)"
downloadVer="$(dpkg -I "$debFile" | grep Version | col2 | cut -d- -f1)"
printf "Installed: %s\n" "$currVer"
printf "Downloaded: %s\n" "$downloadVer"
# check if installed version is different from downloaded version
test "$currVer" != "$downloadVer" && {
# install
sudo apt install ./"$debFile"
# hold version
sudo apt-mark hold firefox
Copy link

rbreaves commented Nov 27, 2021

Some dependencies are needed.

sudo apt-get install byobu

Also install brew imo and do brew install pup to save the hassle of trying to get it up and running.

There is also an issue of the close, minimize and restore/maximize buttons disappearing with this fix as well.

Copy link

Possible to work around this by customizing your toolbar and checkmarking show titlebar or maybe a more proper fix, but it involves editing the css of Firefox to bring back the normal buttons without the title bar.

Copy link

alexdelorenzo commented Dec 20, 2021

Thanks for the heads up about the byobu dependency, @rbreaves.

I haven't had problems with the sizes of the window buttons, but that might be because I'm using KWin and its default window decorations, and not Firefox's.

pup is packaged for Sid, as well

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