#! /bin/bash
# Script for changing themes of wmtm
# Developed and maintained by indicozy
# ver: 1.0

path=$1			
theme_folder=$2
#copy files from $folder/config to .config
cp -r $path/configs/$theme_folder/config/sway ~/.config

# append text to make any sway config to work with this script
custom_files=($(ls -d $path/customization/sway/*.txt))
for i in ${custom_files[@]}; do
	cat $i >> ~/.config/sway/config
done

echo "######[Auto-Appended] Theme switch script

bindsym
{
	Mod4+Ctrl+1 exec $path/changetheme.sh 1 
	Mod4+Ctrl+2 exec $path/changetheme.sh 2
	Mod4+Ctrl+3 exec $path/changetheme.sh 3 
	Mod4+Ctrl+4 exec $path/changetheme.sh 4 
	Mod4+Ctrl+5 exec $path/changetheme.sh 5 
	Mod4+Ctrl+6 exec $path/changetheme.sh 6 
	Mod4+Ctrl+7 exec $path/changetheme.sh 7 
	Mod4+Ctrl+8 exec $path/changetheme.sh 8 
	Mod4+Ctrl+9 exec $path/changetheme.sh 9
	Mod4+Ctrl+left exec $path/changetheme.sh prev
	Mod4+Ctrl+right exec $path/changetheme.sh next
	Mod4+Ctrl+Space exec $path/changetheme.sh
	Mod4+Ctrl+s exec $path/changetheme.sh save
}
" >> ~/.config/sway/config
