Merge branch 'feature/KASM-2408-remove-maximus' into 'develop'

KASM-2408 remove maximus from script

Closes KASM-2408

See merge request kasm-technologies/internal/workspaces-core-images!45
This commit is contained in:
Justin Travis 2022-03-25 06:45:49 +00:00
commit 46ea441f04

View File

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