Difference between revisions of "Qutebrowser"

From ArchWiki
Jump to: navigation, search
(Tips and tricks: spell checking)
(Change the 'User Configuration' section because qutebrowser's configuration system changed on the latest qutebrowser update.)
Line 16: Line 16:
 
=== User configuration ===
 
=== User configuration ===
  
You will find the configuration files of qutebrowser under {{ic|$XDG_CONFIG_HOME/qutebrowser/}}. The main configuration happens in the file {{ic|qutebrowser.conf}}, which is organized in sections like an ini-file. For example, under {{ic|[searchengines]}} you can configure your search engines as described by the comment. To add a shortcut for searching the the arch wiki, add this line:
+
Qutebrowser can be configured via the UI, the qutebrowser command-line or a python script. Qutebrowser's own documentation explains in detail how to configure qutebrowser with these different methods. To open qutebrowser's help system, type {{ic|:help}}. On the help page, choose {{ic|Configuring qutebrowser}}.
  
aw = <nowiki>https://wiki.archlinux.org/?search={}</nowiki>
+
To find out the paths where the configuration files will be located, open the special page {{ic|qute://version}}. On Archlinux, this will typically be {{ic|$XDG_CONFIG_HOME/qutebrowser/}}. The configuration made in qutebrowser will be stored in {{ic|autoconfig.yml}} (which should not be touched by the user) while the user's python script is {{ic|config.py}}.
  
Now, in qutebrowser you can search the Arch Linux wiki for an article about qutebrowser via {{ic|:open aw qutebrowser}} which will bring you to this page. As per the standard configuration the key mapping {{ic|o}} will subsitute {{ic|:open}}, so typing {{ic|o aw ''your_search_term''}} will henceforth allow you to quickly search the arch wiki. Notice that the arguments required to perform a search vary across search engines, for example, to set up Google use:
+
==== Configuration in Qutebrowser ====
 +
To set a single configuration item, you can simply type {{ic|:set}} followed by the name of the configuration item and the new value that you would like to set. For example, you could type
  
  g = <nowiki>https://www.google.com/search?hl=en&q={}</nowiki>
+
  :set auto_save.session true
  
You can also make this setting from the browser with {{ic|:set searchengines ''keyword'' ''your_search_term''}}. For example:
+
to open your previous tabs when you reopen qutebrowser.
  
  :set searchengines aw <nowiki>https://wiki.archlinux.org/?search={}</nowiki>
+
To open qutebrowser's UI settings page, type
 +
 
 +
  :set
 +
 
 +
without further arguments. There, you can edit the different settings in the UI. When you are finished, type {{ic|:set}} again to store your configuration.
 +
 
 +
For example, under {{ic|url.searchengines}} you can configure your search engines which are stored as a list of key-value pairs. When you have not changed this setting yet, this should look something like
 +
 
 +
{"DEFAULT": "<nowiki>https://duckduckgo.com/?q={}</nowiki>"}
 +
 
 +
This configures duckduckgo as your default search engine while the placeholder {{ic|<nowiki>{}</nowiki>}} will be replaced by your search term. To add a shortcut for quickly searching the arch wiki, you could use
 +
 
 +
{"DEFAULT": "<nowiki>https://duckduckgo.com/?q={}</nowiki>", "wa": "<nowiki>https://wiki.archlinux.org/?search={}</nowiki>"}
 +
 
 +
Then, as described by the comment in the qutebrowser UI, you can search the arch wiki by typing {{ic|o wa <searchterm>}}. Notice that the arguments required to perform a search vary across search engines. For example, to set up Google, use {{ic|<nowiki>https://www.google.com/search?hl=en&q={}</nowiki>}}.
  
 
=== Keybindings ===
 
=== Keybindings ===

Revision as of 08:30, 17 October 2017

qutebrowser is a keyboard-focused web browser based on Python and PyQt5.

Installation

Install either the qutebrowser or the qutebrowser-gitAUR package.

Basic usage

Use : to access the command prompt. You can use Tab to auto-complete.

On first usage of qutebrowser, a Quickstart page appears. It is later accessible via :help. See the cheatsheet for keyboard shortcuts.

User configuration

Qutebrowser can be configured via the UI, the qutebrowser command-line or a python script. Qutebrowser's own documentation explains in detail how to configure qutebrowser with these different methods. To open qutebrowser's help system, type :help. On the help page, choose Configuring qutebrowser.

To find out the paths where the configuration files will be located, open the special page qute://version. On Archlinux, this will typically be $XDG_CONFIG_HOME/qutebrowser/. The configuration made in qutebrowser will be stored in autoconfig.yml (which should not be touched by the user) while the user's python script is config.py.

Configuration in Qutebrowser

To set a single configuration item, you can simply type :set followed by the name of the configuration item and the new value that you would like to set. For example, you could type

:set auto_save.session true

to open your previous tabs when you reopen qutebrowser.

To open qutebrowser's UI settings page, type

:set

without further arguments. There, you can edit the different settings in the UI. When you are finished, type :set again to store your configuration.

For example, under url.searchengines you can configure your search engines which are stored as a list of key-value pairs. When you have not changed this setting yet, this should look something like

{"DEFAULT": "https://duckduckgo.com/?q={}"}

This configures duckduckgo as your default search engine while the placeholder {} will be replaced by your search term. To add a shortcut for quickly searching the arch wiki, you could use

{"DEFAULT": "https://duckduckgo.com/?q={}", "wa": "https://wiki.archlinux.org/?search={}"}

Then, as described by the comment in the qutebrowser UI, you can search the arch wiki by typing o wa <searchterm>. Notice that the arguments required to perform a search vary across search engines. For example, to set up Google, use https://www.google.com/search?hl=en&q={}.

Keybindings

Keybindings reside in $XDG_CONFIG_HOME/qutebrowser/keys.conf.

You can edit the keybindings directly from the browser with the command :bind key command or you can edit them directly from the file. Notice that there are many, many keybinds already in place. If you notice a lag on one of your keybind it is because some other keybind is also starting with the same key.

Video playback

See Browser plugins#Multimedia playback.

Tips and tricks

Turn on spell checking

First, download the dictionaries you want using this script. For example, to install the English dictionary do:

# python install_dict.py en-US

Then set the following in qutebrowser:

:set spellcheck.languages ["en-US"]

Minimize fingerprinting

Websites may be able to identify you based on combining information on screen size, user-agent, HTTP_ACCEPT headers, and more. See [1] for more information and to test the uniqueness of your browser. Below are a few steps that can be taken to make your qutebrowser installation more "generic".

Additionally see Firefox/Privacy#Configuration tweaks for more ideas.

Set a common user-agent

Several user agents are available as options when using :set network user-agent. Another, possibly more generic user-agent is:

Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Note:
  • Changing Linux x86_64 to a non-Linux platform may make your browser more unique, since websites can also gather your platform type via Javascript, and this setting cannot be changed in qutebrowser.
  • Changing your user-agent away from the default will prevent some websites from working properly.

Set a common HTTP_ACCEPT header

The following is a common HTTP_ACCEPT header. Under network in qutebrowser's settings set:

accept-language = en-US,en;q=0.5
custom-headers = {"accept": "text/html, */*; q=0.01"}

Disable reading from canvas

This option is not currently available in qutebrowser other than by specifying it on the commandline like so:

$ qutebrowser --qt-flag disable-reading-from-canvas

See issue #2235 for more information.

Note: Some websites depend on canvas reading for content rendering and other functionality. Adding this option may cause them to not work properly [2].

dwb-like session handling

To have qutebrowser handle sessions more like in dwb with the --restore option (multiple simultaneously active sessions), you can use this wrapper script. It uses --basedir to separate data, cache and runtime for each session, while keeping the configuration shared.

See also