#!/bin/bash
rm -r /home/oem/.config/xfce4/
pkill xfce4-panel

xfconf-query -c xfce4-keyboard-shortcuts -p "/commands/custom/<Primary><Alt>t" -r
xfconf-query -c xfce4-desktop -p /desktop-icons/style -s 0

xfconf-query -c thunar-volman -p /autobrowse/enabled -s false
xfconf-query -c thunar-volman -p /automount-drives/enabled -s false
xfconf-query -c thunar-volman -p /automount-media/enabled -s false
xfconf-query -c thunar-volman -p /autoopen/enabled -s false

xfconf-query -c xfce4-session -p /general/LockCommand -s ""
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 1800
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 1800
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lock-screen-suspend-hibernate -s false
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-lid-ac-action -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-lid-battery-action -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-power-ac-action -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-power-battery-action -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-suspend-ac-action -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/button-suspend-battery-action -s 0
xbacklight -set 100

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

sleep 1

WID=$(xdotool search --sync --onlyvisible --name "Xubuntu" | head -1)

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

while true; do
  xdotool windowmap $WID
  sleep 0.5
  wmctrl -r "Xubuntu" -b add,fullscreen
done
