firefox-gnome-theme/README.md

194 lines
6.4 KiB
Markdown
Raw Normal View History

2019-06-13 06:54:29 +03:00
<h1 align="center">
2019-06-13 17:03:52 +03:00
<img src="icon.svg" alt="Firefox GNOME theme" width="100" height="100"/><br>
2019-06-13 06:54:29 +03:00
Firefox GNOME theme
</h1>
2019-06-13 06:49:25 +03:00
2019-07-10 01:13:29 +03:00
[![GitHub](https://img.shields.io/github/license/rafaelmardojai/firefox-gnome-theme.svg)](https://github.com/rafaelmardojai/firefox-gnome-theme/blob/master/LICENSE)
2019-07-10 01:10:40 +03:00
[![Donate](https://img.shields.io/badge/PayPal-Donate-gray.svg?style=flat&logo=paypal&colorA=0071bb&logoColor=fff)](https://paypal.me/RafaelMardojaiCM)
2019-07-10 01:11:57 +03:00
2019-07-19 15:29:55 +03:00
<p align="center"><strong>A GNOME theme for Firefox</strong></p>
2019-06-02 18:37:29 +03:00
2019-07-19 15:29:55 +03:00
<p align="center">This theme follows lastest GNOME Adwaita style.</p>
2019-06-04 03:00:43 +03:00
2017-12-02 01:18:56 +02:00
![Screenshot of the theme](screenshot.png)
## Description
2019-07-19 15:29:55 +03:00
This is a bunch of CSS code to make Firefox look closer to GNOME's native apps.
2017-12-02 01:18:56 +02:00
This theme is supposed to work with current supported Firefox releases:
2019-09-10 01:34:48 +03:00
- Firefox 69
2019-08-27 02:48:29 +03:00
- Firefox 60 ESR*
2019-07-24 21:05:54 +03:00
- Firefox 68 ESR
2019-09-10 01:34:48 +03:00
- Firefox 70 Beta
- Firefox 71 Nightly
2019-07-14 21:11:40 +03:00
***Firefox 60 ESR issues:***
*(Dark theme variant is broken in Firefox < 67).*
*https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme#Browser_compatibility*
2017-12-02 01:18:56 +02:00
## Installation
2019-06-13 06:49:25 +03:00
### Installation script
2019-07-13 08:54:45 +03:00
```sh
git clone https://github.com/rafaelmardojai/firefox-gnome-theme/ && cd firefox-gnome-theme
2019-07-19 15:29:55 +03:00
./scripts/install.sh
2019-07-13 08:54:45 +03:00
```
#### Script options
- -f `<firefox_folder>` *optional*
- Set custom Firefox folder path, for example `~/.mozilla/icecat/`.
- Default: `~/.mozilla/firefox/`
- -p `<profile_folder>` *optional*
- Set custom profile folder name, for example `e0j6yb0p.default-nightly`
- Default: `*.default` (standard default profile)
- -g *optional*
- Auto enable GNOMISH extra features `hide-single-tab.css` & `matching-autocomplete-width.css`
2019-06-13 06:49:25 +03:00
2019-06-04 18:26:47 +03:00
### Manual installation
1. Go to `about:support` in Firefox.
2019-07-13 08:54:45 +03:00
2019-06-04 18:26:47 +03:00
2. Application Basics > Profile Directory > Open Directory.
2019-07-13 08:54:45 +03:00
3. Open directory in a terminal.
4. Create a `chrome` directory if it doesn't exist.
```sh
mkdir -p chrome
cd chrome
```
5. Clone this repo to a subdirectory:
```sh
git clone https://github.com/rafaelmardojai/firefox-gnome-theme.git
```
6. Create single-line user CSS files if non-existent or empty (at least one line is needed for `sed`):
```sh
[[ -s userChrome.css ]] || echo >> userChrome.css
```
7. Import this theme at the beginning of the CSS files (all `@import`s must come before any existing `@namespace` declarations):
```sh
sed -i '1s/^/@import "firefox-gnome-theme\/userChrome.css";\n/' userChrome.css
```
8. Symlink preferences file:
```sh
ln -s chrome/firefox-gnome-theme/configuration/user.js ../user.js
```
9. Restart Firefox.
10. Open Firefox customization panel and move the new tab button to headerbar.
11. Be happy with your new gnomish Firefox.
2019-06-04 18:26:47 +03:00
2019-07-24 21:06:25 +03:00
## Updating
2019-07-27 22:02:06 +03:00
Both manual and script installation methods should create a git clone in `your-profile-folder-path/chrome/firefox-gnome-theme`, so the easiet way to update the theme is to open this folder in terminal and perform a git pull.
```sh
git pull origin master
```
2019-07-24 21:06:25 +03:00
> Note: Running installation script to update after cloning again the repo can work, but also can introduce duplication in CSS sheets.
## Uninstalling/removing the theme
2019-10-04 17:33:21 +03:00
1. Go to your profile folder. (Go to `about:support` in Firefox > Application Basics > Profile Directory > Open Directory)
2. Remove `chrome` folder.
2019-06-13 06:49:25 +03:00
## Enabling optional features
2019-07-17 03:41:53 +03:00
Open `chrome/firefox-gnome-theme/userChrome.css` with a text editor and follow instructions to enable extra features. Keep in mind this file might change in future versions and your configuration will be lost. You can copy the @imports you want to enable to a new file named `customChrome.css` directly in your `chrome/firefox-gnome-theme` directory if you want it to survive updates. Remember all @imports must be at the top of the file, before other statements.
Alternatively you can run installation script with `-g` flag to auto install GNOMISH features.
```sh
./scripts/install.sh -g
```
*Those features are not included by default, because can introduce bugs or Firefox functionalities lost.*
- **hide-single-tab.css** *GNOMISH*
Hide the tab bar when only one tab is open.
You should move the new tab button somewhere else for this to work, because by default it is on the tab bar too.
2019-10-04 17:33:21 +03:00
- **matching-autocomplete-width.css** *GNOMISH (FF 60-69)*
2019-07-17 03:41:53 +03:00
Limit the URL bar's autocompletion popup's width to the URL bar's width.
2019-10-04 17:33:21 +03:00
*This feature is included by default for Firefox 70+*
- **rounded-title-buttons.css** *GNOMISH*
Rounded title buttons (headerbar window controls).
2019-07-17 03:41:53 +03:00
- **active-tab-contrast.css**
Active tab better contrast.
2019-07-17 03:41:53 +03:00
- **system-icons.css**
Use system theme icons instead of Adwaita icons included by theme.
- **drag-window-headerbar-buttons.css**
Allow drag window from headerbar buttons *GNOMISH* **[BUGGED]**
It can activate button action, with unpleasant behavior.
2019-07-17 03:41:53 +03:00
- **symbolic-tab-icons.css**
Make all tab icons look kinda like symbolic icons.
2019-06-13 06:49:25 +03:00
## Known bugs
### CSD have sharp corners
See upstream [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1408360).
2019-07-17 03:41:53 +03:00
### Icons color broken with system-icons.css
Icons might appear black where they should be white on some systems. I have no idea why, but you can adjust them directly in the `system-icons.css` file, look for `--gnome-icons-hack-filter` & `--gnome-window-icons-hack-filter` vars and play with css filters.
2017-12-02 01:18:56 +02:00
## Development
If you wanna mess around the styles and change something, you might find these
things useful.
2017-12-02 01:18:56 +02:00
To use the Inspector to debug the UI, open the developer tools (F12) on any
page, go to options, check both of those:
2017-12-02 15:59:57 +02:00
- Enable browser chrome and add-on debugging toolboxes
- Enable remote debugging
2017-12-02 01:18:56 +02:00
Now you can close those tools and press Ctrl+Alt+Shift+I to Inspect the browser
UI.
Also you can inspect any GTK3 application, for example type this into a terminal
and it will run Epiphany with the GTK Inspector, so you can check the CSS styles
of its elements too.
2017-12-02 15:59:57 +02:00
```sh
GTK_DEBUG=interactive epiphany
```
2017-12-02 01:18:56 +02:00
Feel free to use any parts of my code to develop your own themes, I don't force
any specific license on your code.
2019-06-02 21:39:11 +03:00
## Credits
2019-07-19 15:29:55 +03:00
Developed by **[Rafael Mardojai CM](https://github.com/rafaelmardojai)** and [contributors](https://github.com/rafaelmardojai/firefox-gnome-theme/graphs/contributors). Based on **[Sai Kurogetsu](https://github.com/kurogetsusai/firefox-gnome-theme)** original work.
2019-07-10 00:39:42 +03:00
2019-07-13 08:54:45 +03:00
## Donate
2019-07-19 15:29:55 +03:00
If you want to support development, consider donating via [PayPal](https://paypal.me/RafaelMardojaiCM). Also consider donating upstream, [Firefox](https://donate.mozilla.org/) & [GNOME](https://www.gnome.org/support-gnome/).