~whynothugo/dotfiles

96f333935da307ee292af72dd5ca023959e70c48 — Hugo Osvaldo Barrera 6 months ago 5a6d917 flatpak-firefox
firefox: Switch to flatpak installation

This setup creates a default profile, and places my config files inside
of it. However, due to Firefox's non-deterministic approach to handling
profiles and installations, the profile won't be used automatically. The
first run needs to use:

    flatpak run org.mozilla.firefox --profilemanager --no-remote

Pending issues with this:

- It's unclear how to install language packs via Flatpak (these are
  usually system packages).
- Firefox crashes when trying to switch the spell-checker language.
- Need to add a script to make it the default browser too.
10 files changed, 25 insertions(+), 12 deletions(-)

M .pre-commit-config.yaml
M dotfiles.toml
D home/.config/environment.d/90-firefox-wayland.conf
M home/.config/sway/apps.conf
A home/.config/templates/firefox-profiles.ini
A home/.config/user-tmpfiles.d/50-firefox-profile.conf
A home/.local/share/flatpak/overrides/org.mozilla.firefox
R home/{.mozilla/firefox/default/chrome/userChrome.css => .var/app/org.mozilla.firefox/.mozilla/firefox/default/chrome/userChrome.css}
R home/{.mozilla/firefox/default/user.js => .var/app/org.mozilla.firefox/.mozilla/firefox/default/user.js}
M sysconfig/PKGBUILD
M .pre-commit-config.yaml => .pre-commit-config.yaml +1 -1
@@ 20,7 20,7 @@ repos:
    rev: "v2.2.1"
    hooks:
      - id: prettier
        exclude: ^home/.mozilla/firefox/default/user.js$
        exclude: ^home/.*.mozilla/firefox/default/user.js$
  - repo: local
    hooks:
      - id: shellcheck

M dotfiles.toml => dotfiles.toml +3 -2
@@ 24,6 24,7 @@ symlinks = [
  ".config/sway",
  ".config/swaylock",
  ".config/systemd",
  ".config/templates",
  ".config/tmux",
  ".config/todoman",
  ".config/user-dirs.dirs",


@@ 41,8 42,8 @@ symlinks = [
  ".local/share/gnupg/gpg.conf",
  ".local/share/light-mode.d",
  ".local/share/nemo",
  ".mozilla/firefox/default/chrome/userChrome.css",
  ".mozilla/firefox/default/user.js",
  ".var/app/org.mozilla.firefox/.mozilla/firefox/default/chrome/userChrome.css",
  ".var/app/org.mozilla.firefox/.mozilla/firefox/default/user.js",
  ".zprofile",
  ".zshrc",
]

D home/.config/environment.d/90-firefox-wayland.conf => home/.config/environment.d/90-firefox-wayland.conf +0 -5
@@ 1,5 0,0 @@
# Firefox doesn't use wayland without this variable yet.
#
# This is used both by the session and by xdg-desktop-portal, which is
# involved in opening links clicked on Flatpak apps.
MOZ_ENABLE_WAYLAND=1

M home/.config/sway/apps.conf => home/.config/sway/apps.conf +1 -1
@@ 10,7 10,7 @@ bindsym $super+Shift+Return exec alacritty -e bash

# Applications
bindsym $super+q     exec slaunch nemo
bindsym $super+c     exec slaunch firefox
bindsym $super+c     exec slaunch flatpak run  org.mozilla.firefox
bindsym $super+o     exec slaunch wdisplays
bindsym $super+Comma exec flatpak run com.onepassword.OnePassword
bindsym $super+u     exec kruler

A home/.config/templates/firefox-profiles.ini => home/.config/templates/firefox-profiles.ini +8 -0
@@ 0,0 1,8 @@
[Profile0]
Name=default
IsRelative=1
Path=default
Default=1

[General]
Version=2

A home/.config/user-tmpfiles.d/50-firefox-profile.conf => home/.config/user-tmpfiles.d/50-firefox-profile.conf +8 -0
@@ 0,0 1,8 @@
# If the firefox profiles.ini files does not exist, create it.
# This is a bootstrap for now systems. The default way in which Firefox creates
# profiles is non-deterministic, and is a pain to configure.

# FIXME: Looks like `%h` doesn't work for source, so we need to hardcode here.
#        This is an upstream issue and needs to be reported.
C %h/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini 600 hugo hugo - /home/hugo/.config/templates/firefox-profiles.ini
d %h/.var/app/org.mozilla.firefox/.mozilla/firefox/default

A home/.local/share/flatpak/overrides/org.mozilla.firefox => home/.local/share/flatpak/overrides/org.mozilla.firefox +3 -0
@@ 0,0 1,3 @@
[Context]
sockets=!x11
filesystems=!xdg-download;~/.dotfiles/home/.var/app/org.mozilla.firefox/:ro

R home/.mozilla/firefox/default/chrome/userChrome.css => home/.var/app/org.mozilla.firefox/.mozilla/firefox/default/chrome/userChrome.css +0 -0
R home/.mozilla/firefox/default/user.js => home/.var/app/org.mozilla.firefox/.mozilla/firefox/default/user.js +1 -1
@@ 56,7 56,7 @@ user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
user_pref("privacy.webrtc.legacyGlobalIndicator", false);

// This setting makes firefox use dark mode depending on the theme.
// However, the detection of dark theme isn't very good, and triggers might
// However, the detection of dark theme isn't very good, and triggers night
// mode when I'm using my daytime theme (Arc-Darker).
//
// Explicitly disable this, since it just makes websites render dark mode

M sysconfig/PKGBUILD => sysconfig/PKGBUILD +0 -2
@@ 118,8 118,6 @@ depends=(
  blueman
  dconf-editor
  deluge-gtk
  firefox
  firefox-i18n-en-gb
  flatpak
  imv
  libretro-fbneo  # depends on retroarch?