scripts/distrobox/debian12/wallpaper.pl

25 lines
751 B
Perl
Raw Normal View History

2023-01-17 16:18:30 +00:00
#!/bin/sh
# distrobox_binary
# name: debian12
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/usr/bin/distrobox-enter -n debian12 -- /var/home/jpm/scripts/sway/wallpaper.pl --path=/var/home/jpm/wallpapers -d HDMI-A-1 "
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 HDMI-A-1 "$@"
fi