Why does the memory use keep increasing in this script, the increase is small but adds up over time?
The script just resizes and move 3 application windows so they all show on one screen with no overlapping.
I also get the occasional error pidof: can't read from 415712/stat in the terminal although the script keeps on running.
#!/bin/bash
# Display Notepad full height on the left half of the screen
resizeNotepadqq() {
# Wait for the process to start
until pidof notepadqq-bin >> /dev/null; do
sleep 1
done
sleep 0.1
# wmctrl -e <G>,<X>,<Y>,<W>,<H>
# window Gravity: 0 = window default
# window position XY coordinates
# window Width and Height: -1 = unchanged
wmctrl -xr "notepadqq-bin.Notepadqq" -e 0,0,0,-1,-1
exit
}
# Display Terminal in the top right half of the screen
resizeTerminal() {
until pidof gnome-terminal-server >> /dev/null; do
sleep 1
done
sleep 0.1
wmctrl -xr "gnome-terminal-server" -e 0,640,0,646,335
exit
}
# Display Celluloid in the bottom right half of the screen
resizeCelluloid() {
until pidof celluloid >> /dev/null; do
sleep 1
done
sleep 0.1
wmctrl -xr "celluloid_player" -e 0,640,360,691,435
exit
}
while true; do
sleep 2
resizeNotepadqq &
resizeTerminal &
resizeCelluloid &
done