1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-03-22 09:59:26 +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}',
'sc': 'config-cycle content.user_stylesheets adapta.css ""',
'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',
'sr': 'remove-sticky',
'st': 'config-cycle content.proxy socks://localhost:9050/ system',

View file

@ -1,20 +1,14 @@
#!/bin/sh
mkdir appdir
mkdwarfs -i $@ -o appdir/root.dwarfs
cat > appdir/AppRun <<'EOF'
mkdwarfs -i "$@" -o "$(basename "$@").sh" --header <(cat << '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
DIR=/tmp/.dwarf_$(basename "$0")$RANDOM
mkdir "$DIR" 2> /dev/null
dwarfs -o offset=auto "$0" "$DIR" 2> /dev/null
"$DIR/AppRun" $@
fusermount -uz "$DIR" 2> /dev/null
rmdir "$DIR" 2> /dev/null
exit
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
chmod +x "$(basename "$@").sh"

View file

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

View file

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