~pvsr/dotfiles

bac362dbcd87c032aca7b482e64119585da0f8f5 — Peter Rice 3 years ago 968ee14
add conf.d contents for qutebrowser
A qutebrowser/.config/qutebrowser/conf.d/colors.py => qutebrowser/.config/qutebrowser/conf.d/colors.py +150 -0
@@ 0,0 1,150 @@
dark0_hard = "#1d2021"
dark0 = "#282828"
dark0_soft = "#32302f"
dark1 = "#3c3836"
dark2 = "#504945"
dark3 = "#665c54"
dark4 = "#7c6f64"

gray = "#928374"

light0_hard = "#f9f5d7"
light0 = "#fbf1c7"
light0_soft = "#f2e5bc"
light1 = "#ebdbb2"
light2 = "#d5c4a1"
light3 = "#bdae93"
light4 = "#a89984"

bright_red = "#fb4934"
bright_green = "#b8bb26"
bright_yellow = "#fabd2f"
bright_blue = "#83a598"
bright_purple = "#d3869b"
bright_aqua = "#8ec07c"
bright_orange = "#fe8019"

neutral_red = "#cc241d"
neutral_green = "#98971a"
neutral_yellow = "#d79921"
neutral_blue = "#458588"
neutral_purple = "#b16286"
neutral_aqua = "#689d6a"
neutral_orange = "#d65d0e"

faded_red = "#9d0006"
faded_green = "#79740e"
faded_yellow = "#b57614"
faded_blue = "#076678"
faded_purple = "#8f3f71"
faded_aqua = "#427b58"
faded_orange = "#af3a03"

def hexColorToDecStr(color):
    num = int(color[1:], 16)
    b = num & 0xff
    g = (num & (0xff << 8)) >> 8
    r = (num & (0xff << 16)) >> 16
    return str(r) + ', ' + str(g) + ', ' + str(b)

c.colors.completion.even.bg = dark0
c.colors.completion.odd.bg = dark1
c.colors.completion.fg = [bright_green, light3, neutral_orange]
c.colors.completion.match.fg = bright_red

c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 ' + gray + ', stop:1 ' + dark2 + ')'
c.colors.completion.category.fg = light1
c.colors.completion.category.border.top = dark1
c.colors.completion.category.border.bottom = dark1

c.colors.completion.item.selected.bg = bright_yellow
c.colors.completion.item.selected.fg = dark0
c.colors.completion.item.selected.border.top = neutral_yellow
c.colors.completion.item.selected.border.bottom = neutral_yellow

c.colors.completion.scrollbar.bg = dark1
c.colors.completion.scrollbar.fg = light1

c.colors.downloads.bar.bg = dark0
c.colors.downloads.error.bg = neutral_red
c.colors.downloads.error.fg = light1
c.colors.downloads.start.bg = faded_blue
c.colors.downloads.start.fg = light1
c.colors.downloads.stop.bg = faded_green
c.colors.downloads.stop.fg = light1
c.colors.downloads.system.bg = 'rgb'
c.colors.downloads.system.fg = 'rgb'

c.colors.hints.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1,' \
    + ' stop:0 rgba(' + hexColorToDecStr(light1) + ', 0.8),' \
    + ' stop:1 rgba(' + hexColorToDecStr(light4)  + ', 0.8))'
c.colors.hints.fg = dark0
c.colors.hints.match.fg = neutral_green

c.colors.keyhint.bg = 'rgba(' + hexColorToDecStr(dark0) + ', 80%)'
c.colors.keyhint.fg = light1
c.colors.keyhint.suffix.fg = bright_yellow

c.colors.messages.error.bg = neutral_red
c.colors.messages.error.border = faded_red
c.colors.messages.error.fg = light1

c.colors.messages.info.bg = dark0
c.colors.messages.info.border = dark1
c.colors.messages.info.fg = light1

c.colors.messages.warning.bg = neutral_orange
c.colors.messages.warning.border = faded_orange
c.colors.messages.warning.fg = light1

c.colors.prompts.bg = dark1
c.colors.prompts.selected.bg = gray
c.colors.prompts.border = '1px solid ' + gray
c.colors.prompts.fg = light1

c.colors.statusbar.normal.bg = dark0
c.colors.statusbar.normal.fg = light1

