Skip to content

Commit b961ce8

Browse files
committed
Support GNOME 42 dark style preference
Adds an optional dependency on libhandy >= 1.5
1 parent a0638a8 commit b961ce8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

system-config-printer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
print ("This is a graphical application and requires DISPLAY to be set.")
4848
sys.exit (1)
4949

50+
# Optional dependency, requires libhandy >= 1.5
51+
gi.require_version('Handy', '1')
52+
try:
53+
from gi.repository import Handy
54+
Handy.init()
55+
# Support GNOME 42 dark mode
56+
Handy.StyleManager.get_default().set_color_scheme(Handy.ColorScheme.PREFER_LIGHT)
57+
except:
58+
pass
59+
5060
def show_help():
5161
print ("\nThis is system-config-printer, " \
5262
"a CUPS server configuration program.\n\n"

0 commit comments

Comments
 (0)