#!/bin/sh
progdir=$(cd $(dirname $0); pwd)
sed -n '/video_filter =/p' /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg > /mnt/mmc/Roms/APPS/Dark/data.txt
a=`cat /mnt/mmc/Roms/APPS/Dark/data.txt`
if [[ "$a" == "" ]]; then
	echo -e "\nvideo_filter = \":/.retroarch/filters/video/Darken.filt\"" >> /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg
else
	sed -i -e '/video_filter =/c video_filter = \":/.retroarch/filters/video/Darken.filt\"' /mnt/mmc/CFW/retroarch/.retroarch/retroarch.cfg
fi
cp -f $progdir/Dark/Dark_mode-ON.sh $progdir
rm -f $0
$progdir/Dark/printstr "Dark mode - ON"
sleep 2
sync
