from gi.repository import Gdk default_display = Gdk.Display.get_default()
from gi.repository import Gdk num_displays = Gdk.Display.get_n_screens() for i in range(num_displays): display = Gdk.Display.get_default() screen = display.get_screen(i) print(f"Display {i}: {screen.get_width()}x{screen.get_height()}")
from gi.repository import Gdk default_display = Gdk.Display.get_default() cursor = Gdk.Cursor.new_for_display(default_display, Gdk.CursorType.HAND1) Gdk.Window.set_cursor(Gdk.Screen.get_root_window(), cursor)This example creates a new cursor of `Gdk.CursorType.HAND1` type, which indicates that the cursor should change to a hand symbol. The cursor is then set for the root window of the display, so that it will be visible on the screen. Overall, `Gdk.Display` provides a simple way to interact with the display in Python, and can be used for a variety of use cases such as retrieving display information and setting the cursor.