c.colors.statusbar.progress.bg = light1

c.colors.statusbar.caret.bg = faded_purple
c.colors.statusbar.caret.fg = light1
c.colors.statusbar.caret.selection.bg = neutral_purple
c.colors.statusbar.caret.selection.fg = light1

c.colors.statusbar.command.bg = dark0
c.colors.statusbar.command.fg = light1

c.colors.statusbar.command.private.bg = dark2
c.colors.statusbar.command.private.fg = light1

c.colors.statusbar.insert.bg = faded_green
c.colors.statusbar.insert.fg = light1

c.colors.statusbar.passthrough.bg = faded_blue
c.colors.statusbar.passthrough.fg = light1

c.colors.statusbar.private.bg = dark1
c.colors.statusbar.private.fg = light1

c.colors.statusbar.url.fg = light1
c.colors.statusbar.url.success.http.fg = light1
c.colors.statusbar.url.success.https.fg = bright_green
c.colors.statusbar.url.hover.fg = bright_aqua
c.colors.statusbar.url.warn.fg = neutral_yellow
c.colors.statusbar.url.error.fg = bright_orange

c.colors.tabs.bar.bg = dark2
c.colors.tabs.indicator.error = bright_red
c.colors.tabs.indicator.start = neutral_blue
c.colors.tabs.indicator.stop = neutral_green
c.colors.tabs.indicator.system = 'rgb'
c.colors.tabs.even.bg = dark0
c.colors.tabs.odd.bg = dark0
c.colors.tabs.even.fg = light1
c.colors.tabs.odd.fg = light1
c.colors.tabs.selected.even.bg = dark2
c.colors.tabs.selected.odd.bg = dark2
c.colors.tabs.selected.even.fg = light1
c.colors.tabs.selected.odd.fg = light1
c.colors.webpage.bg = ''

A qutebrowser/.config/qutebrowser/conf.d/js.py => qutebrowser/.config/qutebrowser/conf.d/js.py +15 -0
@@ 0,0 1,15 @@
#vim:ft=py
for protocol in (
        'file',
        'chrome',
        'qute'
        ):
    config.set('content.javascript.enabled', True, protocol + '://*')

try:
    f = open(config.configdir / 'conf.d' / 'domains', 'r')
except FileNotFoundError:
    config.set('content.javascript.enabled', True)
else:
    for domain in f.read().splitlines():
        config.set('content.javascript.enabled', True, '*://' + domain + '/*')

M qutebrowser/.config/qutebrowser/config.py => qutebrowser/.config/qutebrowser/config.py +6 -3
@@ 14,6 14,8 @@ c.confirm_quit = ['downloads']
c.new_instance_open_target = 'tab-silent'
c.new_instance_open_target_window = 'last-focused'

c.editor.command = ['termite', '-e', 'bash -c \'exec nvim -f {file} -c "normal {line}G{column0}l"\'']

c.qt.force_platform = 'xcb'

c.auto_save.session = True


@@ 37,6 39,7 @@ c.tabs.mode_on_change = 'restore'
c.tabs.show = 'multiple'
c.tabs.indicator.width = 0

c.url.open_base_url = True
c.url.searchengines = {
        'DEFAULT': 'https://www.ecosia.org/search?q={}',
        'ap': 'https://archlinux.org/packages/?q={}',


@@ 54,8 57,8 @@ c.url.searchengines = {

c.fonts.monospace = '"Sarasa Term J", monospace'

mono = '14pt monospace'
small_mono = '13pt monospace'
mono = '13pt monospace'
small_mono = '12pt monospace'
c.fonts.completion.entry = mono
c.fonts.completion.category = 'bold ' + mono
c.fonts.debug_console = mono


@@ 73,5 76,5 @@ config.bind(',X', 'spawn -dv mpv --profile=no-term {url}')
config.bind(',p', 'open -b -- {clipboard}')
config.bind(',x', 'hint all spawn -dv mpv --profile=no-term {hint-url}')

for f in glob.glob(str(config.configdir / 'conf.d/*.py')):
for f in glob.glob(str(config.configdir / 'conf.d' / '*.py')):
    config.source(str(os.path.relpath(f, start=config.configdir)))