import dracula.draw
# Autogenerated config.py
#
# NOTE: config.py is intended for advanced users who are comfortable
# with manually migrating the config file on qutebrowser upgrades. If
# you prefer, you can also configure qutebrowser using the
# :set/:bind/:config-* commands without having to write a config.py
# file.
#
# Documentation:
#   qute://help/configuring.html
#   qute://help/settings.html

# Change the argument to True to still load settings configured via autoconfig.yml
config.load_autoconfig(True)

##dracula
dracula.draw.blood(c, {
    'spacing': {
        'vertical': 6,
        'horizontal': 8
        }
    })

# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
#   - all: Accept all cookies.
#   - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
#   - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
#   - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'chrome-devtools://*')

# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`. If this setting is used with URL patterns, the pattern gets
# applied to the origin/first party URL of the page making the request,
# not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
# from URLs, so URL patterns using paths will not match. With
# QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
# you will typically need to set this setting for `example.com` when the
# cookie is set on `somesubdomain.example.com` for it to work properly.
# To debug issues with this setting, start qutebrowser with `--debug
# --logfilter network --debug-flag log-cookies` which will show all
# cookies being set.
# Type: String
# Valid values:
#   - all: Accept all cookies.
#   - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
#   - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
#   - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'devtools://*')

# Value to send in the `Accept-Language` header. Note that the value
# read from JavaScript is always the global value.
# Type: String
config.set('content.headers.accept_language', '', 'https://matchmaker.krunker.io/*')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version} Edg/{upstream_browser_version}', 'https://accounts.google.com/*')

# User agent to send.  The following placeholders are defined:  *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value   with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version.  The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine.  Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*')

# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'chrome-devtools://*')

# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome-devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'devtools://*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome://*/*')

# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'qute://*/*')

# Allow websites to show notifications.
# Type: BoolAsk
# Valid values:
#   - true
#   - false
#   - ask
config.set('content.notifications.enabled', False, 'https://www.reddit.com')


#config.set('colors.webpage.darkmode.enabled', True)
#config.set('colors.webpage.prefers_color_scheme_dark', True)
# variables
black    = "#000000"
darkgrey = "#030303"
magenta  = "#ff009e"
midgrey  = "#544d4d"
pink     = "#ff00f3"
red      = "#ff0000"
white    = "#ffffff"
yellow   = "#ffdb00"

c.colors.webpage.preferred_color_scheme = 'dark'
c.content.blocking.adblock.lists = ['https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2020.txt', 'https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist-downloads.adblockplus.org/easylistdutch.txt', 'https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt', 'https://www.i-dont-care-about-cookies.eu/abp/', 'https://secure.fanboy.co.nz/fanboy-cookiemonster.txt']
c.content.blocking.method = 'both'
#c.content.user_stylesheets = '~/.config/qutebrowser/lol.css'
config.bind('<Ctrl-m>', 'spawn mpv --volume=50 {url}')
config.bind('<Ctrl-p>', 'spawn --userscript qute-pass')
#c.colors.completion.category.bg = black
#c.colors.completion.category.bg = darkgrey
#c.colors.completion.category.border.bottom = pink
#c.colors.completion.category.border.top = darkgrey
#c.colors.completion.category.border.top = darkgrey
#c.colors.completion.category.fg = white
#c.colors.completion.category.fg = white
#c.colors.completion.even.bg = midgrey
#c.colors.completion.fg = white
#c.colors.completion.item.selected.bg = pink
#c.colors.completion.item.selected.border.bottom = c.colors.completion.category.border.top
#c.colors.completion.item.selected.border.top = c.colors.completion.item.selected.bg
#c.colors.completion.item.selected.fg = white
#c.colors.completion.match.fg = pink
#c.colors.completion.odd.bg = darkgrey
#c.colors.contextmenu.disabled.bg = darkgrey
#c.colors.contextmenu.disabled.fg = midgrey
#c.colors.contextmenu.menu.bg =  darkgrey
#c.colors.contextmenu.menu.fg =  white
#c.colors.contextmenu.selected.bg = pink
#c.colors.contextmenu.selected.fg = white
#c.colors.downloads.bar.bg = black
#c.colors.hints.bg = black
#c.colors.hints.fg = pink
#c.colors.hints.match.fg = white
#c.colors.statusbar.insert.bg = pink
#c.colors.tabs.bar.bg = black
#c.colors.tabs.even.bg = midgrey
#c.colors.tabs.even.fg = c.colors.tabs.odd.fg
#c.colors.tabs.odd.bg = black
#c.colors.tabs.odd.fg = white
#c.colors.tabs.pinned.even.bg = black
#c.colors.tabs.pinned.even.fg = pink
#c.colors.tabs.pinned.odd.bg = midgrey
#c.colors.tabs.pinned.odd.fg = pink
#c.colors.tabs.pinned.selected.even.bg = pink
#c.colors.tabs.pinned.selected.odd.bg = pink
#c.colors.tabs.selected.even.bg = pink
#c.colors.tabs.selected.odd.bg = pink
#c.hints.border = black


#c.colors.webpage.darkmode.enabled = False
#c.colors.webpage.darkmode.algorithm = 'lightness-cielab'
#c.colors.webpage.darkmode.grayscale.all = True
#c.colors.webpage.darkmode.grayscale.images = 0.5
#c.colors.webpage.darkmode.policy.images = 'never'
#c.colors.webpage.darkmode.policy.page = 'smart'
config.bind('xs', 'config-cycle statusbar.show always never')
config.bind('xt', 'config-cycle tabs.show always never')
config.bind('xx', 'config-cycle tabs.show always never;; config-cycle statusbar.show always never')

c.url.searchengines["g"] = "https://www.google.co.uk/search?q={}"
c.url.searchengines = {'DEFAULT': 'https://www.google.co.uk/search?q={}'}
c.url.searchengines["b"] = "https://search.brave.com/search?q={}"
c.url.searchengines["aw"] = "https://wiki.archlinux.org/?search={}"
c.url.searchengines["yt"] = "http://www.youtube.com/results?search_query={}"
c.url.searchengines["w"] = "https://en.wikipedia.org/w/index.php?search={}&title=Special:Search"
c.url.searchengines["ebay"] = "https://www.ebay.co.uk/sch/{}"
c.url.searchengines["r"] = "https://www.reddit.com/r/{}"
c.url.searchengines["ws"] = "https://www.whosampled.com/search/?q={}"
c.url.searchengines["gt"] = "https://github.com/search/?q={}"
c.url.searchengines["dic"] = "http://www.dictionary.com/browse/{}"
c.url.searchengines["ety"] = "http://www.etymonline.com/index.php?allowed_in_frame=0&search={}"
c.url.searchengines["aur"] = "https://aur.archlinux.org/packages/?O=0&K={}"
c.url.searchengines["proton"] = "https://www.protondb.com/search?q={}"
c.url.searchengines["disc"] = "https://www.discogs.com/search/?q={}"

font_size = 10

c.fonts.hints = f'{font_size + 2}pt BlexMono Nerd Font'
c.fonts.statusbar = f'{font_size}pt BlexMono Nerd Font'
c.fonts.downloads = f'{font_size}pt BlexMono Nerd Font'
c.fonts.contextmenu = f'{font_size}pt BlexMono Nerd Font'
c.fonts.tabs.selected = f'{font_size}pt BlexMono Nerd Font-Bold'
c.fonts.tabs.unselected = f'{font_size}pt BlexMono Nerd Font'
c.fonts.completion.entry = f'{font_size}pt BlexMono Nerd Font'
c.fonts.completion.category = f'{font_size}pt  BlexMono Nerd Font'


