qute: userscript and config cleanup

This commit is contained in:
Phantop 2022-01-12 18:02:54 -05:00
parent 7cc0501025
commit be4bda5326
10 changed files with 63 additions and 557 deletions

View File

@ -1,278 +0,0 @@
* {
border-color: #909396 !important;
}
a {
color: #84beea !important;
}
a:visited {
color: #5294e2 !important;
}
body {
background-color: #222D32 !important;
color: #909396 !important;
}
html {
background-color: #222D32 !important;
}
input,
textarea {
background-color: #222d32 !important;
color: #909396 !important;
}
blockquote,
pre {
background-color: #222d32 !important;
color: #909396 !important;
}
html {
background-color: #222D32 !important;
}
* {
color: #909396 !important;
background-color: transparent !important;
text-shadow: none !important;
border-color: #5e6263 !important;
border-top-color: #5e6263 !important;
border-bottom-color: #5e6263 !important;
border-left-color: #5e6263 !important;
border-right-color: #5e6263 !important;
}
body {
background: transparent !important;
}
*:before,
*:after {
background-color: transparent !important;
border-color: #5e6263 !important;
border-top-color: #5e6263 !important;
border-bottom-color: #5e6263 !important;
border-left-color: #5e6263 !important;
border-right-color: #5e6263 !important;
}
a * {
color: #84beea !important;
}
a:visited * {
color: #5294e2 !important;
}
div[style="display: block;"],
div[role="navigation"] {
background: #263238 !important;
}
table {
background: #222d32 !important;
border-radius: 6px !important;
}
table > tbody > tr:nth-child(even),
table > tbody > tr > td:nth-child(even) {
background-color: rgba(0,0,0,0.2) !important;
}
iframe,
embed,
header,
nav,
footer,
label [onclick],
nav ul,
div[style*="position:"][style*="left:"][style*="visible"],
div[style*="z-index:"][style*="left:"][style*="visible"],
div[style*="-moz-user-select"],
div[role="menu"],
div[role="dialog"],
div[id="task details"],
span[class*="script"] div,
[id*="menu"],
[class*="dropdown"],
[class*="popup"],
[class="title"],
[class="search__autocomplete"],
[class="top-matter"],
ul[style*="display:"],
ul[style*="visibility:"] ul,
[id*="nav"] ul,
[class*="nav"] ul,
ul[class*="menu"],
a[onclick][style*="display"],
a[id*="ghosteryfirefox"],
#ghostery-purple-bubble,
#translator-popup,
.menu,
.tooltip,
.hovercard,
.vbmenu_popup,
* .navigation,
* .navigation a,
ul,
menu,
dir,
#header,
.openData .odGradient,
.stable-head td div,
.rplm-alert .content-wrap,
#navbar *,
#sondage,
div.dlg-window,
.modal-container .modal-content .modal-box .once-modal,
.tabs_main ul li a,
.tabs_main ul li span,
.module-actionbar .module-actionbar-action,
.bg_01,
.bg-default,
.box-highlight,
.bg-brighter,
.mvxl,
#downloads,
.questions-ovl,
.ovl-frame,
.messenger__contacts .scroll,
.messenger__contacts .scroll_,
.messenger__content .scroll,
.messenger__content .scroll_,
.st_error .messenger__content-inner .scroll__,
a.info:hover span,
a.info:focus span,
#system,
#product,
.clicked,
.notClicked,
.notClicked:hover,
#ident_div_ident,
.idAbonne,
#pageFacture .tab-content,
span.conteneurTips,
.ligneOption,
.ligneMevo td,
[id*="footer"],
.modal-dialog,
.cadre-contenu,
#cart_summary,
#loyalty-target,
#cont-subnav,
.wrapper,
.filtre-thematiques-selected,
.filtre-thematiques,
ul.thematiques,
li.thematique.sans-chaines,
a.voir-thematique,
[class*="progTrigger"],
#connexion,
.sub-menu .sub-nav-article-wrapper,
#navMain ul li,
.SMainRack,
.STopRack,
.STopFirst,
.SBotRack,
.result.highlight {
background: #263238 !important;
border-radius: 5px !important;
}
header,
#header,
footer,
#footer {
background: #263238 !important;
}
body > #dialog,
body > .xenOverlay {
background: #263238 !important;
border: 10px !important;
border-radius: 0 !important;
}
[id*="overlay"],
[id*="lightbox"],
blockquote {
background-color: #263238 !important;
border-radius: 5px;
}
input,
select,
button,
a.button,
a.submit,
a.BigButton,
a.TabLink,
.install[onclick],
a[href="javascript:;"],
a[class*="button"]:not(:empty),
a[id*="button"]:not(:empty),
a[id*="Button"]:not(:empty),
div[class*="button"][onclick],
.fbNubFlyoutBodyContent {
background: #263238 !important;
color: #a6aaab !important;
}
input:hover,
select:hover,
button:hover,
a.button:hover,
a.submit:hover,
a.BigButton:hover,
a.TabLink:hover,
.install[onclick]:hover,
a[href="javascript:;"]:hover,
a[class*="button"]:not(:empty):hover,
a[id*="button"]:not(:empty):hover,
a[id*="Button"]:not(:empty):hover,
div[class*="button"][onclick]:hover,
.fbNubFlyoutBodyContent:hover {
background-color: #5e6263 !important;
}
input:active,
select:active,
button:active,
a.button:active,
a.submit:active,
a.BigButton:active,
a.TabLink:active,
.install[onclick]:active,
a[href="javascript:;"]:active,
a[class*="button"]:not(:empty):active,
a[id*="button"]:not(:empty):active,
a[id*="Button"]:not(:empty):active,
div[class*="button"][onclick]:active,
.fbNubFlyoutBodyContent:active {
background-color: #5e6263 !important;
color: #a6aaab !important;
}
input *,
select *,
button *,
a.button *,
a.submit * {
color: #909396 !important;
}
input[type="checkbox"] {
opacity: 100 !important;
}
input[disabled],
select[disabled],
button[disabled],
input[disabled]:hover,
select[disabled]:hover,
button[disabled]:hover,
input[disabled]:focus,
select[disabled]:focus,
button[disabled]:focus {
opacity: 0.5 !important;
border-color: #263238 !important;
}
textarea {
background: #222d32 !important;
}
body,
.r3_hm,
.gmbutton2 b,
.gtab-i,
.ph,
.bstab-iLft,
.csb,
#pagination div,
[style*="sprite2.png"],
#mw-head-base,
#mw-page-base {
background-image: none !important;
}
.link-gray-dark,
.text-gray-dark {
color: #909396 !important;
}

View File

@ -0,0 +1,13 @@
host = c.content.blocking.hosts.lists.append
host("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all")
abp = c.content.blocking.adblock.lists.append
abp("https://fanboy.co.nz/r/fanboy-ultimate.txt")
abp("https://fanboy.co.nz/fanboy-antifacebook.txt")
abp("https://secure.fanboy.co.nz/fanboy-annoyance.txt")
abp("https://secure.fanboy.co.nz/fanboy-cookiemonster.txt")
abp("https://easylist-downloads.adblockplus.org/antiadblockfilters.txt")
abp("https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt")

View File

@ -2,18 +2,11 @@ bind = {
'<Ctrl-q>': 'close',
'<Ctrl-r>': 'spawn -u readability',
'<Ctrl-w>': 'tab-close',
'<Ctrl-Shift-R>': 'spawn kitty rdrview -B qutebrowser {url}',
'<Alt+f>' : 'config-cycle hints.chars qwerasdf asdfghjkl',
'm': 'mpv {url}',
'M': 'mpv4 {url}',
',': 'hint links run mpv {hint-url}',
';m': 'hint links run mpv {hint-url}',
';M': 'hint links run mpv4 {hint-url}',
'm': 'mpv {url}',
's1': 'download-open',
'sa': 'open -t archive.is/?run=1&url={url}',
'sc': 'config-cycle content.user_stylesheets adapta.css ""',
'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'",
'sg': 'debug-dump-page ~/Downloads/dump.html',
'sq': 'spawn -u qr',

View File

@ -1,13 +1,10 @@
from qutebrowser.api import interceptor
import operator, typing, socket
import operator
invid = 'vid.puffyan.us'
nitter = 'nitter.snopyta.org'
reddit = 'teddit.net'
if socket.gethostname() == "aperture":
invid = 'localhost'
o = operator.methodcaller
s = 'setHost'
i = interceptor
@ -18,10 +15,7 @@ MAP = {
"old.reddit.com": o(s, reddit),
"twitter.com": o(s, nitter),
"api.twitter.com": o(s, nitter),
"mobile.twitter.com": o(s, nitter),
"platform.twitter.com": o(s, nitter),
"www.platform.twitter.com": o(s, nitter),
"youtu.be": o(s, invid),
"youtube.com": o(s, invid),

View File

@ -1,66 +1,32 @@
config.load_autoconfig(False)
config.source('adapta.py')
config.source('bindings.py')
config.source('redirects.py')
config.source('conf/adapta.py')
config.source('conf/adblock.py')
config.source('conf/bindings.py')
config.source('conf/redirects.py')
c.url.default_page = "feedly.com/i/my"
c.url.start_pages = ["localhost", "duck.com/?q=20m timer"]
c.url.searchengines['y'] = "localhost/search?q={}"
c.url.start_pages = "covid19.rpi.edu/dailycheckin"
c.url.searchengines['y'] = "vid.puffyan.us/search?q={}"
c.content.fullscreen.window = True
c.downloads.location.prompt = False
c.input.insert_mode.auto_leave = False
c.scrolling.smooth = True
c.url.open_base_url = True
c.content.fullscreen.window = True
c.completion.open_categories = ["quickmarks", "bookmarks", "history"]
c.confirm_quit = ["downloads"]
c.content.cookies.accept = "no-3rdparty"
#c.content.pdfjs = True
c.fonts.default_size = "9pt"
c.qt.force_platformtheme = "gtk2"
c.tabs.show = "multiple"
c.confirm_quit = ["downloads"]
c.qt.force_platformtheme = "gtk2"
c.content.cookies.accept = "no-3rdparty"
c.colors.webpage.preferred_color_scheme = 'dark'
ccw = c.colors.webpage
ccwd = ccw.darkmode
#ccwd.enabled = True
ccwd.policy.images = 'never'
ccw.preferred_color_scheme = 'dark'
mpv = 'spawn -m -d -v mpv --ytdl-raw-options=write-sub=,write-auto-sub=,embed-subs=,sub-lang=en'
c.aliases['mpv'] = mpv
c.aliases['mpv4'] = mpv + ' --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio'
c.aliases['remove-sticky'] = 'jseval -q !function(){var e,o=document.querySelectorAll("body *");for(e=0;e<o.length;e++)["sticky","fixed"].includes(getComputedStyle(o[e]).position)&&o[e].parentNode.removeChild(o[e])}();'
c.aliases['re'] = 'restart'
c.aliases['mpv'] = 'spawn -mdv mpv --ytdl-raw-options=sub-lang=en'
c.aliases['remove-sticky'] = 'jseval -q document.querySelectorAll("*").forEach(e=>{["sticky","fixed"].includes(getComputedStyle(e).position)&&e.parentNode.removeChild(e)})'
host = c.content.blocking.hosts.lists.append
host("https://github.com/Perflyst/PiHoleBlocklist/raw/master/AmazonFireTV.txt")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/twitter/all")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/microsoft/all")
host("https://github.com/jmdugan/blocklists/raw/master/corporations/facebook/all")
abp = c.content.blocking.adblock.lists.append
abp("https://fanboy.co.nz/r/fanboy-ultimate.txt")
abp("https://fanboy.co.nz/fanboy-antifacebook.txt")
abp("https://secure.fanboy.co.nz/fanboy-annoyance.txt")
abp("https://secure.fanboy.co.nz/fanboy-cookiemonster.txt")
abp("https://easylist-downloads.adblockplus.org/antiadblockfilters.txt")
abp("https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt")
config.set('content.persistent_storage', True, 'https://mega.nz')
config.set('content.desktop_capture', True, 'https://discord.com')
config.set('content.media.audio_capture', True, 'https://discord.com')
config.set('content.notifications.enabled', True, 'https://mail.tutanota.com')
config.set('content.register_protocol_handler', True, 'https://mail.tutanota.com')
config.set('content.register_protocol_handler', False, 'https://mail.google.com?extsrc=mailto&url=%25s')
import socket
if socket.gethostname() == "wheatley":
c.qt.highdpi = True
c.zoom.default = 125
c.url.start_pages = "covid19.rpi.edu/dailycheckin"
c.url.searchengines['y'] = "vid.puffyan.us/search?q={}"
c.fonts.default_size = "11pt"
c.qt.force_software_rendering = "chromium"
#import dracula.draw

View File

@ -1,105 +1,17 @@
// ==UserScript==
// @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/*
// @include http*://archiveofourown.org/users/*/bookmarks*
// @include http*://archiveofourown.org/users/*/readings*
// @grant none
// @version 2.0
// @name AO3 Lazier
// @include https://archiveofourown.org/*
// @version 3.0
// ==/UserScript==
document.querySelectorAll('li.blurb').forEach(b=>{
i=b.querySelector('.heading a').href.match(/[0-9]+/)
b.innerHTML += `<div class="actions">
<a style="position:absolute;right:7em;top:.5em"
href='/downloads/${i}/*.epub'>Download</a></div>`})
(function () {
const blurbs = Array.from(document.querySelectorAll('li.blurb'));
if (!blurbs.length) {
return;
}
const style = document.createElement('style');
style.innerHTML = `
.blurb .download.actions {
position: absolute;
right: 7em;
top: 0.5em;
white-space: nowrap;
}
.blurb .download .expandable {
position: absolute;
right: calc(100% + 0.5em);
top: -0.5em;
}
.blurb .download .expandable li {
display: inline-block;
margin: 0;
}
`;
document.head.appendChild(style);
blurbs.forEach(blurb => {
const titleLink = blurb.querySelector('.header.module .heading a');
const title = titleLink.textContent.trim();
const workId = titleLink.href
.match(/\/works\/(\d+)\b/)[1];
const formats = ['azw3', 'epub', 'mobi', 'pdf', 'html'];
const tuples = formats
.map(ext => [
ext.toUpperCase(),
`/downloads/${workId}/${encodeURIComponent(title)}.${ext}?updated_at=${Date.now()}`
]);
blurb.innerHTML += `
<div class="download actions" aria-haspopup="true">
<a href="#" class="collapsed">Download</a>
<ul class="expandable secondary hidden">
${
tuples.map(([label, href]) => `
<li>
<a href=${href}>
${label}
</a>
</li>
`)
.join('')
}
</ul>
</div>
`;
blurb.querySelector('.download.actions > a').addEventListener('click', ev => {
const button = ev.currentTarget;
button.classList.toggle('collapsed');
button.classList.toggle('expanded');
button.parentNode
.querySelector('.expandable')
.classList.toggle('hidden');
ev.preventDefault();
});
});
})();
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);
}
}
b=document.createElement('a')
c=document.getElementsByTagName('option')
i=document.getElementsByClassName('chapter')[2]
b.innerText = 'Latest Chapter →'
b.href = c[c.length-1].value
i.parentElement.insertBefore(b, i)

