Skip to content

Instantly share code, notes, and snippets.

@wpjunior
Last active August 1, 2021 00:42
Show Gist options
  • Save wpjunior/96bc48dcb0a6d45a25852a98bfb503ee to your computer and use it in GitHub Desktop.
Save wpjunior/96bc48dcb0a6d45a25852a98bfb503ee to your computer and use it in GitHub Desktop.
#!/usr/bin/python
from gi.repository import GLib, Gtk, Gdk
import Xlib.display
size = 167
def main():
window = Gtk.Window() # Gtk.WINDOW_TOPLEVEL)
window.set_default_size(size*0.68, Gdk.Screen.height())
window.move(0, 0)
window.set_type_hint(6) # Type DOCK
window.show_all()
xid = window.get_window().get_xid()
display = Xlib.display.Display()
window = display.create_resource_object("window", window.get_window().get_xid())
window.change_property(
display.intern_atom("_NET_WM_STRUT"),
display.intern_atom("CARDINAL"),
32, [size, 0, 0, 0])
display.sync()
Gtk.main()
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment