KASM-2408 remove maximus from script

This commit is contained in:
Richard Koliser 2022-03-24 11:30:31 -04:00
parent ba85b9c767
commit 6834d3a950

View File

@ -1,37 +1,23 @@
# MAXIMIZE and MAXIMIZE_NAME are exported by the calling script
# This script will check against the container OS to do the right thing.
# Array of codenames that support maximus
MAXIMUS_CODENAMES=("bionic")
# Array of codenames that support wmctrl
WMCTRL_CODENAMES=("focal")
maximize_window(){
set +e
if [[ ${MAXIMIZE} == 'true' ]] ; then
if [[ ${MAXIMUS_CODENAMES[*]} =~ $(lsb_release -cs) ]] ; then
# only start maximus if it isn't already running
if ! pgrep -x maximus > /dev/null
then
maximus &
fi
fi
if [[ ${WMCTRL_CODENAMES[*]} =~ $(lsb_release -cs) ]] ; then
while true; do
end=$((SECONDS+60))
while [ $SECONDS -lt $end ]; do
windows=$(wmctrl -l)
if [[ "$windows" =~ "${MAXIMIZE_NAME}" ]];
then
echo "Found ${MAXIMIZE_NAME}, maximizing"
wmctrl -r "${MAXIMIZE_NAME}" -b add,maximized_vert,maximized_horz
break;
fi
sleep 1
done
sleep 10
while true; do
end=$((SECONDS+60))
while [ $SECONDS -lt $end ]; do
windows=$(wmctrl -l)
if [[ "$windows" =~ "${MAXIMIZE_NAME}" ]];
then
echo "Found ${MAXIMIZE_NAME}, maximizing"
wmctrl -r "${MAXIMIZE_NAME}" -b add,maximized_vert,maximized_horz
break;
fi
sleep 1
done
fi
sleep 10
done
fi
set -e
}