From 552244d59fabad65e75ac65e4254d7ce0abd1ad8 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 7 Jun 2019 23:13:53 +0200 Subject: Added custom cursor support --- example.ini | 3 +++ freedowm.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/example.ini b/example.ini index abc7f85..9164398 100644 --- a/example.ini +++ b/example.ini @@ -2,6 +2,9 @@ ; Debug mode prints more verbose messages DEBUG = 0 +; Cursor theme (int from https://tronche.com/gui/x/xlib/appendix/b/) +CURSOR = 68 + ; Border width BORDER = 1 diff --git a/freedowm.py b/freedowm.py index 1a04088..7833ccb 100644 --- a/freedowm.py +++ b/freedowm.py @@ -41,6 +41,12 @@ class FreedoWM(object): self.monitors = [] self.monitor_id = self.zero_coordinate = self.x_center = self.y_center = 0 + # Set cursor + font = self.display.open_font('cursor') + cursor = font.create_glyph_cursor(font, int(self.general["CURSOR"]), int(self.general["CURSOR"]) + 1, + (65535, 65535, 65535), (0, 0, 0)) + self.root.change_attributes(cursor=cursor) + self.get_monitors() self.set_listeners() self.root.warp_pointer(0, 0) -- cgit v1.2.3