From 6e1e9e272ce6cfb615d1863c53f27d0836a77b7d Mon Sep 17 00:00:00 2001 From: Phantop Date: Sat, 9 Apr 2022 15:38:29 -0400 Subject: [PATCH] bin: comparedir, qute: searx, privoxy, ao3 tags --- bin/comparedir | 9 +++++++++ bin/optiflac | 21 +++++++-------------- bin/setup | 2 +- mpv/mpv.conf | 2 ++ qutebrowser/aliases.py | 1 - qutebrowser/bindings.py | 8 ++++---- qutebrowser/config.py | 6 +++++- qutebrowser/quickmarks | 1 - 8 files changed, 28 insertions(+), 22 deletions(-) create mode 100755 bin/comparedir diff --git a/bin/comparedir b/bin/comparedir new file mode 100755 index 0000000..f2f91a4 --- /dev/null +++ b/bin/comparedir @@ -0,0 +1,9 @@ +#!/bin/sh +IFS=$(printf '\n\t') +for i in $(fd -t f); do + if [ "$(du "$i" | cut -f1)" -lt "$(du "$1/$i" | cut -f1)" ]; then + echo "$i" + mv "$i" "$1/$i" + fi +done + diff --git a/bin/optiflac b/bin/optiflac index 3c2295e..424d60c 100755 --- a/bin/optiflac +++ b/bin/optiflac @@ -1,22 +1,15 @@ #!/bin/sh -compare() { - cd out - for i in *; do - if [ `du "$i" | cut -f1` -lt `du ../"$i" | cut -f1` ]; then - echo $i - mv "$i" ../"$i" - fi - done - cd .. -} - mkdir out args="-af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16" -fd -e flac -d1 -x ffmpeg -hide_banner -i {} -c:v copy -c:a flac -compression_level 12 $args $@ out/{} -compare +fd -e flac -d1 -x ffmpeg -hide_banner -i {} -c:v copy -c:a flac -compression_level 12 "$args" "$@" out/{} +cd out || exit 1 +comparedir .. +cd .. || exit 1 fd -e flac -d1 -x flac -f8 {} -o out/{} -compare +cd out || exit 1 +comparedir .. +cd .. || exit 1 rm -r out diff --git a/bin/setup b/bin/setup index d1159e9..1b6a329 100755 --- a/bin/setup +++ b/bin/setup @@ -9,7 +9,7 @@ gui="caja gimp keepassxc kitty nicotine-plus qutebrowser syncthing zathura-mupdf med="audaci{ty,ous{,-plugins}} avidemux mkvtoolnix mpv opus-tools spek yt-dlp" ric="ant-dracula-gtk-theme autojump font-ubuntu-ttf rofi starship stow" tui="advancecomp aria2 fd fish fzf innoextract jpegoptim ncdu ripgrep tig" -sys="bleachbit corectrl ifuse linux-tools-cpupower p7zip tlp usbmuxd upx" +sys="bleachbit corectrl ifuse linux-tools-cpupower p7zip privoxy tlp usbmuxd upx" se up; se it -c system.devel $dev $gui $med $ric $sys $tui stow --no-folding -d ~/.dotfiles -t ~/.config . diff --git a/mpv/mpv.conf b/mpv/mpv.conf index 7cab8ac..b5f4204 100644 --- a/mpv/mpv.conf +++ b/mpv/mpv.conf @@ -18,6 +18,8 @@ use-filedir-conf sub-font = Funimitation sub-font-size = 36 +ytdl-raw-options=sub-lang=en + profile = gpu-hq scale = spline36 cscale = spline36 diff --git a/qutebrowser/aliases.py b/qutebrowser/aliases.py index e7acace..260420e 100644 --- a/qutebrowser/aliases.py +++ b/qutebrowser/aliases.py @@ -1,6 +1,5 @@ a=c.aliases a['re'] = 'restart' -a['mpv'] = 'spawn -mdv mpv --ytdl-raw-options=sub-lang=en' a['css-reload'] = 'set content.user_stylesheets user.css' a['scss-reload'] = 'spawn -u /bin/bash -c "sassc $QUTE_CONFIG_DIR/user.{s,}css"' a['remove-sticky'] = 'jseval -q document.querySelectorAll("*").forEach(e=>{["sticky","fixed"].includes(getComputedStyle(e).position)&&e.parentNode.removeChild(e)})' diff --git a/qutebrowser/bindings.py b/qutebrowser/bindings.py index 15706a3..610fc6d 100644 --- a/qutebrowser/bindings.py +++ b/qutebrowser/bindings.py @@ -6,23 +6,23 @@ bind = { '': 'ao3-first', '': 'ao3-latest', '' : 'config-cycle hints.chars qwerasdf asdfghjkl', - ',': 'hint links run mpv {hint-url}', + ',': 'hint links run spawn -mdv mpv {hint-url}', ';a': 'hint links run ' + kitdl + ' dl {hint-url}"', ';v': 'hint links run ' + kitdl + ' ydl {hint-url}"', 'aa': kitdl + ' dl {url}"', 'av': kitdl + ' ydl {url}"', 'e': 'config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload', 'E': 'config-cycle -p content.javascript.enabled ;; reload', - 'm': 'mpv {url}', + 'm': 'spawn -mdv mpv {url}', 's1': 'download-open', 'sa': 'open -t archive.is/submit/?url={url}', 'sc': 'toggle-dark', - 'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'", + 'sd': "spawn fish -c 'dl; open (ls -a | rofi -dmenu -b -i || exit 0)'", 'sg': 'debug-dump-page ~/Downloads/dump.html', 'sm': 'monolith-save ~/Downloads/dump.html"', 'sq': 'spawn -u qr', 'sr': 'remove-sticky', - 'st': 'config-cycle -p content.proxy socks://localhost:9050/ system', + 'st': 'config-cycle -p content.proxy socks://localhost:9050 http://localhost:8118', 'T' : 'tab-next', 'td': 'config-unset -u {url:host} content.headers.user_agent', } diff --git a/qutebrowser/config.py b/qutebrowser/config.py index 7140e05..a994359 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -8,8 +8,10 @@ config.source('redirects.py') c.url.start_pages = c.url.default_page = 'megafocs.herokuapp.com' config.set('content.javascript.enabled', True, c.url.start_pages) +c.url.searchengines['DEFAULT'] = 'farside.link/searxng/search?q={}' c.url.searchengines['y'] = 'farside.link/invidious/search?q={}' -c.url.searchengines['DEFAULT'] = 'kagi.com/search?q={}' +c.url.searchengines['t'] = 'ao3.org/tags/{}' +c.url.searchengines['!'] = 'duckduckgo.com/?q=!{}' c.tabs.show = 'multiple' c.confirm_quit = ['downloads'] @@ -18,8 +20,10 @@ c.content.fullscreen.window = True c.content.user_stylesheets = 'user.css' c.content.cookies.accept = 'no-3rdparty' c.colors.webpage.darkmode.enabled = True +c.content.proxy = 'http://localhost:8118' c.colors.webpage.preferred_color_scheme = 'dark' c.colors.webpage.darkmode.policy.images = 'never' +c.completion.open_categories = ["bookmarks","history"] import socket if socket.gethostname() == 'wheatley': diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks index 91a12bf..d7ce12f 100644 --- a/qutebrowser/quickmarks +++ b/qutebrowser/quickmarks @@ -1,4 +1,3 @@ -dial covid19.rpi.edu/dailycheckin discord canary.discord.com/app hn news.ycombinator.com lms lms.rpi.edu/ultra/stream