#!/bin/bash

gsettings set org.cinnamon.desktop.screensaver lock-enabled false
gsettings set org.cinnamon.settings-daemon.plugins.power sleep-inactive-ac-timeout 1800
gsettings set org.cinnamon.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
gsettings get org.cinnamon.settings-daemon.plugins.power sleep-inactive-battery-timeout 1800
gsettings set org.cinnamon.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'
gsettings set org.cinnamon.settings-daemon.plugins.power idle-brightness 51
gsettings get org.cinnamon.settings-daemon.plugins.power idle-dim-time 1800
gsettings set org.cinnamon.settings-daemon.plugins.power button-hibernate 'nothing'
gsettings set org.cinnamon.settings-daemon.plugins.power button-power 'nothing'
gsettings set org.cinnamon.settings-daemon.plugins.power button-suspend 'nothing'
gsettings set org.cinnamon.settings-daemon.plugins.power lid-close-ac-action 'nothing'
gsettings set org.cinnamon.settings-daemon.plugins.power lid-close-battery-action 'nothing'
gsettings set org.cinnamon panels-autohide "['1:true']"
gsettings set org.nemo.desktop show-desktop-icons false

xhost + && sleep 1 && sudo -s pkexec calamares &

sleep 1

WID=$(xdotool search --sync --onlyvisible --name "Linux Mint 22." | head -1)

xdotool windowactivate $WID
xdotool windowsize $WID 100% 100%
xdotool windowraise $WID

while true; do
  xdotool windowmap $WID
  sleep 0.5
  wmctrl -r "Linux Mint 22." -b add,fullscreen
done
