#!/bin/ash

# this script is a best-effort attempt to configure problematic applications to run as spot

PROGS=""
while read PROG; do
	PROG=${PROG##*/}
#	echo "Auto-configuring $PROG to run as spot ..."
	PROGS="$PROGS $PROG=true"
done < <(grep -hE '^(/usr/bin/(firefox|firefox-[a-z]+|google-chrome-[a-z]+|chromium|chromium-browser|vivaldi-[a-z]+|brave-browser|microsoft-edge-[a-z]+|transmission-gtk|transmission-cli|transmission-daemon|seamonkey|sylpheed|claws-mail|thunderbird|vlc|steam|code|librewolf|hexchat|zoom))|/usr/games/steam$' /var/lib/dpkg/info/*.list)

[ -n "$PROGS" ] && setup-spot $PROGS

update-desktop-database

exit 0
