add dwarfs-overlay thing

This commit is contained in:
askiiart 2025-03-11 20:30:07 -05:00
parent 68475caad0
commit 59ee2013e0
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A

View file

@ -66,7 +66,17 @@ if [ $(tty) = /dev/tty1 ]
sway
end
# run code in wayland natively
# TODO: just add it to the args file instead
# run code and vesktop in wayland natively
# TODO: just add it to the args file instead(?)
alias code="code --ozone-platform=wayland"
alias vesktop="vesktop --ozone-platform=wayland"
function dwarfs-overlay -a dwarfs_image
set working_dir $(dirname $dwarfs_image)
set without_ext $(basename $dwarfs_image ".dwarfs")
mkdir -p $working_dir/$without_ext
mkdir -p $working_dir/.$without_ext
mkdir -p $working_dir/.$without_ext/{ro,rw,workdir}
dwarfs $dwarfs_image $working_dir/.$without_ext/ro -o allow_root
sudo mount -t overlay overlay -o lowerdir=$working_dir/.$without_ext/ro,upperdir=$working_dir/.$without_ext/rw,workdir=$working_dir/.$without_ext/workdir $working_dir/$without_ext
end