RDS wrote:My Python 3 program displays it's output in the usual 'shell' window. I operate the Pi headless using the excellent VNC feature.
Is it possible to include some code in my program to specify the size and position of the shell window, within the Desktop screen?
The usual terminal program
lxterminal doesn't have options for choosing it's position, only the size of the terminal window (in characters), but you could always call
xdotool to move and resize the current active window.
At the start of your Python program call
xdotool to move the current window (replace the
50 100 with the coordinates you want the top-left corner to be) and resize it to the specified size (replace
80 25 with the size you want in characters) with :-
Code: Select all
import os
os.system("xdotool getactivewindow windowmove 50 100 windowsize --usehints 80 25")
xdotool might need to be installed with apt-get, I can't remember if it's installed or not by default.