Created
May 12, 2018 23:54
-
-
Save yucefsourani/bec72d24dd9739b00367057b700f53cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
from PyQt5.QtGui import QColor | |
import dbus | |
def kde_colorpicker_pick(): | |
bus = dbus.SessionBus() | |
ob = bus.get_object("org.kde.KWin","/ColorPicker") | |
itf = dbus.Interface(ob,"org.kde.kwin.ColorPicker") | |
try: | |
pick = itf.pick()[0] | |
except: | |
return False | |
return QColor(pick) | |
qcolor = kde_colorpicker_pick() | |
if qcolor: | |
print(qcolor) | |
print(qcolor.getRgb()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment