scripts/distrobox/debian/wallpaper.pl

26 lines
814 B
Bash
Executable File

#!/bin/sh
# distrobox_binary
# name: debian
USE_DISPLAYS=`cat /var/home/jpm/.spool/wallpaper_outputs`
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/usr/bin/distrobox-enter -n debian -- /var/home/jpm/scripts/sway/wallpaper.pl --path=/var/home/jpm/wallpapers -d $USE_DISPLAYS "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/var/home/jpm/scripts/sway/wallpaper.pl /var/home/jpm/scripts/sway/wallpaper.pl --path=/var/home/jpm/wallpapers -d $USE_DISPLAYS "$@"
fi