From 0d1fac47b98422699c5dfd7ab08b3c4500fa877f Mon Sep 17 00:00:00 2001 From: Phantop Date: Wed, 30 Dec 2020 12:08:03 -0500 Subject: [PATCH] Qute: greasemonkey/userscript cleanup --- .config/qutebrowser/config.py | 2 +- .../greasemonkey/{ao3dl.js => ao3.js} | 22 +- .config/qutebrowser/greasemonkey/ao3lz.js | 24 - .config/qutebrowser/greasemonkey/discord.js | 190 ++-- .config/qutebrowser/greasemonkey/hnews.js | 954 +++++++++--------- .../greasemonkey/{bttv.js => twitch.js} | 18 +- .config/qutebrowser/userscripts/.gitignore | 3 - .config/qutebrowser/userscripts/readability | 42 - .local/share/qutebrowser/greasemonkey | 1 - .local/share/qutebrowser/userscripts | 1 - 10 files changed, 585 insertions(+), 672 deletions(-) rename .config/qutebrowser/greasemonkey/{ao3dl.js => ao3.js} (71%) delete mode 100644 .config/qutebrowser/greasemonkey/ao3lz.js rename .config/qutebrowser/greasemonkey/{bttv.js => twitch.js} (55%) delete mode 100644 .config/qutebrowser/userscripts/.gitignore delete mode 100755 .config/qutebrowser/userscripts/readability delete mode 120000 .local/share/qutebrowser/greasemonkey delete mode 120000 .local/share/qutebrowser/userscripts diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 586c8d5..4c48376 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -53,7 +53,7 @@ config.bind('se', 'open https://dotepub.com/converter/?url={url}&fmt=epub') c.aliases['remove-sticky'] = 'jseval -q !function(){var e,o=document.querySelectorAll("body *");for(e=0;e', 'spawn -u readability') +config.bind('', 'spawn -u /usr/bin/env python3 /usr/share/qutebrowser/userscripts/readability') config.bind('', "spawn kitty rdrview -B qutebrowser {url}") config.bind('st', 'config-cycle -t content.proxy socks://localhost:9050/ system') diff --git a/.config/qutebrowser/greasemonkey/ao3dl.js b/.config/qutebrowser/greasemonkey/ao3.js similarity index 71% rename from .config/qutebrowser/greasemonkey/ao3dl.js rename to .config/qutebrowser/greasemonkey/ao3.js index 3565869..3ffb70c 100644 --- a/.config/qutebrowser/greasemonkey/ao3dl.js +++ b/.config/qutebrowser/greasemonkey/ao3.js @@ -1,6 +1,6 @@ // ==UserScript== -// @name ao3 download buttons -// @description Adds download buttons to each work blurb on AO3's works index pages. +// @name AO3 download and latest chapter buttons +// @description Adds download and latest chapter buttons to each work // @namespace ao3 // @include http*://archiveofourown.org/*works* // @include http*://archiveofourown.org/series/* @@ -85,3 +85,21 @@ }); }); })(); + +var match = location.pathname.match(/^(\/works\/\d+\/chapters\/)\d+/); + +if (match) { + var chapEls = document.getElementById('selected_id').children; + var lastChapEl = chapEls[chapEls.length-1]; + if (!lastChapEl.selected) { + var lastChap = lastChapEl.value; + var button = document.createElement('a'); + button.href = match[1] + lastChap; + button.appendChild(document.createTextNode('Latest Chapter ' + String.fromCharCode(0x2192))); + var buttonParent = document.createElement('li'); + buttonParent.className = 'chapter'; + buttonParent.appendChild(button); + var chapsParent = document.getElementById('chapter_index').parentElement; + chapsParent.parentElement.insertBefore(buttonParent, chapsParent); + } +} diff --git a/.config/qutebrowser/greasemonkey/ao3lz.js b/.config/qutebrowser/greasemonkey/ao3lz.js deleted file mode 100644 index bb3e026..0000000 --- a/.config/qutebrowser/greasemonkey/ao3lz.js +++ /dev/null @@ -1,24 +0,0 @@ -// ==UserScript== -// @name AO3 Lazier -// @namespace ao3lazier -// @description Adds a latest chapter button to the top navigation. -// @include http*://archiveofourown.org/* -// ==/UserScript== - -var match = location.pathname.match(/^(\/works\/\d+\/chapters\/)\d+/); - -if (match) { - var chapEls = document.getElementById('selected_id').children; - var lastChapEl = chapEls[chapEls.length-1]; - if (!lastChapEl.selected) { - var lastChap = lastChapEl.value; - var button = document.createElement('a'); - button.href = match[1] + lastChap; - button.appendChild(document.createTextNode('Latest Chapter ' + String.fromCharCode(0x2192))); - var buttonParent = document.createElement('li'); - buttonParent.className = 'chapter'; - buttonParent.appendChild(button); - var chapsParent = document.getElementById('chapter_index').parentElement; - chapsParent.parentElement.insertBefore(buttonParent, chapsParent); - } -} diff --git a/.config/qutebrowser/greasemonkey/discord.js b/.config/qutebrowser/greasemonkey/discord.js index 1d90d98..fdf0b58 100644 --- a/.config/qutebrowser/greasemonkey/discord.js +++ b/.config/qutebrowser/greasemonkey/discord.js @@ -1,112 +1,102 @@ // ==UserScript== // @name Discord Simple Clear -// @namespace http://userstyles.org +// @namespace https://github.com/birb-naise // @description Simple CSS for customizable background and bg opacity. Popular discord styles usually don't work/get abandoned for some reason ??? so I made this one which should be easy to update. // @author birb-naise -// @homepage https://userstyles.org/styles/175085 -// @include http://discordapp.com/* -// @include https://discordapp.com/* -// @include http://*.discordapp.com/* -// @include https://*.discordapp.com/* +// @homepage https://github.com/birb-naise/discord-simple-clear // @include http://discord.com/* // @include https://discord.com/* // @include http://*.discord.com/* // @include https://*.discord.com/* // @run-at document-start -// @version 0.20200206055911 +// @version 8148fe3 // ==/UserScript== -(function() {var css = [ - "/* ------BACKGROUND------ */", - "body {", - " background: url(\"https://cdn.discordapp.com/attachments/610991459323084801/625107142092783616/moon3.png\");", - " background-size: cover;", - "}", - ".appMount-3lHmkl {", - " background: rgba(0, 0, 0, .6);", - "}", - "", - "/* ------REMOVE GREY/WHITE BG COLORS------ */", - ".theme-dark,", - ".theme-light {", - " --header-primary: #fff;", - " --header-secondary: #b9bbbe;", - " --text-normal: #dcddde;", - " --text-muted: #9d9d9d;", - " --channels-default: #8e9297;", - " --interactive-normal: #b9bbbe;", - " --interactive-hover: #dcddde;", - " --interactive-active: #fff;", - " --interactive-muted: #4f545c;", - " --background-primary: transparent;", - " --background-secondary: transparent;", - " --background-secondary-alt: transparent;", - " --background-tertiary: transparent;", - " --background-floating: rgba(0, 0, 0, .8);", - " --channeltextarea-background: transparent;", - " --deprecated-panel-background: transparent;", - " --background-modifier-hover: rgba(0, 0, 0, .42);", - " --background-modifier-selected: rgba(0, 0, 0, .45);", - "}", - "", - "/* ------POP-UP------ */", - ".modal-yWgWj-,", - ".footer-3rDWdC {", - " background: rgba(0, 0, 0, .5) !important;", - "}", - "", - "", - "/*remove borders*/", - ".header-2o-2hj,", - ".searchBar-6Kv8R2,", - ".content-yTz4x3::before {", - " box-shadow: none !important;", - "}", - "", - "/*misc*/", - ".container-1D34oG, /*friends list*/", - ".scrollbar-2rkZSL, /*scrollbar*/", - ".pad-29zQak,", - ".track-1JN30G {", - " background: transparent !important;", - "}", - "", - "/* ------SCROLLBAR------ */", - ".scrollbar-2rkZSL {", - " width: 8px;", - "}", - ".thumb-2JwNFC {", - " background: rgba(0, 0, 0, .5) !important;", - "}", - ".track-1JN30G,", - ".thumb-2JwNFC {", - " border: none !important;", - "}", - "", - "/* ------EMBEDDED TEXT------ */", - ".embedProvider-3k5pfl,", - ".embedDescription-1Cuq9a,", - ".embedFields-2IPs5Z,", - ".embedAuthorName-3mnTWj,", - ".embedFooterText-28V_Wb {", - " color: #f2f2f2 !important;", - "}" -].join("\n"); -if (typeof GM_addStyle != "undefined") { - GM_addStyle(css); -} else if (typeof PRO_addStyle != "undefined") { - PRO_addStyle(css); -} else if (typeof addStyle != "undefined") { - addStyle(css); -} else { - var node = document.createElement("style"); - node.type = "text/css"; - node.appendChild(document.createTextNode(css)); - var heads = document.getElementsByTagName("head"); - if (heads.length > 0) { - heads[0].appendChild(node); - } else { - // no head yet, stick it whereever - document.documentElement.appendChild(node); - } + +(function IIFE() { + 'use strict'; + + document.addEventListener('readystatechange', function onReadyStateChange() { + if (document.readyState == 'interactive') { + const style = document.createElement('style'); + document.head.appendChild(style); + style.innerHTML = ` + +body { + background: url("https://cdn.discordapp.com/attachments/610991459323084801/625107142092783616/moon3.png"); + background-size: cover; } +/*[[theme]]*/ + +/*remove borders*/ +.header-2o-2hj, +.searchBar-6Kv8R2, +.content-yTz4x3::before { + box-shadow: none !important; +} + +/*misc*/ +.container-1D34oG, /*friends list*/ +.scrollbar-2rkZSL, /*scrollbar*/ +.pad-29zQak, +.track-1JN30G { + background: transparent !important; +} + +/* ------SCROLLBAR------ */ +.scrollbar-2rkZSL { + width: 8px; +} +.thumb-2JwNFC { + background: rgba(0, 0, 0, .5) !important; +} +.track-1JN30G, +.thumb-2JwNFC { + border: none !important; +} + +/* ------EMBEDDED TEXT------ */ +.embedProvider-3k5pfl, +.embedDescription-1Cuq9a, +.embedFields-2IPs5Z, +.embedAuthorName-3mnTWj, +.embedFooterText-28V_Wb { + color: #f2f2f2 !important; +} + +.appMount-3lHmkl { + background: rgba(0, 0, 0, .6); +} + +/* ------REMOVE GREY/WHITE BG COLORS------ */ +.theme-dark, +.theme-light { + --header-primary: #fff; + --header-secondary: #b9bbbe; + --text-normal: #dcddde; + --text-muted: #9d9d9d; + --channels-default: #8e9297; + --interactive-normal: #b9bbbe; + --interactive-hover: #dcddde; + --interactive-active: #fff; + --interactive-muted: #4f545c; + --background-primary: transparent; + --background-secondary: transparent; + --background-secondary-alt: transparent; + --background-tertiary: transparent; + --background-floating: rgba(0, 0, 0, .8); + --channeltextarea-background: transparent; + --deprecated-panel-background: transparent; + --background-modifier-hover: rgba(0, 0, 0, .42); + --background-modifier-selected: rgba(0, 0, 0, .45); +} + +/* ------POP-UP------ */ +.modal-yWgWj-, +.footer-3rDWdC { + background: rgba(0, 0, 0, .5) !important; +} + + `; + } + }); })(); diff --git a/.config/qutebrowser/greasemonkey/hnews.js b/.config/qutebrowser/greasemonkey/hnews.js index 8c3ee94..f34345b 100644 --- a/.config/qutebrowser/greasemonkey/hnews.js +++ b/.config/qutebrowser/greasemonkey/hnews.js @@ -1,497 +1,477 @@ // ==UserScript== -// @name Hacker News - Bluish Gray (2020) -// @namespace http://userstyles.org -// @description Bluish Gray Hacker News. I recommend installing it with Stylus.

