How to open Tkinter window on current monitor (Mac) - python

I'm not sure it's possible to do this, but is there any way for Tkinter to know which monitor you are currently using (in a multiple-monitor setup)?
I might be running with my laptop and external monitor, and run a script from either screen. Ideally, the Tkinter window generated by that script would open on the screen I'm currently working on.
I know how to set the geometry to force the window to open on the main monitor or on a secondary monitor, but I'm wondering if there's a way to figure out which is currently being used.
Thanks!

Related

How do I make a console window appear when I run a python script from TkInter UI so I can post messages to track progress?

The python script takes some time to run so I want a console window to appear and somehow print messages to it while the program is running. At the moment I have a tkinter that pops up and when I hit "Run" - I do not know if it's working or if it is hanging. How do I force a console window?
Thank you.

Python Run at startup

I am working on a small project using python and pysimplegui . Here my application needs to have a option "Run at start up" which when checked would automatically run my application during windows starts up. Also I would like to know how can I put my application to the system tray. Like if I click on the minimize button , it'll go to the system tray.
Thank you!
To Run On Startup
Create shortcut of your application & copy it.
Press win + R
Run Command: shell:startup, Hit ok
3.And paste the shortcut in this folder
To Add In System Try
Go to the SETTINGS window and choose System.
[In the SYSTEM window, select Notifications & actions. Here you can select the option that reads “Select which icons appear on the taskbar”4
In the SELECT WHICH ICONS APPEAR ON THE TASKBAR window, you can turn on or off the icons in whichever way you prefer.

Tkinter GUI does not run properly after auto boot

I tried the solution provided in Tkinter GUI does not run properly when auto boot Tkinter, however GUI does not run properly when auto boot and got my python script with tkinter to run correctly and automatically after reboot.
The GUI interface kind of disappear. I get a black background, shows "Open Box" application when I tried to close, instead of the normal menu and wall paper. I can still right click and open web browser and a terminal. I tried running "startx" from terminal after some googling but received an error message.
How do I get the raspbian GUI interface working with the solution provided in link above? Any help is very much appreciated.
#!/usr/bin/python
chmod +x /home/pi/Desktop/test.py
nano /home/pi/.config/lxsession/LXDE-pi/autostart
#/home/pi/Desktop/test.py

wmctrl bring on top doesn't work over fullscreen app

I've got a strange issue with wmctrl : I'm trying to bring on top a virtual keyboard with by clicking on a button in another application (GUI app), but it seems not to work.
The other application (the GUI) is in Python created with the tkinter module.
It's strange because when the GUI is not in fullscreen mode it works fine, the Keyboard is bringing on top of the GUI. But when the GUI is set in fullscreen mode nothing appends, and I didn't get any error.
So if you have an idea I'm listening :)
thkx

How do I limit a Ubuntu machine to a Python GUI?

I wrote a python GUI in Tkinter for a time-clock system. The micro machine is wall mounted and the employees only have access to the touchscreen menu I programmed and a barcode swipe. I know how to get the script to start on startup, but how do I prevent them from exiting out or opening other menus? Basically the sole purpose of this console is to run the time-clock GUI.
If it cant be done in Ubuntu, is there another flavor of linux it can be done in?
There is also de KDE Kiosk project, which you can install on a ubuntu machinne:
"
The KDE Kiosk is a framework that has been built into KDE since version 3. It allows administrators to create a controlled environment for their users by customizing and locking almost any aspect of the desktop which includes the benign such as setting and fixing the background wallpaper, the functional such as disabling user log outs and access to the print system and the more security conscientious such as disabling access to a command shell."
http://techbase.kde.org/KDE_System_Administration/Kiosk/Introduction
You can use wm_overrideredirect, then make the UI full screen. This will remove all window decorations so there's no way to close the window. If that's not enough, as a final step you can do a global grab. With that, you effectively control everything that they can do.
Be very careful about coding global grabs -- make sure you can ssh into that box to kill the process, otherwise you can effectively denial-of-service your box.
Don't start a window manager. Only start your program, e.g. from xinitrc. Make the program full-screen

Categories