aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.md2
-rw-r--r--Makefile35
-rw-r--r--Makefile.git8
-rw-r--r--README.md39
-rw-r--r--TODO.md2
-rw-r--r--chrome/misc/include.css6
-rw-r--r--chrome/misc/orig.css4
-rw-r--r--chrome/status/panel.css11
-rw-r--r--chrome/tabs/hide.css40
-rw-r--r--chrome/tabs/tree.css13
-rw-r--r--chrome/tridactyl/main.css30
-rw-r--r--chrome/userChrome.css6
-rwxr-xr-xfirefox-dev54
-rwxr-xr-xfirefox-profile31
14 files changed, 236 insertions, 45 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index 5cc6160..165fe19 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,5 @@
# ChangeLog
-## YYYY-MM-DD - Unreleased
+## 2024-07-19 - Initial version
* Initial version.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 4f0db17..0000000
--- a/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Global Makefile - https://templater.fluxo.info
-#
-# This Makefile contains basic, common targets and also includes
-# any Makefile.* available in the current folder.
-#
-
-# Set CONTAINER based in what we have available in the system
-# This variable can be user in other, included Makefiles to handle virtualization tasks
-ifeq ($(shell which kvmx > /dev/null && test -s kvmxfile && echo yes), yes)
- CONTAINER = kvmx
-else ifeq ($(shell which vagrant > /dev/null && test -s Vagrantfile && echo yes), yes)
- CONTAINER = vagrant
-else ifeq ($(shell which docker > /dev/null && test -s Dockerfile && echo yes), yes)
- CONTAINER = docker
-else
- CONTAINER = ''
-endif
-
-# Default action
-default: all
-
-# Process any other Makefile whose filename matches Makefile.*
-# See https://www.gnu.org/software/make/manual/html_node/Include.html
-#
-# Some of those files might even contain local customizations/overrides
-# that can be .gitignore'd, like a Makefile.local for example.
--include Makefile.*
-
-# Customization examples can be as simple as setting variables:
-#CONTAINER = vagrant
-#CONTAINER = docker
-#DESTDIR ?= vendor
-#HTTP_PORT ="8080"
-#HTTP_SERVER ="ssi_server"
diff --git a/Makefile.git b/Makefile.git
deleted file mode 100644
index 026176b..0000000
--- a/Makefile.git
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Makefile for Git-related tasks - https://templater.fluxo.info
-#
-
-# Configure a git post-receive hook
-post_receive:
- git config receive.denyCurrentBranch ignore
- test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive
diff --git a/README.md b/README.md
index ccfe236..45444ea 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,38 @@
-# firefoxer
+# Firefoxer
+
+## About
+
+This repository has utilities and customizations for [Mozilla
+Firefox](https://www.mozilla.org/en-US/firefox/).
+
+Inspired by:
+
+* [Timvde/UserChrome-Tweaks: A community maintained repository of userChrome.css tweaks for Firefox](https://github.com/Timvde/UserChrome-Tweaks)
+
+## Conventions
+
+## Profiles
+
+* It's suggested to store profiles in the `~/.mozilla/firefox/profiles`.
+
+### Shared useChrome.css
+
+There are many ways to reuse the same `userChrome` configuration among all your
+profiles:
+
+ cd ~/.mozilla/firefox/profiles
+ for file in *; do
+ ln -sf /path/to/firefoxer/chrome $file/chrome;
+ done
+
+### Suggested profiles
+
+* `template`:
+ * Useful to be the base for new templates.
+ * New templates are copied from this one by the
+ [firefox-profile](firefox-profile) script, but once they're copied, they're
+ effective _forked_.
+* `editor`:
+ * Usesful for editing bookmarks and moving them from one profile to another.
+* `regular`:
+ * Usesul a regular connection (i.e, not proxied through the Tor Network).
diff --git a/TODO.md b/TODO.md
index 4640904..5db3670 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1 +1,3 @@
# TODO
+
+* To be defined.
diff --git a/chrome/misc/include.css b/chrome/misc/include.css
new file mode 100644
index 0000000..6bb46df
--- /dev/null
+++ b/chrome/misc/include.css
@@ -0,0 +1,6 @@
+/**
+ * Example userChrome.css to include another one.
+ *
+ * You might also be interested in using symbolic links.
+ */
+@import url("../../../firefoxer/userChrome/userChrome.css");
diff --git a/chrome/misc/orig.css b/chrome/misc/orig.css
new file mode 100644
index 0000000..90a2e64
--- /dev/null
+++ b/chrome/misc/orig.css
@@ -0,0 +1,4 @@
+/**
+ * Old original userChrome.css
+ */
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
diff --git a/chrome/status/panel.css b/chrome/status/panel.css
new file mode 100644
index 0000000..0ef0368
--- /dev/null
+++ b/chrome/status/panel.css
@@ -0,0 +1,11 @@
+/**
+ * Some old status panel thing.
+ */
+
+/*
+#statuspanel {
+ right: 0;
+ display: inline;
+}
+*/
+
diff --git a/chrome/tabs/hide.css b/chrome/tabs/hide.css
new file mode 100644
index 0000000..db68534
--- /dev/null
+++ b/chrome/tabs/hide.css
@@ -0,0 +1,40 @@
+/**
+ * Hiding the tab bar.
+ *
+ * Works best with Tree Style Tab addon:
+ * https://github.com/piroor/treestyletab
+ */
+
+/**
+ * Hide horizontal tabs at the top of the window #1349, #1672, #2147
+ * https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#hide-horizontal-tabs-at-the-top-of-the-window-1349-1672-2147
+ */
+
+/*
+#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items {
+ opacity: 0;
+ pointer-events: none;
+}
+*/
+
+/**
+ * Always hide the tab bar.
+ */
+#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
+ visibility: collapse !important;
+}
+
+/**
+ * Only hide horizontal tabs if Tree Style Tabs sidebar is visible
+ * Only works in Firefox if layout.css.has-selector.enabled is set to true in about:config.
+ * https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#only-hide-horizontal-tabs-if-tree-style-tabs-sidebar-is-visible
+ */
+/*
+html#main-window body:has(#sidebar-box[sidebarcommand=treestyletab_piro_sakura_ne_jp-sidebar-action][checked=true]:not([hidden=true])) #TabsToolbar {
+ visibility: collapse !important;
+}
+*/
+/*#main-window body:has(#browser vbox[id="sidebar-box"][hidden=false]) #TabsToolbar {/*
+ visibility: collapse !important;
+}
+*/
diff --git a/chrome/tabs/tree.css b/chrome/tabs/tree.css
new file mode 100644
index 0000000..c41206a
--- /dev/null
+++ b/chrome/tabs/tree.css
@@ -0,0 +1,13 @@
+/**
+ * Tree Style Tab customizations
+ * https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules
+ */
+
+/**
+ * Hide the "Tree Style Tab" header at the top of the sidebar
+ * https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#hide-the-tree-style-tab-header-at-the-top-of-the-sidebar
+ */
+
+#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
+ display: none;
+}
diff --git a/chrome/tridactyl/main.css b/chrome/tridactyl/main.css
new file mode 100644
index 0000000..d636594
--- /dev/null
+++ b/chrome/tridactyl/main.css
@@ -0,0 +1,30 @@
+/**
+ * Tridactyl customizations.
+ * https://github.com/tridactyl/tridactyl
+ */
+
+:root:not([customizing]) #navigator-toolbox:not(:hover):not(:focus-within) #TabsToolbar {
+ visibility: collapse;
+}
+
+statuspanel[type="overLink"],
+#statuspanel[type="overLink"] {
+ display: none !important;
+}
+
+#TabsToolbar {
+ visibility: collapse;
+}
+
+#navigator-toolbox:not(:hover):not(:focus-within) #toolbar-menubar > * {
+ background-color: rgb(232, 232, 231);
+}
+
+#main-window[sizemode="maximized"] #content-deck {
+ padding-top: 8px;
+}
+
+#statuspanel {
+ right: 0;
+ display: inline;
+}
diff --git a/chrome/userChrome.css b/chrome/userChrome.css
new file mode 100644
index 0000000..b5b7aee
--- /dev/null
+++ b/chrome/userChrome.css
@@ -0,0 +1,6 @@
+/**
+ * userChrome.css for Firefoxer
+ */
+
+@import url("tabs/hide.css");
+@import url("tabs/tree.css");
diff --git a/firefox-dev b/firefox-dev
new file mode 100755
index 0000000..b04714c
--- /dev/null
+++ b/firefox-dev
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# Wrapper around firefox developer edition
+#
+
+# Parameters
+DIRNAME="`dirname $0`"
+
+if [ -e "$HOME/.local/bin/firefox-dev" ]; then
+ # Manually or hoarder installed
+ $HOME/.local/bin/firefox-dev
+elif which hoarder &> /dev/null; then
+ hoarder install firefox-dev && $HOME/.local/bin/firefox-dev
+elif which flatpak &> /dev/null; then
+ if ! flatpak list | grep -q ^org.mozilla.FirefoxDevEdition; then
+ # Install
+ sudo flatpak install -y --from https://firefox-flatpak.mojefedora.cz/org.mozilla.FirefoxDevEdition.flatpakref
+
+ # Run this script again
+ $0
+ else
+ # Check and set tridactyl
+ if [ -e "$DIRNAME/../tridactyl/native/tridactyl.json" ]; then
+ native="$HOME/.mozilla/native-messaging-hosts/"
+
+ if [ ! -e "$native/tridactyl.json" ]; then
+ mkdir -p $native
+
+ tridactyl="`cd $DIRNAME/../tridactyl/native/ &> /dev/null && pwd`"
+ cp $tridactyl/tridactyl.json $native
+ sed -i -e "s|REPLACE_ME_WITH_SED|$tridactyl/native_main.py|g" $native/tridactyl.json
+ fi
+ fi
+
+ flatpak run org.mozilla.FirefoxDevEdition &
+
+ # Woraround while we dont fix this issue
+ # https://elementaryos.stackexchange.com/questions/6796/why-does-firefox-keep-creating-a-desktop-folder
+ # https://superuser.com/questions/1266254/prevent-firefox-from-creating-desktop-folder
+ # http://docs.flatpak.org/en/latest/working-with-the-sandbox.html
+ # https://www.mankier.com/1/flatpak-override
+ while ! [ -d "$HOME/Desktop" ]; do
+ sleep 2
+ done
+
+ rmdir $HOME/Desktop $HOME/Downloads &> /dev/null
+ fi
+else
+ # Install flatpak
+ sudo apt install flatpak -y
+
+ # Run this script again
+ $0
+fi
diff --git a/firefox-profile b/firefox-profile
new file mode 100755
index 0000000..34380f2
--- /dev/null
+++ b/firefox-profile
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# Wrapper around firefox
+#
+
+# Parameters
+BASE="$HOME/.mozilla/firefox"
+PROFILES="$BASE/profiles"
+
+# Check
+if ! which firefox &> /dev/null; then
+ echo "Please install firefox"
+ exit 1
+fi
+
+# Dispatch
+if [ ! -z "$1" ] && [ "$1" == "private" ]; then
+ firefox -private-window
+elif [ ! -z "$1" ]; then
+ if [ ! -d "$PROFILES/$1" ]; then
+ firefox -no-remote -CreateProfile "$1 $PROFILES/$1"
+
+ if [ -d "$PROFILES/template" ] && [ "$1" != "template" ]; then
+ rm -rf $PROFILES/$1 && cp -a $PROFILES/template $PROFILES/$1
+ fi
+ fi
+
+ firefox -p $1 -new-instance &
+else
+ firefox --profilemanager -new-instance &
+fi