Skip to content

Instantly share code, notes, and snippets.

@thwarted
Last active September 15, 2022 08:59
Show Gist options
  • Save thwarted/160f7d05ae38d1bfc4eb to your computer and use it in GitHub Desktop.
Save thwarted/160f7d05ae38d1bfc4eb to your computer and use it in GitHub Desktop.
resize-java-iKVM-viewer: find all supermicro Java iKVM Viewer windows and resize them to display all the content
#!/bin/bash
# find all supermicro Java iKVM Viewer windows and resize
# them to display all the content
#
# for reasons that are beyond sanity, this shitty closed source program
# sets the min and max window sizes to the same values, making it unresizable
# through dragging.
# this wouldn't be so bad if it actually resized the window to display all
# the content. it constantly resizes based on the resolution of the
# remote display.
#
# bind this program to a hot key or create a panel icon or something
# to invoke when the iKVM viewer is the wrong size. it will loop
# over all iKVM windows and set their size based on the reported
# resolution
PATH=/bin:/usr/bin
for winid in $( wmctrl -l | grep -iE 'Java iKVM Viewer.+(Resolution.+FPS|No Signal)' | awk '{ print $1 }' ); do
read width x height < <( wmctrl -l |
grep $winid |
grep -iE 'Java iKVM Viewer.+Resolution' |
sed -e 's/^.\+Resolution //; s/ - F.\+$//;'
)
if [[ -z "$width" || -z "$height" ]]; then
width=643
height=504
fi
xprop -id $winid -remove WM_NORMAL_HINTS
wmctrl -i -r $winid -e 0,-1,-1,$(( width + 10 )),$(( height + 30 ))
done
@i-love-coffee-i-love-tea

Sigh. Thank you so much! I too was beginning to tear out the little hair that's left. It's a shame this is even needed, but it think it represents the overall software quality at Supermicro. For example their Java SOL Viewer prints the user password to the console in clear text. m)

@BtbN
Copy link

BtbN commented Mar 16, 2021

Options->Preference->Window->Untick Auto-resize Window

@nixomose
Copy link

oh bless you for that nugget of information.

@bodik
Copy link

bodik commented Sep 15, 2022

Options->Preference->Window->Untick Auto-resize Window

thank you @BtbN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment