fish: pager, fisher, jo, fd; qute: hosts, alias

This commit is contained in:
Phantop 2022-03-20 23:12:23 -04:00
parent 9510e339bb
commit 12aa838615
12 changed files with 90 additions and 106 deletions

4
bin/72
View File

@ -1,4 +0,0 @@
#!/bin/sh
xrandr --newmode $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2-)
xrandr --addmode $(xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2)
xrandr --output $(xrandr --listactivemonitors | tail -n1 | cut -d' ' -f5- | awk '$1=$1') --mode $(cvt 1920 1080 72 | tail -n1 | cut -d' ' -f2)

View File

@ -1,14 +1,17 @@
#!/usr/bin/fish
alias a 'alias -s'
set -U fish_features 3.0
rm -r ~/.config/fish/functions
rm -r ~/.config/fish/*
ln -s ~/.dotfiles/fish/config.fish ~/.config/fish
a acmus 'timeout --foreground (math 3600 - (date +%s) % 3600) mpv --loop https://acmusicext.com/static/$argv/sunny/(date +%-I%p|tr APM apm).ogg'
curl -sL https://git.io/fisher | source
fisher install {jorgebucaran/replay,PatrickF1/fzf}.fish
set -U fish_features 3.{0,1,4}
alias a 'alias -s'
a acmus 'timeout (math 60 - (date +%M))m mpv --loop https://acmusicext.com/static/$argv/sunny/(date +%-I%P).ogg'
a aliases 'v (env which aliases); command aliases'
a all2jxl 'fd -e{png,jpg} -x cjxl -e 8 -d 0 {} {.}.jxl && fd -e jxl -x rm {.}.{pn,jp}g'
a ao3 'grep -Eo works/[0-9]+ $argv | uniq | tr -d a-z | parallel aria2c "https://ao3.org/downloads{}/\*.epub" -d ao3; rm'
a all2jxl 'fd -e{pn,jp}g -x cjxl -e 8 -d 0 {} {.}.jxl \; -x rm'
a ao3 'grep works/.\*/b $argv | cut -d/ -f3 | parallel curl -OJL ao3.org/downloads/{}/1.epub;:'
a base64d 'echo (echo $argv | base64 -d 2>/dev/null) | tee /dev/stderr 2>| clip;:'
a bax 'source (which bax) && bax'
a catbox 'curl https://catbox.moe/user/api.php -F reqtype=fileupload -F fileToUpload=@$argv;:'
a clip 'xclip -sel clip'
a cpugov 's cpupower frequency-set -g performance'
@ -18,43 +21,39 @@ a dot 'cd ~/.dotfiles'
a ff 'fd -HILi -Edosdevices -E.git'
a g git
a giveme 's chown $USER'
a gsopti 'fd -e pdf -x gs -sDEVICE=pdfwrite -dNOPAUSE -sOutputFile={}1 {} && fd -e pdf -x mv {}1 {}'
a gsopti 'fd -e pdf -x gs -sDEVICE=pdfwrite -dNOPAUSE -sOutputFile={}1 {} \; -x mv {}1 {}'
a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
a imgsum 'printf "$argv: " && identify -format "%#\n"'
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 ncdu 'ncdu --color off --graph-style hash'
a nix 'bax . ~/.nix-profile/etc/profile.d/nix.sh; command nix'
a nix 'replay . ~/.nix-profile/etc/profile.d/nix.sh; command nix'
a nsp 'netsurf (pandoc $argv -s -t html | psub -s .html);:'
a nsmd 'netsurf (md2html $argv | psub -s .html);:'
a off shutdown
a offh 'off (math "60*"$argv);:'
a open xdg-open
a pagedl 'wget -H -k -p --no-clobber -e robots=off'
a png2webp 'fd -e png -x cwebp -z 9 -mt {} -o {.}.webp && fd -e webp -x rm {.}.png'
a png2webp 'fd -e png -x cwebp -z 9 -mt {} -o {.}.webp \; -x rm'
a qutainer 'qutebrowser -B /tmp'
a rmdirs 'ff -t d -x rmdir -p'
a rmlinks 'ff -t l -x rm'
a qb 'qutebrowser --target auto'
a qbm 'qb (md2html $argv | psub -s .html);:'
a re 'systemctl reboot -i'
a s 'sudo env "PATH=$PATH"'
a se 's eopkg'
a spleet 'spleeter separate -o . -c flac'
a tar bsdtar
a tcsv 'curl -sL http://torrents-csv.ml/service/search?q="$argv"|jq ".[]|.name,.infohash,.seeders";:'
a tcsv 'curl -sL http://torrents-csv.ml/service/search?q=$argv | jq ".[]|.name,.infohash,.seeders";:'
a temp 'curl temp.sh -T'
a tldrl 'curl -s https://raw.githubusercontent.com/tldr-pages/tldr/master/pages/{common,linux}/$argv.md;:'
a tldrl 'curl -s https://raw.githubusercontent.com/tldr-pages/tldr/main/pages/{common,linux}/$argv.md;:'
a transfer 'curl https://transfer.sh/(basename $argv) -T'
a twitch 'mpv https://twitch.tv/$argv & disown ;:'
a twitch-dl 'ffmpeg -i (yt-dlp -e $argv[1]|tr / _) -c copy $argv[2..-1] "file:(yt-dlp -g $argv[1]).mkv"'
a untar 'tar xf'
a uneopkg 'parallel "unzip -op {} install.tar.xz | tar xf -" ::: *.eopkg'
a up 'se up --y'
a v vi
a venv 'python3 -m venv venv && source venv/bin/activate.fish && pip3 install -r requirements.txt'
a vi nvim
a wallp 'gsettings set org.gnome.desktop.background picture-uri file://(realpath $argv);:'
a warcdl 'pagedl --warc-file=(basename $argv)'
a wm 'startx (which $argv[1]) $argv[2..-1]'
a ydl 'while not yt-dlp $argv; end;:'

13
bin/nse Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
d=$(mktemp -d)
bsdtar xf "$@" -C$d
t=$(fd -e ncx . $d)
xml_grep content $t | uniq | grep content | cut -d\" -f2 |\
sed -e 's#.*#<a href="&">&</a><br />#' -e 's#">[^/<]*/#">#'\
-e 's/\.xhtml/\.html/g' > $(dirname $t)/index.html
fd -e xhtml . $d -x mv {} {.}.html
if test -z $BROWSER; then
BROWSER=netsurf
fi
eval $BROWSER $(dirname $t)/index.html
rm -rf $d

View File

@ -8,7 +8,7 @@ dev="arcanist ccache git-extras llvm-clang neovim parallel qt-creator solbuild"
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 most ncdu ripgrep tig"
tui="advancecomp aria2 fd fish fzf innoextract jpegoptim ncdu ripgrep tig"
sys="bleachbit corectrl ifuse linux-tools-cpupower p7zip tlp usbmuxd upx"
se up; se it -c system.devel $dev $gui $med $ric $sys $tui
@ -22,7 +22,6 @@ un(){ F=$(mktemp); mkdir -p "$2"; curl https://api.github.com/repos/"$1"/release
grep -om1 http.\*zip | wget -i- -O"$F"; unzip "$F" -d "$2";}
un bloc97/Anime4k ~/.config/mpv/shaders
un mozilla/pdf.js ~/.local/share/qutebrowser/pdfjs
wget https://adsbypasser.github.io/releases/adsbypasser.full.es7.user.js -P ~/.config/qutebrowser/greasemonkey/
pip3 install adblock pipx-in-pipx readability-lxml
chsh -s "$(which fish)"

View File

@ -20,13 +20,13 @@ chmod +x "$out"
ln -s "$out" "$dir"
trap "res=$?" 0 1 2 3 5 10 13 15
EOF
echo "$prefix"'$dir/`basename $out` $@' >> "$1"~
echo "$prefix"'$dir/`basename $out` "$@"' >> "$1"~
cat >> "$1"~ << 'EOF'
rm "$out" "$dir"/`basename $out`
exit $res
EOF
zstd --ultra -22 "$1" &&
zstdmt --ultra -22 "$1" &&
cat "$1"~ "$1".zst > "$1"
rm "$1".zst "$1~"
chmod +x "$1"

View File

@ -1,30 +1,25 @@
fish_add_path -g ~/{.local,Games}/bin /usr/lib64/ccache/bin
export EDITOR=nvim MANPAGER='nvim +Man!' USE_CCACHE=1
if tty -s
set -x EDITOR nvim
set -x PAGER most
set -x MANPAGER 'nvim +Man!'
set -x USE_CCACHE 1
set fish_greeting
set fish_color_command --bold
set fish_color_comment red
set fish_color_end brmagenta
set fish_color_error brred
set fish_color_escape 'bryellow' '--bold'
set fish_color_match --background=brblue
set fish_color_operator bryellow
set fish_color_param cyan
set fish_color_quote yellow
set fish_color_redirection brblue
set fish_color_status red
set fish_color_user brgreen
set fish_color_valid_path --underline
set fish_pager_color_prefix 'white' '--bold' '--underline'
set fish_greeting
set fish_color_command --bold
set fish_color_comment red
set fish_color_end brmagenta
set fish_color_error brred
set fish_color_escape 'bryellow' '--bold'
set fish_color_match --background=brblue
set fish_color_operator bryellow
set fish_color_param cyan
set fish_color_quote yellow
set fish_color_redirection brblue
set fish_color_status red
set fish_color_user brgreen
set fish_color_valid_path --underline
set fish_pager_color_prefix 'white' '--bold' '--underline'
bind \ed 'ncdu'
bind \ef 'fzf | clip'
bind \e\co 'open (_fzf_wrapper)'
bind \ed 'ncdu'
bind \ef 'fzf | clip'
starship init fish --print-full-init | source
source /usr/share/autojump/autojump.fish
end
source /usr/share/autojump/autojump.fish
tty -s && starship init fish --print-full-init | source

View File

@ -1,36 +1,15 @@
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")
host("https://www.github.developerdan.com/hosts/lists/facebook-extended.txt")
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://fanboy.co.nz/fanboy-annoyance.txt")
abp("https://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")
abp("https://github.com/brave/adblock-lists/raw/master/brave-unbreak.txt")
abp("https://github.com/brave/adblock-lists/raw/master/coin-miners.txt")
abp("https://github.com/brave/adblock-lists/raw/master/brave-lists/brave-firstparty-cname.txt")
abp("https://github.com/brave/adblock-lists/raw/master/brave-lists/brave-firstparty.txt")
abp("https://github.com/brave/adblock-lists/raw/master/brave-lists/brave-social.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/AnnoyancesList")
abp("https://github.com/DandelionSprout/adfilt/raw/master/SocialShareList.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/ExtremelyCondensedList.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2020.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2021.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters-2022.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt")
abp("https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt")
abp("https://github.com/quenhus/uBlock-Origin-dev-filter/raw/main/dist/duckduckgo/global.txt")
abp("https://raw.githubusercontent.com/curbengh/urlhaus-filter/master/urlhaus-filter-online.txt")
abp("https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=1&mimetype=plaintext")

View File

@ -2,7 +2,11 @@ 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/sh -c "sass $QUTE_CONFIG_DIR/user.{s,}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)})'
a['toggle-dark'] = 'reload;;jseval -q const meta=document.createElement("meta");meta.name="color-scheme";document.head.appendChild(meta).content="dark";;stop'
a['shutup'] = 'jseval -q document.head.appendChild(document.createElement("style")).innerHTML="@import url(https://rickyromero.com/shutup/updates/shutup.css)"'
a['monolith-save'] = 'spawn kitty fish -c "monolith {url} -o'
a['ao3-first'] = 'jseval -q window.location.href=document.getElementsByTagName(\'option\')[0].value'
a['ao3-latest'] = 'jseval -q c=document.getElementsByTagName(\'option\'); window.location.href = c[c.length-1].value'

View File

