I have got this script, but it is not working. It is because it is failing to evaluate the number comparison in the if statement, I think.
#!/bin/bash
{ read __ WIDTH; read __ HEIGHT; read __ __ BORDER_WIDTH; } < <(xwininfo -id "$(xdotool getactivewindow)" | grep -o -e 'Height:.*' -e 'Width:.*' -e 'Border width:.*')
echo "Height: $HEIGHT, Width: $WIDTH, Border width: $BORDER_WIDTH"
x = 1920
if($WIDTH == x)
then
wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
else
xdotool key Ctrl+F12
fi
How can I fix this?
-eq
for equal, etc.