mirror of https://github.com/Phantop/dotfiles
Qute: minify redirects; Bin: appdwarf
This commit is contained in:
parent
cab5d6136c
commit
5f7fea958f
|
@ -1,11 +1,14 @@
|
|||
from qutebrowser.api import interceptor
|
||||
import operator, typing
|
||||
|
||||
invid = 'invidiou.site'
|
||||
nitter = 'nitter.snopyta.org'
|
||||
reddit = 'teddit.net'
|
||||
|
||||
from qutebrowser.api import interceptor
|
||||
import operator, typing
|
||||
o = operator.methodcaller
|
||||
s = 'setHost'
|
||||
i = interceptor
|
||||
|
||||
MAP = {
|
||||
"reddit.com": o(s, reddit),
|
||||
"www.reddit.com": o(s, reddit),
|
||||
|
@ -24,12 +27,12 @@ MAP = {
|
|||
"www.instagram.com": o(s, 'bibliogram.art'),
|
||||
"www.amazon.com": o(s, 'smile.amazon.com'),
|
||||
}
|
||||
def int_fn(info: interceptor.Request):
|
||||
if (info.resource_type != interceptor.ResourceType.main_frame or
|
||||
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)
|
||||
interceptor.register(int_fn)
|
||||
i.register(f)
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
mkdir appdir
|
||||
if not mkdwarfs -i $@ -o appdir/root.dwarfs; then
|
||||
mkdwarfs -i $@ -o appdir/temp.dwarfs -l0
|
||||
mkdwarfs --recompress -i appdir/temp.dwarfs -o appdir/root.dwarfs
|
||||
rm appdir/temp.dwarfs
|
||||
fi
|
||||
|
||||
cat >> appdir/AppRun <<'EOF'
|
||||
#!/bin/sh
|
||||
HERE=$(dirname $(readlink -f "${0}"))
|
||||
DIR=/tmp/.dwarf_$RANDOM
|
||||
mkdir $DIR 2> /dev/null
|
||||
dwarfs $HERE/root.dwarfs $DIR 2> /dev/null
|
||||
$DIR/AppRun $@
|
||||
fusermount -uz $DIR 2> /dev/null
|
||||
rmdir $DIR 2> /dev/null
|
||||
EOF
|
||||
|
||||
chmod +x appdir/AppRun
|
||||
mksquashfs appdir app.sfs -noD
|
||||
cat $(which appimageruntime) app.sfs > $(basename $@).sh
|
||||
chmod +x $(basename $@).sh
|
||||
rm -r appdir app.sfs
|
4
.setup
4
.setup
|
@ -6,8 +6,8 @@ sudo eopkg up
|
|||
sudo eopkg it -c system.devel
|
||||
|
||||
audio="audacious audacious-plugins audacity opus-tools quodlibet spek"
|
||||
dev="ccache docker-compose git-extras neovim parallel solbuild tig tor upx"
|
||||
gui="bleachbit caja engrampa goverlay keepassx kitty vorta"
|
||||
dev="ccache docker-compose git-extras llvm-clang neovim parallel solbuild tig tor upx"
|
||||
gui="bleachbit caja engrampa keepassx kitty lutris vorta"
|
||||
media="feh gaupol gmic-gimp jpegoptim mpv playerctl usbmuxd rsync viewnior zathura-poppler"
|
||||
rice="adapta-gtk-theme ant-dracula-gtk-theme devilspie2 font-ubuntu-ttf rofi starship stow"
|
||||
term="advancecomp autojump fd fish fzf innoextract most ncdu p7zip ranger ripgrep rsync tmux"
|
||||
|
|
Loading…
Reference in New Issue