@ -3,8 +3,8 @@ bind = {
'<Ctrl-q>': 'close',
'<Ctrl-r>': 'spawn -u readability',
'<Ctrl-w>': 'tab-close',
'<Ctrl-Shift-a>': 'jseval -q c=document.getElementsByTagName(\'option\'); window.location.href = c[c.length-1].value',
'<Ctrl-Shift-x>': 'jseval -q window.location.href=document.getElementsByTagName(\'option\')[0].value',
'<Ctrl-Shift-a>': 'ao3-first',
'<Ctrl-Shift-x>': 'ao3-latest',
'<Alt+f>' : 'config-cycle hints.chars qwerasdf asdfghjkl',
',': 'hint links run mpv {hint-url}',
';a': 'hint links run ' + kitdl + ' dl {hint-url}"',
@ -19,7 +19,7 @@ bind = {
'sc': 'toggle-dark',
'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'",
'sg': 'debug-dump-page ~/Downloads/dump.html',
'sm': 'spawn kitty fish -c "monolith {url} -o ~/Downloads/{url:domain}.html"',
'sm': 'monolith-save ~/Downloads/dump.html"',
'sq': 'spawn -u qr',
'sr': 'remove-sticky',
'st': 'config-cycle -p content.proxy socks://localhost:9050/ system',

View File

@ -6,12 +6,10 @@ config.source('bindings.py')
config.source('javascript.py')
config.source('redirects.py')
import subprocess
subprocess.run(["sass", config.configdir / 'user.scss', config.configdir / 'user.css'])
c.url.start_pages = c.url.default_page = 'megafocs.herokuapp.com'
config.set('content.javascript.enabled', True, c.url.start_pages)
c.url.searchengines['y'] = 'farside.link/invidious/search?q={}'
c.url.searchengines['DEFAULT'] = 'kagi.com/search?q={}'
c.tabs.show = 'multiple'
c.confirm_quit = ['downloads']
@ -23,9 +21,6 @@ c.colors.webpage.darkmode.enabled = True
c.colors.webpage.preferred_color_scheme = 'dark'
c.colors.webpage.darkmode.policy.images = 'never'
config.set('content.notifications.enabled', True, 'https://mail.tutanota.com')
config.set('content.register_protocol_handler', True, 'https://mail.tutanota.com')
import socket
if socket.gethostname() == 'wheatley':
c.zoom.default = 125

View File

@ -1,7 +1,6 @@
c.content.javascript.enabled = False
sites = [
'canary.discord.com',
'duckduckgo.com',
'mail.tutanota.com',
'*.rpi.edu',
'api-3e0243bb.duosecurity.com',
@ -11,3 +10,6 @@ for site in sites:
config.set('content.headers.user_agent', 'iPhone', 'docs.google.com')
config.set('content.headers.user_agent', 'iPhone', 'drive.google.com')
config.set('content.notifications.enabled', True, 'https://mail.tutanota.com')
config.set('content.register_protocol_handler', True, 'https://mail.tutanota.com')

View File

@ -1,9 +1,12 @@
@import url(https://nitter.net/css/themes/twitter_dark.css);
@import url(https://necolas.github.io/normalize.css/latest/normalize.css);
@import url(http://source.netsurf-browser.org/netsurf.git/plain/resources/adblock.css);
#hnmain {
zoom: 120%;
background: #212121;
td[bgcolor="#ff6600"] {background: #4b5762}
background: #212121 !important;
td[bgcolor="#ff6600"] {background: #4b5762 !important}
.title a:link, .c00, .c00 a:link {color: #FFF !important}
[action="comment"] {display:none}
}
#app-mount {
@ -24,20 +27,19 @@
"https://cdn.discordapp.com/attachments/773556458234052608/929383713932992512/0dKbZO5-16-9.webp"
)}
body.dracula {max-width: 777pt}
body>nav:nth-child(1) {position: absolute}
tbody>tr>[bgcolor="#CCCCCC"] {background: #000000}
details:not([open]) > div.selftext {display:none}
.thumbnail img.thumbnail{max-height:450px;width:auto!important;}
div.doc-container div.doc div {max-width: 666pt !important; margin: auto}
.qute-readability {margin: auto !important}
p#javascript-warning, [class^=nativead] {display: none}
ul.work > li.download {
font-size: 0;
> ul {
border: none;
position: unset;
> li {font-size: small; &:not(:nth-child(2)) {display: none}}
border: none !important;
position: static !important;
> li {font-size: small; &:not(:nth-child(2)) {display: none !important}}
}
}
@ -53,18 +55,18 @@ $id: ads, leaderboard, player-ads, rc-row-container;
@each $i in $id {##{$i} {display:none}}
body {
--accent: #bd93f9;
--accent_dark: #715895;
--accent_light: #d7befb;
--background: #282a36;
--bg_color: #282a36;
--bg_hover: #383a45;
--bg_panel: #232531;
--darkest_grey: #1f212c;
--fg_color: #FFFFFF;
--fg_faded: #8899A6;
--bg_panel: #232531;
--bg_hover: #383a45;
--more_replies_dots: var(--accent_dark);
--darkest_grey: #1f212c;
--accent: #bd93f9;
--accent_light: #d7befb;
--accent_dark: #715895;
--background: #282a36;
--foreground: #3d4051;
--more_replies_dots: var(--accent_dark);
--outside: #393c4d;
--post: #333544;
}