1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-11-28 15:25:55 +00:00

dwarfs: ver 0.5.0 offset support for appdwarf

This commit is contained in:
Phantop 2021-03-28 00:38:12 -04:00
parent 889f698e3e
commit 518c7eeeda
4 changed files with 20 additions and 32 deletions

View file

@ -14,7 +14,7 @@ bind = {
'sa': 'open -t archive.is/?run=1&url={url}', 'sa': 'open -t archive.is/?run=1&url={url}',
'sc': 'config-cycle content.user_stylesheets adapta.css ""', 'sc': 'config-cycle content.user_stylesheets adapta.css ""',
'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'", 'sd': "spawn fish -c 'dl; open (ls | rofi -dmenu -b -i || exit 0)'",
'gs': 'debug-dump-page ~/Downloads/dump.html', 'sg': 'debug-dump-page ~/Downloads/dump.html',
'sq': 'spawn -u qr', 'sq': 'spawn -u qr',
'sr': 'remove-sticky', 'sr': 'remove-sticky',
'st': 'config-cycle content.proxy socks://localhost:9050/ system', 'st': 'config-cycle content.proxy socks://localhost:9050/ system',

View file

@ -1,20 +1,14 @@
#!/bin/sh #!/bin/sh
mkdir appdir mkdwarfs -i "$@" -o "$(basename "$@").sh" --header <(cat << 'EOF'
mkdwarfs -i $@ -o appdir/root.dwarfs
cat > appdir/AppRun <<'EOF'
#!/bin/sh #!/bin/sh
HERE=$(dirname $(readlink -f "${0}")) DIR=/tmp/.dwarf_$(basename "$0")$RANDOM
DIR=/tmp/.dwarf_$RANDOM mkdir "$DIR" 2> /dev/null
mkdir $DIR 2> /dev/null dwarfs -o offset=auto "$0" "$DIR" 2> /dev/null
dwarfs $HERE/root.dwarfs $DIR 2> /dev/null "$DIR/AppRun" $@
$DIR/AppRun $@ fusermount -uz "$DIR" 2> /dev/null
fusermount -uz $DIR 2> /dev/null rmdir "$DIR" 2> /dev/null
rmdir $DIR 2> /dev/null exit
EOF EOF
)
chmod +x appdir/AppRun chmod +x "$(basename "$@").sh"
mksquashfs appdir app.sfs -noD
cat $(which appimageruntime) app.sfs > $(basename $@).sh
chmod +x $(basename $@).sh
rm -r appdir app.sfs

View file

@ -2,5 +2,5 @@
DIR=/tmp/.dwarf_$(basename $@ .dwarfs)$RANDOM DIR=/tmp/.dwarf_$(basename $@ .dwarfs)$RANDOM
mkdir $DIR mkdir $DIR
echo $DIR echo $DIR
dwarfs -f $@ $DIR 2> /dev/null dwarfs -o offset=auto -f $@ $DIR 2> /dev/null
rmdir $DIR rmdir $DIR

View file

@ -1,24 +1,18 @@
#!/bin/sh #!/bin/sh
a=../appdir H=/tmp/folheader
mkdir $a echo '#!/bin/sh' > $H
mkdwarfs -i . -o $a/root.dwarfs echo D=$@ >> $H
cat >> $H <<'EOF'
echo '#!/bin/sh' > $a/AppRun
echo D=$@ >> $a/AppRun
cat >> $a/AppRun <<'EOF'
H=$(dirname $(readlink -f "${0}"))
if [ ! -d $D ]; then if [ ! -d $D ]; then
mkdir $D mkdir $D
dwarfs2 $H/root.dwarfs $D dwarfs -o offset=auto "$0" $D
else else
fusermount -u $D fusermount -u $D
rmdir $D rmdir $D
fi fi
exit
EOF EOF
chmod +x $a/AppRun mkdwarfs -i . -o "$PWD.sh" --header $H
mksquashfs $a ../app.sfs -noD
cat $(which appimageruntime) ../app.sfs > $PWD.sh
chmod +x "$PWD.sh" chmod +x "$PWD.sh"
rm -r $a ../app.sfs rm $H