View File

@ -1,107 +1,24 @@
// ==UserScript==
// @name Discord Simple Clear
// @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
// @name DisClear
// @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 8148fe3
// ==/UserScript==
(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/773556458234052608/929383713932992512/0dKbZO5-16-9.webp");
background-size: cover;
}
.header-2o-2hj, /*remove borders*/
.searchBar-6Kv8R2,
.content-yTz4x3::before {
box-shadow: none !important;
}
.container-2cd8Mz, /*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-2yBXZL {
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;
const style = document.createElement('style')
document.head.appendChild(style)
style.innerHTML = `.theme-dark, .theme-light {
--background-primary: transparent;
--background-secondary: transparent;
--background-secondary-alt: transparent;
--background-tertiary: transparent;
--background-floating: rgba(0, 0, 0, .8);
--background-floating: rgba(0, 0, 0, .6);
--channeltextarea-background: transparent;
--deprecated-panel-background: transparent;
--background-modifier-hover: rgba(0, 0, 0, .42);
--background-modifier-selected: rgba(0, 0, 0, .45);
--font-primary: "Ubuntu Mono";
}
/* ------POP-UP------ */
.modal-yWgWj-,
.footer-3rDWdC {
background: rgba(0, 0, 0, .5) !important;
}
.container-2cd8Mz, .searchBar-3TnChZ, .listItemWrapper-3d87LP,
[aria-label="Help"], [aria-label="Inbox"], [aria-label="Send a gift"],
[href="/store"], [href="/channels/@me"] {display: none}
/* -----UNREAD BADGE DARKMODE FIX----- */
.item-2hkk8m {
background-color: #ccc;
}
.unread-2lAfLh {
background-color: #ccc;
}
`;
}
});
})();
body {background: url(
"https://cdn.discordapp.com/attachments/773556458234052608/929383713932992512/0dKbZO5-16-9.webp"
)}`

