简体   繁体   中英

How do you hide a gui from the statusbar?

I have Linux mint 18 and have created an app that is a status bar. It has various info temp CPU speed bat info and does various things to manage my laptop using Tkinter. When using Mint every time you open an app it creates a tab in the status bar for every prog/folder anything. I would like to hide my program from that. I've looked into hiding and showing different ways but none of those seem to cover it and from googling the topic i couldn't find my specific question. Any help on this would be very appreciated.

There are several ways to tell the desktop manager not to display the app in the taskbar:

  • Change the window type from 'normal' to a type which is not displayed in the taskbar by default (depending on the type it can also remove window decorations and change the window position, eg always on top). For example, the 'toolbar' type will do exactly what you want.

     import tkinter as tk root = tk.Tk() root.attributes('-type', 'toolbar') root.mainloop() 

    You can find a list of types here .

  • You can also change yourself the state of your window with the ewmh module:

     import tkinter as tk from ewmh import EWMH ewmh = EWMH() root = tk.Tk() root.update_idletasks() # to make sure the window is displayed w = ewmh.getActiveWindow() # get the window ewmh.setWmState(w, 1, '_NET_WM_STATE_SKIP_TASKBAR') # remove window from taskbar ewmh.display.flush() root.mainloop() 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM