mirror of
https://github.com/kasmtech/workspaces-core-images.git
synced 2025-06-26 15:01:28 +02:00
KASM-2393 Silence logging in the maximize loop
the maximize script doesn't set -x itself, but since we loop inside, and -x may be set by the calling script, this will reduce the verbosity of the logs. After we exit we restore -x if it was previously set. Removed an echo that would happen in the loop.
This commit is contained in:
parent
8dd54b6fe1
commit
9f910916cc
@ -1,16 +1,21 @@
|
|||||||
# 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.
|
||||||
|
enable_x=0
|
||||||
|
|
||||||
maximize_window(){
|
maximize_window(){
|
||||||
set +e
|
set +e
|
||||||
if [[ ${MAXIMIZE} == 'true' ]] ; then
|
if [[ ${MAXIMIZE} == 'true' ]] ; then
|
||||||
|
if [[ $- =~ x ]] ;
|
||||||
|
then
|
||||||
|
set +x
|
||||||
|
enable_x=1
|
||||||
|
fi
|
||||||
while true; do
|
while true; do
|
||||||
end=$((SECONDS+60))
|
end=$((SECONDS+60))
|
||||||
while [ $SECONDS -lt $end ]; do
|
while [ $SECONDS -lt $end ]; do
|
||||||
windows=$(wmctrl -l)
|
windows=$(wmctrl -l)
|
||||||
if [[ "$windows" =~ "${MAXIMIZE_NAME}" ]];
|
if [[ "$windows" =~ "${MAXIMIZE_NAME}" ]];
|
||||||
then
|
then
|
||||||
echo "Found ${MAXIMIZE_NAME}, maximizing"
|
|
||||||
wmctrl -r "${MAXIMIZE_NAME}" -b add,maximized_vert,maximized_horz
|
wmctrl -r "${MAXIMIZE_NAME}" -b add,maximized_vert,maximized_horz
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
@ -18,6 +23,10 @@ maximize_window(){
|
|||||||
done
|
done
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
if [[ ${enable_x} -eq 1 ]];
|
||||||
|
then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user