#!/bin/bash
INSTANCES=`lsof -t "$0" | wc -l`
if [ "$INSTANCES" -gt 1 ]; then
	exit
fi
dpi=96.0
while true; do
	sleep 5
	currdpi=$(dconf read /org/mate/desktop/font-rendering/dpi)
	echo $dpi $currdpi
	if [ $dpi != $currdpi ]; then
		echo false
		killall picom
		awesome-client "awesome.restart()"
		dpi=$currdpi
	else
		echo true
	fi
done
