lariza

Lariza is a lightweight webkit2gtk browser, with low resource consumption, binary size and few dependencies. Lariza features tabbed browsing, custom user scripts, ad blocking and grep-like search functionality among other features. Furthermore, the user interface can be controlled entirely using keyboard shortcuts.

Installation

Lariza is available in the AUR as larizaAUR and lariza-gitAUR. Alternatively, source code is available on Uninformativ which can be built using make.

Configuration

Environment variables

Below is a list of environment variables you can export in your shell's rc file, accompanied by their default values.

LARIZA_ACCEPTED_LANGUAGE=en-US
LARIZA_DOWNLOAD_DIR=/var/tmp
LARIZA_ENABLE_CONSOLE_TO_STDOUT=
LARIZA_FIFO_SUFFIX=/var/run/user/$UID/lariza.fifo-$LARIZA_FIFO_SUFFIX
LARIZA_HISTORY_FILE=
LARIZA_HOME_URI=about:blank
LARIZA_TAB_POS=top
LARIZA_TAB_WIDTH_CHARS=20
LARIZA_USER_AGENT=
LARIZA_ZOOM=1.0
Tip: For further information about what these variables change and what their possible values are, see man lariza

Configuration files

Lariza can be further configured by modifying the following files:

$XDG_CONFIG_HOME/lariza/adblock
$XDG_CONFIG_HOME/lariza/certs
$XDG_CONFIG_HOME/lariza/scripts
$XDG_DATA_HOME/lariza/web_extensions
$XDG_CACHE_HOME/lariza
$XDG_CACHE_HOME/webkitgtk
$XDG_DATA_HOME/webkitgtk

Adblock

Support for blocking ads or URIs in general can be configured by creating $XDG_CONFIG_HOME/lariza/adblock with regular expressions. Case-insensitive regexp and partial matches with glob wildcards are supported.

.*/ad/.*
.*/ads/.*
^https?://ad.*
^https?://advert.*
^https?://.*\.advertising\.com/
Note: In versions <21.01, the adblock file is located in ~/.config/lariza/adblock.black

User Scripts

After a page has been successfully loaded, the directory ~/.config/lariza/user-scripts will be scanned and each file in it ending with .js will be run as a JavaScript file in the context of said page.

Note: In versions <20.03, the scripts folder is located in ~/.config/lariza/scripts

Web Extensions

On startup, WebKit checks $XDG_CONFIG_HOME/lariza/web_extensions for any .so files. For more information see this blog post.

Trusted certificates

You can add your own _self-signed) certificates in $XDG_CONFIG_HOME/lariza/certs

Keybindings

Custom keybindings can be added (and existing ones can be modified) by changing the file.

Examples

  • You can change to to change keybings using the ALt (Mod1) key to using Control.
  • A keybind containing the line
 webkit_settings_set_enable_javascript(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(c->web_view)), FALSE);

can be added to disable JavaScript.

Default key bindings

  • close window
  • home
  • Mod1+e new tab
  • Mod1+r reload
  • download manager
  • search forward
  • search forward
  • search backward
  • location
  • initiate search
  • reload trusted certs
  • go one tab to the left
  • Mod1+s go one tab to the right
  • navigate forward
  • navigate backward

Speed Dial home page

You can create a static/dynamic HTML page with a list of links to serve as a Speed Dial page to be called with the home page key binding. See Lariza Speed Dial Example for a sample static page.

Note: Set the Lariza home page environment variable accordingly: LARIZA_HOME_URI=file:///home/example/.config/lariza/bookmarks.html

Disabling JavaScript

Lariza enables JavaScript by default by passes through the default configuration of the underlying engine. Disabling JavaScript requires rebuilding webkit2gtk with the variable set.

As mentioned earlier, the line

webkit_settings_set_enable_javascript(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(c->web_view)), FALSE);

can also be added to disable JavaScript. When doing this is recommended to also make keybindings to re-enable JavaScript when needed.

Patches

The developer of Lariza has made it clear that features will only be added to suit their own personal needs. The user is therefore encouraged to patch and modify the source code. For inspiration and information, one may check the PATCHES file.

Using Lariza

lariza [-C] [URI ...]

  • Disable cooperative instances
$ lariza -C
  • Append Lariza with multiple URIs to open in separate tabs:
$ lariza archlinux.org duck.com example.org
  • Prepend Lariza with environment variables to switch the default cache and local storage locations to :
$ XDG_CACHE_HOME=/dev/null XDG_DATA_HOME=/dev/null lariza
  • Improve upon the previous example by setting the configuration files directory to tmpfs and running the profile completely in memory:
$ XDG_CONFIG_HOME=/tmp XDG_CACHE_HOME=/dev/null XDG_DATA_HOME=/dev/null lariza
  • Set Lariza to launch within a firejail sandbox using a spectrwm window manager key binding:
# ~/.spectrwm.conf 

program[lariza] = firejail lariza -C
bind[lariza] = Mod+l

For complete documentation, review the latest README and man pages available on the Lariza project page.

gollark: Well, technically you submit the forms over IPoAC (Internet Protocol over Apian Carriers).
gollark: What? No. We have an application process. A mgollark instance processes application forms.
gollark: Well, you can learn from world experts on apiology, apiomemetics, apiomnestics, apiodynamic theory and apionics here.
gollark: Horse does it.
gollark: Nope. It isn't my bot.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.