dotfiles/qutebrowser/config/config.py

94 lines
2.5 KiB
Python
Raw Normal View History

import os
from typing import cast
# pylint: disable=C0111
from qutebrowser.config.config import ConfigContainer # noqa: F401
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
config: ConfigAPI = cast(ConfigAPI, config) # noqa: F821 pylint: disable=E0602,C0103
c: ConfigContainer = cast(ConfigContainer, c) # noqa: F821 pylint: disable=E0602,C0103
2019-05-16 12:25:19 +00:00
# Autogenerated config.py
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# load additional settings configured via autoconfig.yml
_ = config.load_autoconfig()
c.content.javascript.log_message.excludes = {
"userscript:_qute_stylesheet": [
"*Refused to apply inline style because it violates the following Content Security Policy directive: *"
],
"userscript:_qute_js": ["*TrustedHTML*"],
}
2019-05-16 12:25:19 +00:00
kitty: Switch to kitty terminal emulator Finally made the switch from alacritty to kitty. I have been thinking about this for a while. Both, fundamentally, serve my purposes just fine. Both are fast, customizable, gpu accelerated, and so on. Kitty feels a little faster on the input, but this should not provide major differences. One big difference, however, is now very apparent and I can feel it: Alacritty, on wayland, does not support any picture preview. It does not support sixel, and things like w3mimg or ueberzug are based on and require X11 to run. Kitty brings its own graphics display library and it seems both pretty stable and fast. I have not done much more with it than use it in things like vifm image previews but it should be much more stable than things like ueberzug, much faster than things like sixel. Time will tell. Switched other modules to make use of kitty instead of alacritty: vifm uses kitty previews, river spawns kitty instances, systemd units use kitty instances, waybar presents extra mouse-click interactions through kitty, and styler contains a processor to style kitty permanently. I would love to converge this all a bit more on the `$TERMINAL` env var, but this is unfortunately difficult for things like systemd and waybar. For waybar I currently see no real way except for a custom `ideal-terminal` script which just goes down the list of terminal emulators I want to run, depending on which is installed, since it does not read env vars, while for systemd it might be feasible to import user environment variables, but also connected to additional complexity and overhead which it does not seem worth for the currently two simple service units it affects. Also removed some obsolete sxhkd and sh settings from the move to wayland.
2022-01-16 14:18:07 +00:00
term = os.getenv("TERMINAL", "xterm")
c.completion.web_history.max_items = 1000
c.hints.uppercase = True
c.editor.command = [
kitty: Switch to kitty terminal emulator Finally made the switch from alacritty to kitty. I have been thinking about this for a while. Both, fundamentally, serve my purposes just fine. Both are fast, customizable, gpu accelerated, and so on. Kitty feels a little faster on the input, but this should not provide major differences. One big difference, however, is now very apparent and I can feel it: Alacritty, on wayland, does not support any picture preview. It does not support sixel, and things like w3mimg or ueberzug are based on and require X11 to run. Kitty brings its own graphics display library and it seems both pretty stable and fast. I have not done much more with it than use it in things like vifm image previews but it should be much more stable than things like ueberzug, much faster than things like sixel. Time will tell. Switched other modules to make use of kitty instead of alacritty: vifm uses kitty previews, river spawns kitty instances, systemd units use kitty instances, waybar presents extra mouse-click interactions through kitty, and styler contains a processor to style kitty permanently. I would love to converge this all a bit more on the `$TERMINAL` env var, but this is unfortunately difficult for things like systemd and waybar. For waybar I currently see no real way except for a custom `ideal-terminal` script which just goes down the list of terminal emulators I want to run, depending on which is installed, since it does not read env vars, while for systemd it might be feasible to import user environment variables, but also connected to additional complexity and overhead which it does not seem worth for the currently two simple service units it affects. Also removed some obsolete sxhkd and sh settings from the move to wayland.
2022-01-16 14:18:07 +00:00
term,
"start",
"--always-new-process",
"nvim",
"-f",
"{file}",
"-c",
"normal {line}G{column0}l",
]
# change filepicker
c.fileselect.handler = "external"
picker = [
kitty: Switch to kitty terminal emulator Finally made the switch from alacritty to kitty. I have been thinking about this for a while. Both, fundamentally, serve my purposes just fine. Both are fast, customizable, gpu accelerated, and so on. Kitty feels a little faster on the input, but this should not provide major differences. One big difference, however, is now very apparent and I can feel it: Alacritty, on wayland, does not support any picture preview. It does not support sixel, and things like w3mimg or ueberzug are based on and require X11 to run. Kitty brings its own graphics display library and it seems both pretty stable and fast. I have not done much more with it than use it in things like vifm image previews but it should be much more stable than things like ueberzug, much faster than things like sixel. Time will tell. Switched other modules to make use of kitty instead of alacritty: vifm uses kitty previews, river spawns kitty instances, systemd units use kitty instances, waybar presents extra mouse-click interactions through kitty, and styler contains a processor to style kitty permanently. I would love to converge this all a bit more on the `$TERMINAL` env var, but this is unfortunately difficult for things like systemd and waybar. For waybar I currently see no real way except for a custom `ideal-terminal` script which just goes down the list of terminal emulators I want to run, depending on which is installed, since it does not read env vars, while for systemd it might be feasible to import user environment variables, but also connected to additional complexity and overhead which it does not seem worth for the currently two simple service units it affects. Also removed some obsolete sxhkd and sh settings from the move to wayland.
2022-01-16 14:18:07 +00:00
term,
"start",
"--class",
"float",
"vifm",
"--choose-files",
"{}",
]
c.fileselect.single_file.command = picker
c.fileselect.multiple_files.command = picker
c.downloads.location.directory = os.getenv("XDG_DOWNLOAD_DIR", "~/downloads")
c.downloads.location.prompt = False
config.source("alias.py")
qutebrowser: Add proxying support for websites Added automatic proxying to floss alternative frontends for proprietary websites like reddit (teddit), youtube (invidious), twitter (nitter), and instagram (bibliogram). Often does not work on calling cached websites, meaning when it does not load the correct page a full reload (shift-R) should call up the correct frontend on first use of a previously visited page. Squashed commit of the following: commit ccf5a9f9a001c466e4fe00763f561d09a598bd70 Author: Marty Oehme <marty.oehme@gmail.com> Date: Wed Jul 28 10:05:37 2021 +0200 qutebrowser: Add LocalLeader key concept Added differentiation between leader mappings and local leader mappings, with a similar idea to vim: leader mappings enact changes within qutebrowser on a more general level (currently e.g. changing tab display, javascript switch, stylesheet setting) while local leader mappings enact changes or interact with the current page context (e.g. start mpv stream, display in readability mode, download pdf version of page, and so on). This will be hard for my muscle memory, but I think such a switch benefits logical action separation in the long run, especially in case I add more action shortcuts over time. An interesting thing this separation also allows is a more buffer-specific action repertoire (for example through recognition of current page context with interceptors) so specific pages contain different actions. commit afbe573d527b70fa57d643ede78cd5e71f3ca4c1 Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 16:00:37 2021 +0200 qutebrowser: Rename key mapping file Renamed from `keys.py` to `maps.py` to keep some coherence with nvim naming scheme. commit cc78cbb67953bba7ab4d5a6dd48dfa50fbcfe2fc Author: Marty Oehme <marty.oehme@gmail.com> Date: Tue Jul 27 10:19:34 2021 +0200 qutebrowser: Add reddit redirection Added redirection to old.reddit whenever a link on reddit is opened. Added redirection of youtube links to yewtu.be invidious instance.
2021-08-18 20:28:50 +00:00
config.source("maps.py")
config.source("content.py")
config.source("searchengines.py")
config.source("redirects.py")
# Tab-Bar
# have tab bar on the right, not on the top
c.tabs.background = True
c.tabs.title.format = "{index} {audio}{perc}{current_title}"
c.tabs.position = "right"
c.tabs.width = "15%"
c.tabs.show = "multiple"
c.tabs.show_switching_delay = 2000
c.statusbar.show = "always"
c.colors.webpage.bg = "#555555"
# Prevents *all* tabs from being loaded on restore, only loads on activating them
c.session.lazy_restore = True
# for code_select.py userscript
# Allows copying code sections to clipboard easily
c.hints.selectors["code"] = [
# Selects all code tags whose direct parent is not a pre tag
":not(pre) > code",
"pre",
]
# give the browser nice theme colors
state_dir = os.environ.get("XDG_STATE_HOME", f"{os.environ['HOME']}/.local/state")
colorscheme = f"{state_dir}/qutebrowser/colorscheme.py"
if os.path.isfile(colorscheme):
config.source(colorscheme)
c.url.start_pages = "https://start.duckduckgo.com/html"