+// @name Hacker News - Bluish Gray +// @namespace https://github.com/pyxelr +// @description Bluish Gray Hacker News. // @author pyxelr -// @homepage https://userstyles.org/styles/157400 +// @homepage https://github.com/pyxelr/Hacker_News_-_Bluish_Gray // @include http://news.ycombinator.com/* // @include https://news.ycombinator.com/* // @include http://*.news.ycombinator.com/* // @include https://*.news.ycombinator.com/* -// @include http://hn.algolia.com/* -// @include https://hn.algolia.com/* -// @include http://*.hn.algolia.com/* -// @include https://*.hn.algolia.com/* // @run-at document-start -// @version 0.20200416203351 +// @version 1.2.2 // ==/UserScript== -(function() {var css = ""; -if (false || (document.domain == "news.ycombinator.com" || document.domain.substring(document.domain.indexOf(".news.ycombinator.com") + 1) == "news.ycombinator.com")) - css += [ - "/* Hacker News - Bluish Gray (2020)", - " v1.2.2 (2019-11-10)", - " Author: Pawel Cislo (pyxelr) ", - " Repository: https://github.com/pyxelr/Hacker_News_-_Bluish_Gray", - " Userstyle: https://userstyles.org/styles/157400/hacker-news-bluish-gray-2020", - " UserCSS: https://raw.githubusercontent.com/pyxelr/Hacker_News_-_Bluish_Gray/master/HackerNews-BluishGray.user.css", - " License: MIT", - "*/ ", - "body {", - " background: #2b3033 !important;", - " color: #f0ffff !important;", - " font-family: \"Open Sans\", \"Bitstream Vera Sans\", Verdana, Geneva, sans-serif !important;", - " }", - "", - " a:link { color:#b1bcbc !important; }", - " a:visited { color:#889191 !important; }", - "", - " body > center > table[width=\"85%\"] {", - " background: #212121 !important;", - " box-shadow: 0px 0px 30px 3px rgba(0, 0, 0, 0.2) !important;", - " border-left: 1px solid #000 !important;", - " border-right: 1px solid #000 !important;", - " }", - "", - "", - "", - "", - " /* ==== HEADER ==== */", - "", - " /* header that\'s normally an orange bar at top (selects divider above footer too?) */", - " body > center > table[width=\"85%\"] td[bgcolor=\"#ff6600\"] {", - " background: linear-gradient(to top, #45515b 0%, #4b5762 100%) !important;", - " padding: 3px 4px !important;", - " box-shadow: 0px 1px 1px 0px rgba(33, 33, 33, 0.2);", - " }", - "", - " /* \"Hacker News\" text in header */", - " .pagetop a[href=\"news\"] {", - " font-size: 110% !important;", - " text-shadow: -1px -1px 0 #666, 1px -1px 0 #666, -1px 1px 0 #666, 1px 1px 0 #666 !important;", - " color: #e2e6e9 !important;", - " }", - "", - " /* size reducement and black border around orange \"Y\" logo */", - "", - " #hnmain > tbody > tr:first-of-type table img {", - " box-sizing: border-box;", - " border: 1px black solid !important;", - " }", - "", - " /* currently selected link in header */", - " .topsel a {", - " color: #f93 !important;", - " font-weight: bold !important;", - " text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) !important;", - " }", - "", - " /* hover link in header (except \"Hacker News\", and \"login\") */", - " .pagetop a:not(:first-child):hover {", - " text-decoration: underline !important;", - " }", - "", - " .pagetop a:link:not(:first-child),", - " .pagetop a:visited:not(:first-child) {", - " color: #b1b1b1 !important;", - " }", - "", - " /* colorize \'|\' characters in header (and hopefully nothing else) */", - " .pagetop {", - " color: #878f8f !important;", - " }", - " ", - " .pagetop > a[href^=\"user?\"] {", - " color: #f0ffff !important;", - " }", - "", - "", - "", - "", - " /* ==== FRONT PAGE NEWS LISTING ==== */", - "", - " .title {", - " font-size: 14px !important;", - " }", - "", - " .title a.storylink:link {", - " color: #f0ffff !important;", - " }", - "", - " .title a.storylink:visited {", - " color: #878f8f !important;", - " }", - "", - " .storylink, .subtext {", - " padding-left: 8px !important;", - " }", - "", - " .subtext {", - " padding-bottom: 8px !important;", - " font-size: 12px !important;", - " }", - "", - " .itemlist .subtext, .itemlist .subtext * {", - " color: #878f8f !important;", - " }", - "", - " .sitestr {", - " color: #6d7474 !important;", - " }", - "", - " .title .rank {", - " padding-right: 8px !important;", - " padding-left: 8px !important;", - " color: #444848 !important;", - " font-size: 11px !important;", - " }", - "", - " /* \"More\" link at bottom */", - " .morespace + tr a.morelink {", - " color: #b9d3d3 !important;", - " }", - "", - " .votearrow {", - " filter: invert(100%) !important;", - " -webkit-filter: invert(100%) !important;", - " }", - "", - " .subtext > a:last-child:visited {", - " color: #474f4f !important;", - " }", - "", - " .subtext .hnuser {", - " font-weight: bold !important;", - " }", - "", - "", - "", - "", - " /* ==== COMMENTS ==== */", - "", - " .comment,", - " .comment > span {", - " font-family: \"Open Sans\", \"Bitstream Vera Sans\", Verdana, Geneva, sans-serif !important;", - " font-size: 14px !important;", - " }", - "", - " .comment .c00 {", - " color: #f0ffff !important;", - " }", - "", - " .comhead .hnuser {", - " color: #abc3c3 !important;", - " font-weight: bold !important;", - " }", - "", - " /* space between individual comments */", - " .athing.comtr .default {", - " padding-bottom: 10px !important;", - " }", - "", - " .c5a, .c5a a:link, .c5a a:visited { opacity: 0.9 !important; }", - " .c73, .c73 a:link, .c73 a:visited { opacity: 0.8 !important; }", - " .c82, .c82 a:link, .c82 a:visited { opacity: 0.7 !important; }", - " .c88, .c88 a:link, .c88 a:visited { opacity: 0.6 !important; }", - " .c9c, .c9c a:link, .c9c a:visited { opacity: 0.5 !important; }", - " .cae, .cae a:link, .cae a:visited { opacity: 0.4 !important; }", - " .cbe, .cbe a:link, .cbe a:visited { opacity: 0.3 !important; }", - " .cce, .cce a:link, .cce a:visited { opacity: 0.2 !important; }", - " .cdd, .cdd a:link, .cdd a:visited { opacity: 0.1 !important; }", - "", - " .c00, .c00 a:link,", - " .c5a, .c5a a:link, .c5a a:visited,", - " .c73, .c73 a:link, .c73 a:visited,", - " .c82, .c82 a:link, .c82 a:visited,", - " .c88, .c88 a:link, .c88 a:visited,", - " .c9c, .c9c a:link, .c9c a:visited,", - " .cae, .cae a:link, .cae a:visited,", - " .cbe, .cbe a:link, .cbe a:visited,", - " .cce, .cce a:link, .cce a:visited,", - " .cdd, .cdd a:link, .cdd a:visited", - " {", - " color:#f0ffff !important;", - " }", - "", - " a[href^=\"reply\"]:link {", - " color: #666c6c !important;", - " }", - "", - " a[href^=\"reply\"]:visited {", - " color: #333636 !important;", - " }", - "", - " a[href^=\"reply\"]:hover {", - " color: #abc3c3 !important;", - " }", - "", - " /* animate opacity of dimmed comments */", - " .c5a, .c73, .c82, .c88, .c9c,", - " .cae, .cbe, .cce, .cdd {", - " transition: opacity 0.5s !important;", - " transition-duration: 0.4s !important;", - " transition-delay: 0.2s !important;", - " }", - "", - " /* allow easier reading of dimmed comments */", - " .c5a:hover, .c73:hover, .c82:hover, .c88:hover, .c9c:hover,", - " .cae:hover, .cbe:hover, .cce:hover, .cdd:hover {", - " opacity: 1.0 !important;", - " }", - "", - " .comhead {", - " color: #6d7474 !important;", - " }", - "", - " .comment pre {", - " background: rgba(0, 0, 0, 0.2) !important;", - " }", - "", - " .comment > span > a:link,", - " .comment > span > p a:link {", - " color: #abc3c3 !important;", - " }", - "", - " .comment > span > a:visited,", - " .comment > span > p a:visited {", - " color: #505b5b !important;", - " }", - "", - " .votearrow:hover {", - " filter: invert(100%) brightness(1.5) !important;", - " -webkit-filter: invert(100%) brightness(1.5) !important;", - " }", - "", - " /* Ask HN text at top of commments */", - " #hnmain table:first-child tr[id].athing + tr + tr[style=\"height:2px\"] + tr td {", - " font-family: \"Open Sans\", \"Bitstream Vera Sans\", Verdana, Geneva, sans-serif !important;", - " font-size: 15px !important;", - " color: #f0ffff !important;", - " /* line-height: 1.33 !important; */", - " }", - "", - " /* ==== SEARCH BOX, COMMENT BOX, DROP-DOWN MENU ==== */", - "", - " /* background color of search box, comment box and drop-down menu */", - " body > center > table, input, textarea, select {", - " background-color: #222 !important;", - " }", - " /* darker border around search box, comment box and drop-down menu*/", - " input, textarea, select {", - " border: 1px solid #828282 !important;", - " }", - " /* bright input text in search box, comment box and drop-down menu */", - " td.title a:link, span.comment font, span.comment font a:link, u a:link, span.yclinks a:link, body:not([id]),", - " td:nth-child(2):not(.subtext) > a:link, input, textarea, select, p > a, a > u, .c00, .c00 a:link,", - " a[href=\"http://www.ycombinator.com/apply/\"] {", - " color: #ccc !important;", - " }", - "", - "", - "", - "", - " /* ==== FOOTER ==== */", - "", - " #hnmain > tbody > tr:last-child {", - " background: linear-gradient(to bottom, #212121 0%, #131313 100%) !important;", - "", - " }", - "", - " #hnmain > tbody > tr:last-child td[bgcolor=\"#ff6600\"] {", - " background: transparent !important;", - " border-top: 1px solid #778888 !important;", - " }", - "", - "", - "", - "", - " /* ==== OTHER ==== */", - "", - " /* textbox formatting help */", - " .admin, .admin td, .admin p {", - " color: #f0ffff !important;", - " font-size: 14px !important;", - " }", - "", - " /* bookmarklet text */", - " table[width=\"500\"] #main > #first {", - " color: #000 !important;", - " }" - ].join("\n"); -if (false || (document.domain == "hn.algolia.com" || document.domain.substring(document.domain.indexOf(".hn.algolia.com") + 1) == "hn.algolia.com")) - css += [ - "/* invertion of algolia logo in the footer */", - " .search-wrapper img", - " {", - " filter: invert(50%) !important; ", - " }", - "", - " /* text highlight color of search results */", - " .main .search-results em {", - " background-color: #b1bcbc !important;", - " }", - "", - " /* dark drop-down menus */", - " .wrap-dd-select", - " {", - " background-color: #222 !important;", - " border: 1px solid #828282 !important;", - " color: #ccc !important;", - " }", - "", - " ", - " /* ==== SEARCH BOX, COMMENT BOX, DROP-DOWN MENU ==== */", - " /* Dropdown */", - " .Dropdown_label", - " {", - " color:#c2c2c2;", - " }", - " .Dropdown_list li button {", - " color: #f3f3f3;", - " background-color: #45515b;", - " }", - " ", - " /* Story */", - " .Story_title a ", - " {", - " color: #F0FFFF;", - " }", - " .Story_title .Story_link ", - " {", - " color: #6d7474;", - " font-size: 11px;", - " word-break: break-all;", - " }", - " .Story_comment", - " {", - " color: #ababab;", - " }", - " ", - " /* Search */", - " body > center > table, input, textarea, select ", - " {", - " background-color: #222 !important;", - " }", - " .SearchResults_container", - " {", - " background-color: #222 !important;", - " }", - " .SearchFilters.container", - " {", - " background-color: #45515b !important;", - " }", - " .SearchFilters {", - " color: #f3f3f3;", - " }", - " .SearchHeader .PoweredBy", - " {", - " color:#a0a0a0;", - " }", - " .SearchResults", - " {", - " background:#222;", - " box-shadow: 0px 0px 30px 3px rgba(0, 0, 0, 0.2) !important;", - " border-left: 1px solid #000 !important;", - " border-right: 1px solid #000 !important;", - " }", - " /* Settings view */", - " .Settings", - " {", - " background-color:#222;", - " }", - " .Settings h2", - " {", - " color:#bcbcbc;", - " }", - " .Settings label ", - " {", - " color:#a0a0a0;", - " }", - " ", - " /* Other */", - " .Pagination", - " {", - " background-color:#45515b;", - " }", - " .Footer_list a ", - " {", - " color: #a0a0a0;", - " }", - " ", - " /* darker border around search box, comment box and drop-down menu*/", - " input, textarea, select {", - " border: 1px solid #828282 !important;", - " }", - " /* bright input text in search box, comment box and drop-down menu */", - " td.title a:link, span.comment font, span.comment font a:link, u a:link, span.yclinks a:link, body:not([id]),", - " td:nth-child(2):not(.subtext) > a:link, input, textarea, select, p > a, a > u, .c00, .c00 a:link,", - " a[href=\"http://www.ycombinator.com/apply/\"] {", - " color: #ccc !important;", - " }", - "", - "", - " /* ==== OTHER ==== */", - " body {", - " background-color: #292929;", - " }", - "", - " .search-results {", - " background-color: #292929;", - " }", - "", - " .page-header a {", - " color: #9a9a9a;", - " }", - "", - "", - " .main .search-results .item .item-main .item-title-and-infos h2 a {", - " color: #9a9a9a;", - " }", - "", - " #main > div > section > header {", - " background-color: #292929;", - " color: #9a9a9a;", - " }", - "", - " .page-header .logo-wrapper .logo-name {", - " color: #e2e6e9 !important; ", - " }", - "", - " #main > div > header {", - " background-color: #292929;", - " color: #9a9a9a;", - " }", - "", - " .main .search-results em {", - " background-color: #dadada !important; /* net net net :D */", - " }", - "", - " .search-pagination li.active button {", - " border-color: #dadada;", - " color: #dadada;", - " }", - "", - " footer {", - " background-color: #292929;", - " }", - "", - " footer a {", - " color: #9a9a9a;", - " }", - "", - " #main > div > section > section > section > div.item.ng-scope > div.item-main > div.item-content-wrapper p {", - " color: #dadada;", - " }", - "", - " .edit-settings {", - " background-color: #292929;", - " }" - ].join("\n"); -if (typeof GM_addStyle != "undefined") { - GM_addStyle(css); -} else if (typeof PRO_addStyle != "undefined") { - PRO_addStyle(css); -} else if (typeof addStyle != "undefined") { - addStyle(css); -} else { - var node = document.createElement("style"); - node.type = "text/css"; - node.appendChild(document.createTextNode(css)); - var heads = document.getElementsByTagName("head"); - if (heads.length > 0) { - heads[0].appendChild(node); - } else { - // no head yet, stick it whereever - document.documentElement.appendChild(node); - } + +(function IIFE() { + 'use strict'; + + document.addEventListener('readystatechange', function onReadyStateChange() { + if (document.readyState == 'interactive') { + const style = document.createElement('style'); + document.head.appendChild(style); + style.innerHTML = ` + +body { + background: #2b3033 !important; + color: #f0ffff !important; + font-family: "Open Sans", "Bitstream Vera Sans", Verdana, Geneva, sans-serif !important; } + +a:link { color:#b1bcbc !important; } +a:visited { color:#889191 !important; } + +body > center > table[width="85%"] { + background: #212121 !important; + box-shadow: 0px 0px 30px 3px rgba(0, 0, 0, 0.2) !important; + border-left: 1px solid #000 !important; + border-right: 1px solid #000 !important; +} + + + + +/* ==== HEADER ==== */ + +/* header that's normally an orange bar at top (selects divider above footer too?) */ +body > center > table[width="85%"] td[bgcolor="#ff6600"] { + background: linear-gradient(to top, #45515b 0%, #4b5762 100%) !important; + padding: 3px 4px !important; + box-shadow: 0px 1px 1px 0px rgba(33, 33, 33, 0.2); +} + +/* "Hacker News" text in header */ +.pagetop a[href="news"] { + font-size: 110% !important; + text-shadow: -1px -1px 0 #666, 1px -1px 0 #666, -1px 1px 0 #666, 1px 1px 0 #666 !important; + color: #e2e6e9 !important; +} + +/* size reducement and black border around orange "Y" logo */ + +#hnmain > tbody > tr:first-of-type table img { + box-sizing: border-box; + border: 1px black solid !important; +} + +/* currently selected link in header */ +.topsel a { + color: #f93 !important; + font-weight: bold !important; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) !important; +} + +/* hover link in header (except "Hacker News", and "login") */ +.pagetop a:not(:first-child):hover { + text-decoration: underline !important; +} + +.pagetop a:link:not(:first-child), +.pagetop a:visited:not(:first-child) { + color: #b1b1b1 !important; +} + +/* colorize '|' characters in header (and hopefully nothing else) */ +.pagetop { + color: #878f8f !important; +} + +.pagetop > a[href^="user?"] { + color: #f0ffff !important; +} + + + + +/* ==== FRONT PAGE NEWS LISTING ==== */ + +.title { + font-size: 14px !important; +} + +.title a.storylink:link { + color: #f0ffff !important; +} + +.title a.storylink:visited { + color: #878f8f !important; +} + +.storylink, .subtext { + padding-left: 8px !important; +} + +.subtext { + padding-bottom: 8px !important; + font-size: 12px !important; +} + +.itemlist .subtext, .itemlist .subtext * { + color: #878f8f !important; +} + +.sitestr { + color: #6d7474 !important; +} + +.title .rank { + padding-right: 8px !important; + padding-left: 8px !important; + color: #444848 !important; + font-size: 11px !important; +} + +/* "More" link at bottom */ +.morespace + tr a.morelink { + color: #b9d3d3 !important; +} + +.votearrow { + filter: invert(100%) !important; + -webkit-filter: invert(100%) !important; +} + +.subtext > a:last-child:visited { + color: #474f4f !important; +} + +.subtext .hnuser { + font-weight: bold !important; +} + + + + +/* ==== COMMENTS ==== */ + +.comment, +.comment > span { + font-family: "Open Sans", "Bitstream Vera Sans", Verdana, Geneva, sans-serif !important; + font-size: 15px !important; +} + +.comment .c00 { + color: #f0ffff !important; +} + +.comhead .hnuser { + color: #abc3c3 !important; + font-weight: bold !important; +} + +/* space between individual comments */ +.athing.comtr .default { + padding-bottom: 10px !important; +} + +.c5a, .c5a a:link, .c5a a:visited { opacity: 0.9 !important; } +.c73, .c73 a:link, .c73 a:visited { opacity: 0.8 !important; } +.c82, .c82 a:link, .c82 a:visited { opacity: 0.7 !important; } +.c88, .c88 a:link, .c88 a:visited { opacity: 0.6 !important; } +.c9c, .c9c a:link, .c9c a:visited { opacity: 0.5 !important; } +.cae, .cae a:link, .cae a:visited { opacity: 0.4 !important; } +.cbe, .cbe a:link, .cbe a:visited { opacity: 0.3 !important; } +.cce, .cce a:link, .cce a:visited { opacity: 0.2 !important; } +.cdd, .cdd a:link, .cdd a:visited { opacity: 0.1 !important; } + +.c00, .c00 a:link, +.c5a, .c5a a:link, .c5a a:visited, +.c73, .c73 a:link, .c73 a:visited, +.c82, .c82 a:link, .c82 a:visited, +.c88, .c88 a:link, .c88 a:visited, +.c9c, .c9c a:link, .c9c a:visited, +.cae, .cae a:link, .cae a:visited, +.cbe, .cbe a:link, .cbe a:visited, +.cce, .cce a:link, .cce a:visited, +.cdd, .cdd a:link, .cdd a:visited +{ + color:#f0ffff !important; +} + +a[href^="reply"]:link { + color: #666c6c !important; +} + +a[href^="reply"]:visited { + color: #333636 !important; +} + +a[href^="reply"]:hover { + color: #abc3c3 !important; +} + +/* animate opacity of dimmed comments */ +.c5a, .c73, .c82, .c88, .c9c, +.cae, .cbe, .cce, .cdd { + transition: opacity 0.5s !important; + transition-duration: 0.4s !important; + transition-delay: 0.2s !important; +} + +/* allow easier reading of dimmed comments */ +.c5a:hover, .c73:hover, .c82:hover, .c88:hover, .c9c:hover, +.cae:hover, .cbe:hover, .cce:hover, .cdd:hover { + opacity: 1.0 !important; +} + +.comhead { + color: #6d7474 !important; +} + +.comment pre { + background: rgba(0, 0, 0, 0.2) !important; +} + +.comment > span > a:link, +.comment > span > p a:link { + color: #abc3c3 !important; +} + +.comment > span > a:visited, +.comment > span > p a:visited { + color: #505b5b !important; +} + +.votearrow:hover { + filter: invert(100%) brightness(1.5) !important; + -webkit-filter: invert(100%) brightness(1.5) !important; +} + +/* Ask HN text at top of commments */ +#hnmain table:first-child tr[id].athing + tr + tr[style="height:2px"] + tr td { + font-family: "Open Sans", "Bitstream Vera Sans", Verdana, Geneva, sans-serif !important; + font-size: 15px !important; + color: #f0ffff !important; + /* line-height: 1.33 !important; */ +} + +/* ==== SEARCH BOX, COMMENT BOX, DROP-DOWN MENU ==== */ + +/* background color of search box, comment box and drop-down menu */ +body > center > table, input, textarea, select { + background-color: #222 !important; +} +/* darker border around search box, comment box and drop-down menu*/ +input, textarea, select { + border: 1px solid #828282 !important; +} +/* bright input text in search box, comment box and drop-down menu */ +td.title a:link, span.comment font, span.comment font a:link, u a:link, span.yclinks a:link, body:not([id]), +td:nth-child(2):not(.subtext) > a:link, input, textarea, select, p > a, a > u, .c00, .c00 a:link, +a[href="http://www.ycombinator.com/apply/"] { + color: #ccc !important; +} + + + + +/* ==== FOOTER ==== */ + +#hnmain > tbody > tr:last-child { + background: linear-gradient(to bottom, #212121 0%, #131313 100%) !important; + +} + +#hnmain > tbody > tr:last-child td[bgcolor="#ff6600"] { + background: transparent !important; + border-top: 1px solid #778888 !important; +} + + + + +/* ==== OTHER ==== */ + +/* textbox formatting help */ +.admin, .admin td, .admin p { + color: #f0ffff !important; + font-size: 14px !important; +} + +/* bookmarklet text */ +table[width="500"] #main > #first { + color: #000 !important; +} + } + + @-moz-document domain("hn.algolia.com") { + /* invertion of algolia logo in the footer */ + .search-wrapper img + { + filter: invert(50%) !important; + } + + /* text highlight color of search results */ + .main .search-results em { + background-color: #b1bcbc !important; + } + + /* dark drop-down menus */ + .wrap-dd-select + { + background-color: #222 !important; + border: 1px solid #828282 !important; + color: #ccc !important; + } + + + /* ==== SEARCH BOX, COMMENT BOX, DROP-DOWN MENU ==== */ + /* Dropdown */ + .Dropdown_label + { + color:#c2c2c2; + } + .Dropdown_list li button { + color: #f3f3f3; + background-color: #45515b; + } + + /* Story */ + .Story_title a + { + color: #F0FFFF; + } + .Story_title .Story_link + { + color: #6d7474; + font-size: 11px; + word-break: break-all; + } + .Story_comment + { + color: #ababab; + } + + /* Search */ + body > center > table, input, textarea, select + { + background-color: #222 !important; + } + .SearchResults_container + { + background-color: #222 !important; + } + .SearchFilters.container + { + background-color: #45515b !important; + } + .SearchFilters { + color: #f3f3f3; + } + .SearchHeader .PoweredBy + { + color:#a0a0a0; + } + .SearchResults + { + background:#222; + box-shadow: 0px 0px 30px 3px rgba(0, 0, 0, 0.2) !important; + border-left: 1px solid #000 !important; + border-right: 1px solid #000 !important; + } + /* Settings view */ + .Settings + { + background-color:#222; + } + .Settings h2 + { + color:#bcbcbc; + } + .Settings label + { + color:#a0a0a0; + } + + /* Other */ + .Pagination + { + background-color:#45515b; + } + .Footer_list a + { + color: #a0a0a0; + } + + /* darker border around search box, comment box and drop-down menu*/ + input, textarea, select { + border: 1px solid #828282 !important; + } + /* bright input text in search box, comment box and drop-down menu */ + td.title a:link, span.comment font, span.comment font a:link, u a:link, span.yclinks a:link, body:not([id]), + td:nth-child(2):not(.subtext) > a:link, input, textarea, select, p > a, a > u, .c00, .c00 a:link, + a[href="http://www.ycombinator.com/apply/"] { + color: #ccc !important; + } + + + /* ==== OTHER ==== */ + body { + background-color: #292929; + } + + .search-results { + background-color: #292929; + } + + .page-header a { + color: #9a9a9a; + } + + + .main .search-results .item .item-main .item-title-and-infos h2 a { + color: #9a9a9a; + } + + #main > div > section > header { + background-color: #292929; + color: #9a9a9a; + } + + .page-header .logo-wrapper .logo-name { + color: #e2e6e9 !important; + } + + #main > div > header { + background-color: #292929; + color: #9a9a9a; + } + + .main .search-results em { + background-color: #dadada !important; /* net net net :D */ + } + + .search-pagination li.active button { + border-color: #dadada; + color: #dadada; + } + + footer { + background-color: #292929; + } + + footer a { + color: #9a9a9a; + } + + #main > div > section > section > section > div.item.ng-scope > div.item-main > div.item-content-wrapper p { + color: #dadada; + } + + .edit-settings { + background-color: #292929; + } + + `; + } + }); })(); diff --git a/.config/qutebrowser/greasemonkey/bttv.js b/.config/qutebrowser/greasemonkey/twitch.js similarity index 55% rename from .config/qutebrowser/greasemonkey/bttv.js rename to .config/qutebrowser/greasemonkey/twitch.js index 2a05201..91d5e15 100644 --- a/.config/qutebrowser/greasemonkey/bttv.js +++ b/.config/qutebrowser/greasemonkey/twitch.js @@ -4,19 +4,15 @@ // @description Enhances Twitch with new features, emotes, and more. // @copyright NightDev, LLC // @icon https://cdn.betterttv.net/assets/logos/bttv_logo.png -// // @grant none -// // @include *://*.twitch.tv/* -// // @version 0.0.2 // ==/UserScript== -(function betterttv() { - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = 'https://cdn.betterttv.net/betterttv.js'; - var head = document.getElementsByTagName('head')[0]; - if (!head) return; - head.appendChild(script); -})() +!function () { + var t = document.createElement("script"); + t.type = "text/javascript", + t.src = "https://cdn.betterttv.net/betterttv.js"; + var e = document.getElementsByTagName("head")[0]; + e && e.appendChild(t) +}(); diff --git a/.config/qutebrowser/userscripts/.gitignore b/.config/qutebrowser/userscripts/.gitignore deleted file mode 100644 index a920063..0000000 --- a/.config/qutebrowser/userscripts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -adapta -readability.html -tor diff --git a/.config/qutebrowser/userscripts/readability b/.config/qutebrowser/userscripts/readability deleted file mode 100755 index c856e4b..0000000 --- a/.config/qutebrowser/userscripts/readability +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# Creates a reader mode view of the current webpage -# -# Depends on the python-readability (lxml) package: -# - http://github.com/buriy/python-readability -# -# Usage: -# :spawn -u readability - -from __future__ import absolute_import -import codecs, os - -tmpfile = "/tmp/readability.html" - -if not os.path.exists(os.path.dirname(tmpfile)): - os.makedirs(os.path.dirname(tmpfile)) - -# Styling for dynamic window margin scaling and line height -HEADER = """ - - - - - %s - - - -""" - -with codecs.open(os.environ['QUTE_HTML'], 'r', 'utf-8') as source: - data = source.read() - - from readability import Document - doc = Document(data) - title = doc.title() - content = doc.summary().replace('', HEADER % title) - - with codecs.open(tmpfile, 'w', 'utf-8') as target: - target.write(content.lstrip()) - - with open(os.environ['QUTE_FIFO'], 'w') as fifo: - fifo.write('open -t %s' % tmpfile) diff --git a/.local/share/qutebrowser/greasemonkey b/.local/share/qutebrowser/greasemonkey deleted file mode 120000 index 2332cda..0000000 --- a/.local/share/qutebrowser/greasemonkey +++ /dev/null @@ -1 +0,0 @@ -../../../.config/qutebrowser/greasemonkey/ \ No newline at end of file diff --git a/.local/share/qutebrowser/userscripts b/.local/share/qutebrowser/userscripts deleted file mode 120000 index df20ad3..0000000 --- a/.local/share/qutebrowser/userscripts +++ /dev/null @@ -1 +0,0 @@ -../../../.config/qutebrowser/userscripts/ \ No newline at end of file