diff options
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/.config/qutebrowser/config.py | 23 | ||||
-rw-r--r-- | qutebrowser/.config/qutebrowser/home.html | 90 | ||||
-rw-r--r-- | qutebrowser/.config/qutebrowser/utils.py | 22 |
3 files changed, 120 insertions, 15 deletions
diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py index 9f27302..c097087 100644 --- a/qutebrowser/.config/qutebrowser/config.py +++ b/qutebrowser/.config/qutebrowser/config.py @@ -1,7 +1,17 @@ config.load_autoconfig(False) +config.bind("<Ctrl-J>", "tab-next") +config.bind("<Ctrl-K>", "tab-prev") + from utils import * +command = ["xterm", "-fa", "JetBrainsMono", "-fs", "8", "-e", "ranger", "--choosefile={}"] + +c.fileselect.handler = "external" +c.fileselect.multiple_files.command = command +c.fileselect.single_file.command = command +c.fileselect.folder.command = command + c.content.autoplay = False c.zoom.default = "100%" @@ -25,8 +35,6 @@ c.content.blocking.method = "adblock" c.qt.highdpi = True c.qt.force_software_rendering = "chromium" -c.colors.webpage.preferred_color_scheme = "dark" - home = "/home/me/.config/qutebrowser/home.html" c.url.start_pages = home @@ -91,3 +99,14 @@ c.colors.messages.info.border = background c.colors.messages.warning.bg = background c.colors.messages.warning.fg = foreground c.colors.messages.warning.border = background + +c.colors.webpage.preferred_color_scheme = "dark" +# c.colors.webpage.darkmode.algorithm = 'lightness-cielab' +# c.colors.webpage.darkmode.contrast = 0.0 +# c.colors.webpage.darkmode.enabled = True +# c.colors.webpage.darkmode.grayscale.all = False +# c.colors.webpage.darkmode.grayscale.images = 0.0 +# c.colors.webpage.darkmode.policy.images = 'smart' +# c.colors.webpage.darkmode.policy.page = 'smart' +# c.colors.webpage.darkmode.threshold.background = 128 +# c.colors.webpage.darkmode.threshold.text = 128 diff --git a/qutebrowser/.config/qutebrowser/home.html b/qutebrowser/.config/qutebrowser/home.html index e82a054..f6b4306 100644 --- a/qutebrowser/.config/qutebrowser/home.html +++ b/qutebrowser/.config/qutebrowser/home.html @@ -18,9 +18,14 @@ } a { - text-decoration: none; - color: var(--color1); + outline: none; + color: var(--color4); padding-right: 0.5em; + text-decoration: none; + } + + a:hover, a:focus { + color: var(--color12); } .terminal { @@ -33,18 +38,85 @@ bottom: 0; right: 4em; } + + .list { + display: flex; + } + + .list a { + margin-right: 1em; + } + + .group { + display: flex; + + padding-bottom: 1em; + flex-direction: column; + } + + .group a::before { + content: "├ "; + color: var(--foreground); + } + + .group a:last-child::before { + content: "└ "; + color: var(--foreground); + } + + .group::before { + content: attr(data-title); + padding-bottom: 2px; + } + + .noselect { + user-select: none; + } </style> </head> <body> <div class="terminal"> - <p>[ me@qutebrowser ] ~ $ ls </p> + <p><span class="noselect">[ me@qutebrowser ] ~ $ </span>quickmarks </p> <p class="list"> - <a href="https://moodle.uni-luebeck.de/login/index.php">qmoodle</a> - <a href="https://music.youtube.com">qmusic</a> - <a href="https://chat.openai.com/chat/736699a4-aed0-4e01-b91c-0b9fd595e91b">qchat</a> - <a href="https://rmfc.davidpenkowoj.de">qrmfc</a> - <a href="https://davidpenkowoj.de">qweb</a> - <a href="https://git.davidpenkowoj.de">qgit</a> + <script> + let client = new XMLHttpRequest(); + + client.open('GET', '/home/me/.config/qutebrowser/quickmarks'); + client.onreadystatechange = function() { + if (client.readyState != 4) return; + + for (let line of client.responseText.split("\n")) { + let content = line.split(" "); + let href = content[1]; + + content = content[0].split("/"); + + let group = content[0]; + let title = content[1]; + + let div = document.querySelector(`div.${group}`); + + if (div == null) { + div = document.createElement("div") + + div.setAttribute("data-title", group); + div.classList.add("group"); + div.classList.add(group); + + document.querySelector(".list").append(div); + } + + if (href != undefined) { + let a = document.createElement("a"); + + a.innerText = title; + a.href = href; + div.append(a); + } + } + } + client.send(); + </script> </p> </div> <div class="eyes"> diff --git a/qutebrowser/.config/qutebrowser/utils.py b/qutebrowser/.config/qutebrowser/utils.py index 790bea2..c0247c2 100644 --- a/qutebrowser/.config/qutebrowser/utils.py +++ b/qutebrowser/.config/qutebrowser/utils.py @@ -1,4 +1,18 @@ -translucent = "#801a1a1a" -background = "#1a1a1a" -foreground = "#bcd0db" -accent = "#a642c0" +import subprocess + +def read_xresources(prefix): + props = {} + x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE) + lines = x.stdout.decode().split('\n') + for line in filter(lambda l : l.startswith(prefix), lines): + prop, _, value = line.partition(':\t') + props[prop] = value + return props + +xres = read_xresources('*') +# can be userd now like `c.colors.statusbar.normal.bg = xres['*.background']` + +translucent = "#80" + xres['*background'].split('#')[1] +background = xres['*background'] +foreground = xres['*foreground'] +accent = xres['*primary'] |