From 0363be74bdd32b680499f84a729b2ac60dd30924 Mon Sep 17 00:00:00 2001 From: Phantop Date: Mon, 8 Nov 2021 16:38:08 -0500 Subject: [PATCH] qute: more redirects, dwarfs: tidy, mpv: yt-dlp --- dot-config/mpv/mpv.conf | 1 + dot-config/qutebrowser/config.py | 1 - dot-config/qutebrowser/quickmarks | 2 +- dot-config/qutebrowser/redirects.py | 42 +++++++++++++++-------------- dot-local/bin/aliases | 2 +- dot-local/bin/dwarfmount | 2 +- dot-local/bin/foldwarf | 4 +-- dot-local/bin/setup | 6 ++--- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/dot-config/mpv/mpv.conf b/dot-config/mpv/mpv.conf index c3a3927..7cab8ac 100644 --- a/dot-config/mpv/mpv.conf +++ b/dot-config/mpv/mpv.conf @@ -8,6 +8,7 @@ volume-max = 1000 cache = yes demuxer-max-bytes = 2147483647 demuxer-max-back-bytes = 2147483647 +script-opts=ytdl_hook-ytdl_path=yt-dlp audio-file-auto = exact audio-file-paths = ../Custom Tracks:./Custom Tracks:../Audio:./Audio diff --git a/dot-config/qutebrowser/config.py b/dot-config/qutebrowser/config.py index b001b36..d9fb38f 100644 --- a/dot-config/qutebrowser/config.py +++ b/dot-config/qutebrowser/config.py @@ -62,7 +62,6 @@ if socket.gethostname() == "wheatley": c.url.start_pages = "covid19.rpi.edu/dailycheckin" c.url.searchengines['y'] = "vid.puffyan.us/search?q={}" c.fonts.default_size = "11pt" - c.aliases['mpv'] = mpv + ' --ytdl-format=bestvideo[vcodec^=avc1]+bestaudio' #import dracula.draw #dracula.draw.blood(c, {'spacing': {'vertical': 1,'horizontal': 0}}) diff --git a/dot-config/qutebrowser/quickmarks b/dot-config/qutebrowser/quickmarks index 0189f62..033e6ce 100644 --- a/dot-config/qutebrowser/quickmarks +++ b/dot-config/qutebrowser/quickmarks @@ -2,6 +2,6 @@ dial https://covid19.rpi.edu/dailycheckin discord https://canary.discord.com/app drop https://drop.lol hn https://news.ycombinator.com -lms https://lms.rpi.edu/ultra/stream +lms https://lms.rpi.edu submitty https://submitty.cs.rpi.edu/courses/f21/csci1200/polls tuta https://mail.tutanota.com diff --git a/dot-config/qutebrowser/redirects.py b/dot-config/qutebrowser/redirects.py index 4d86b7e..57e3247 100644 --- a/dot-config/qutebrowser/redirects.py +++ b/dot-config/qutebrowser/redirects.py @@ -13,29 +13,31 @@ s = 'setHost' i = interceptor MAP = { - "reddit.com": o(s, reddit), - "www.reddit.com": o(s, reddit), - "old.reddit.com": o(s, reddit), + "reddit.com": o(s, reddit), + "www.reddit.com": o(s, reddit), + "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), + "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), - "www.youtube.com": o(s, invid), + "youtu.be": o(s, invid), + "youtube.com": o(s, invid), + "www.youtube.com": o(s, invid), - "www.instagram.com": o(s, 'bibliogram.art'), + "www.instagram.com": o(s, 'bibliogram.art'), "www.amazon.com": o(s, 'smile.amazon.com'), -} + "imgur.com" : o(s, 'imgin.voidnet.tech'), + "medium.com" : o(s, 'scribe.rip') + } def f(info: i.Request): - if (info.resource_type != i.ResourceType.main_frame or - info.request_url.scheme() in {"data", "blob"}): - return - url = info.request_url - redir = MAP.get(url.host()) - if redir is not None and redir(url) is not False: - info.redirect(url) + if (info.resource_type != i.ResourceType.main_frame or + info.request_url.scheme() in {"data", "blob"}): + return + url = info.request_url + redir = MAP.get(url.host()) + if redir is not None and redir(url) is not False: + info.redirect(url) i.register(f) diff --git a/dot-local/bin/aliases b/dot-local/bin/aliases index 7ed48b2..6d81389 100755 --- a/dot-local/bin/aliases +++ b/dot-local/bin/aliases @@ -41,7 +41,7 @@ a up 'se up --y' a v vi a vi nvim a wallp 'gsettings set org.gnome.desktop.background picture-uri file://(realpath $argv);:' -a wm 'startx (which $argv[1]; argv[2..-1])' +a wm 'startx (which $argv[1]) $argv[2..-1]' a ao3 'egrep works/[0-9]+ $argv -o | uniq | tr -d a-z | parallel aria2c "https://ao3.org/downloads{}/\*.epub" -d ao3; rm' a invid 'tmux new -s 0 -d "docker-compose -f ~/.config/invid.yml up --build"' diff --git a/dot-local/bin/dwarfmount b/dot-local/bin/dwarfmount index 1d3b62b..57fc364 100755 --- a/dot-local/bin/dwarfmount +++ b/dot-local/bin/dwarfmount @@ -2,5 +2,5 @@ DIR=~/dwarf/$(basename "$@" .dwarfs)$RANDOM mkdir -p "$DIR" echo "$DIR" -dwarfs -o offset=auto -f "$@" "$DIR" 2> /dev/null +dwarfs -o offset=auto -o tidy_strategy=swap -f "$@" "$DIR" 2> /dev/null rmdir "$DIR" ~/dwarf 2> /dev/null diff --git a/dot-local/bin/foldwarf b/dot-local/bin/foldwarf index 03875e5..fe46e0c 100755 --- a/dot-local/bin/foldwarf +++ b/dot-local/bin/foldwarf @@ -5,7 +5,7 @@ echo D=\"$1\" >> $H cat >> $H <<'EOF' if [ ! -d "$D" ]; then mkdir "$D" - dwarfs -o offset=auto "$0" "$D" + dwarfs -o offset=auto -o tidy_strategy=swap "$0" "$D" else fusermount -u "$D" rmdir "$D" @@ -14,6 +14,6 @@ exit EOF shift -mkdwarfs -i . -o "$PWD.sh" --header $H $@ +mkdwarfs -i . -o "$PWD.sh" -B3 --header $H $@ chmod +x "$PWD.sh" rm $H diff --git a/dot-local/bin/setup b/dot-local/bin/setup index d3313f5..479e5da 100755 --- a/dot-local/bin/setup +++ b/dot-local/bin/setup @@ -4,16 +4,16 @@ alias s=sudo se="sudo eopkg -y" g=git gnome="$(echo eog file-roller gnome-{photos,mpv,terminal} nautilus rhythmbox)" audio="audacious audacious-plugins audacity opus-tools quodlibet spek" dev="ccache docker-compose git-extras llvm-clang neovim parallel solbuild tig upx" -gui="bleachbit caja gmic-gimp engrampa keepassxc kitty lutris vorta" +gui="abiword caja gmic-gimp engrampa keepassxc kitty lutris vorta" media="avidemux gaupol jpegoptim mpv playerctl usbmuxd viewnior zathura-poppler" rice="ant-dracula-gtk-theme font-ubuntu-ttf rofi starship stow" term="advancecomp autojump fd fish fzf innoextract most ncdu p7zip ranger ripgrep tmux" -sys="corectrl ifuse linux-tools-cpupower python-wheel rsync tlp" +sys="bleachbit corectrl ifuse linux-tools-cpupower python-wheel rsync tlp" web="arcanist aria2 nicotine-plus qutebrowser openssh-server rclone subliminal syncthing-gtk" se up se it -c system.devel $audio $dev $gui $media $rice $sys $term $web -se rm $gnome firefox hexchat onboard thunderbird +se rm $gnome firefox hexchat libreoffice-common onboard thunderbird se rm --ignore-dependency plata-theme tracker echo source ~/.config/bashrc > ~/.bashrc