Search code examples
pythonlinuxsdl-2taskbarxorg

Hide window from Linux taskbar


How to achieve the same behavior(hide the python.exe from taskbar) with Python on Linux? (my target is mainly Raspbian(LXDE) and Gnome)

similar to this or this, however I don't want to use wx or pygame as a window provider as I already use one (sdl2), therefore it probably needs to be some call exactly like win32gui does.

Obviously I haven't tried anything, because I have no clue where to begin, so even some ideas might help.


Solution

  • Xorg is the way. If you don't have that, happy searching further.

    Basically, you can call this command:

    xprop -name <unique window name> -f _NET_WM_STATE 32a \
    -set _NET_WM_STATE _NET_WM_STATE_SKIP_TASKBAR
    

    or

    xprop -id <window id> -f _NET_WM_STATE 32a \
    -set _NET_WM_STATE _NET_WM_STATE_SKIP_TASKBAR
    

    to remove something from taskbar and the window managers should respect that.

    Ubuntu's Unity is something special, so if you have multiple windows stacked on a single taskbar icon it either ignores that command, or it already used the command, to stack the icons into that single icon with little arrows on the sides.

    I still haven't found the way how to hide that. Feel free to ping me.