!/bin/sh

# Get system info
xwininfo -root > desktop-info.txt 2>&1

# Get dimensions from generated file
width=`sed -n 's/^ *Width: //p' desktop-info.txt`
height=`sed -n 's/^ *Height: //p' desktop-info.txt`

#sed -i "s/\(\"width\" : \).*/\1${width},/" package.json
#sed -i "s/\(\"height\" : \).*/\1${height},/" package.json
#echo "${width}x${height}" > geometry.txt

# Copy dimesions into a JSON file that's easier for JS to read
# echo "{\"width\": ${width}, \"height\": ${height}}" > dimensions.json

#exec google-chrome --kiosk http://localhost/
exec electron .