View File

@ -1,18 +1,7 @@
// ==UserScript==
// @name BetterTTV
// @namespace BTTV
// @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
// @include https://www.twitch.tv/*
// ==/UserScript==
!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)
}();
s = document.createElement("script")
s.src = "https://cdn.betterttv.net/betterttv.js"
document.head.appendChild(s)

View File

@ -3,6 +3,7 @@ alias a 'alias -s'
a aliases 'v (which aliases); command aliases'
a all2jxl 'fd -e{png,jpg} -x cjxl -e 8 -d 0 {} {.}.jxl && fd -e{png,jpg} -x rm'
a ao3 'grep epub $argv | cut -d\" -f2 | parallel aria2c "https://ao3.org{}" -dao3;rm'
a base64d 'echo (echo $argv | base64 -d 2>/dev/null);:'
a bax 'source (which bax) && bax'
a catbox 'curl https://catbox.moe/user/api.php -F reqtype=fileupload -F fileToUpload=@$argv;:'
@ -17,9 +18,12 @@ a g git
a giveme 's chown $USER'
a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
a imgsum 'printf "$argv: " && identify -format "%#\n"'
a invid 'tmux new -s 0 -d "docker-compose -f ~/.config/invid.yml up --build"'
a l ls
a la 'l -A'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
a less 'eval $PAGER'
a listen 'pactl list | grep loop && set t un; pactl "$t"load-module module-loopback'
a musikcube 'screen -R -s musikcube'
a nix 'bax . ~/.nix-profile/etc/profile.d/nix.sh; command nix'
a off shutdown
@ -37,6 +41,7 @@ a se 's eopkg'
a spleet 'spleeter separate -o . -c flac'
a ta 'tmux a -t (math 0 + "0$argv");:'
a tar bsdtar
a tcsv 'curl -sL http://torrents-csv.ml/service/search?q="$argv"|jq ".[]|.name,.infohash,.seeders";:'
a temp 'curl temp.sh -T'
a transfer 'curl https://transfer.sh/(basename $argv) -T'
a twitch-dl 'ffmpeg -i (yt-dlp -e $argv[1]|tr / _) -c copy $argv[2..-1] "file:(yt-dlp -g $argv[1]).mkv"'
@ -47,11 +52,6 @@ a wallp 'gsettings set org.gnome.desktop.background picture-uri file://(realpath
a wm 'startx (which $argv[1]) $argv[2..-1]'
a ydl 'while not yt-dlp $argv; end;:'
a ao3 'grep epub $argv | cut -d/ -f2-3 | parallel aria2c "https://ao3.org/{}/\*.epub" -dao3;rm'
a invid 'tmux new -s 0 -d "docker-compose -f ~/.config/invid.yml up --build"'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
a listen 'pactl list | grep loop && set t un; pactl "$t"load-module module-loopback'
a tcsv 'curl -sL http://torrents-csv.ml/service/search?q="$argv"|jq ".[]|.name,.infohash,.seeders";:'
a 7zstd '7z a -m0=zstd -mx22 -mmt=8 -mfb=273 -md=256m -ms=on (realpath $argv[1]).7z'
a compress '7z a -m0=flzma2 -mx9 -mmt=8 -mfb=273 -md=256m -ms=on (realpath $argv[1]).7z'