From 979b669a8c868a5733df91f75e40d503543e5064 Mon Sep 17 00:00:00 2001 From: threadreaper Date: Mon, 3 Aug 2020 23:36:41 -0500 Subject: [PATCH 1/5] Added support for changing wallpaper on KDE Plasma. --- pywal/wallpaper.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index 3eecb10..542bc16 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -7,8 +7,8 @@ import shutil import subprocess import urllib.parse -from .settings import CACHE_DIR, HOME, OS -from . import util +import settings +import util def get_desktop_env(): @@ -67,7 +67,7 @@ def set_wm_wallpaper(img): elif shutil.which("hsetroot"): util.disown(["hsetroot", "-fill", img]) - + elif shutil.which("nitrogen"): util.disown(["nitrogen", "--set-zoom-fill", img]) @@ -91,7 +91,7 @@ def set_wm_wallpaper(img): def set_desktop_wallpaper(desktop, img): """Set the wallpaper for the desktop environment.""" desktop = str(desktop).lower() - + if "xfce" in desktop or "xubuntu" in desktop: xfconf(img) @@ -115,8 +115,18 @@ def set_desktop_wallpaper(desktop, img): elif "awesome" in desktop: util.disown(["awesome-client", "require('gears').wallpaper.maximized('{img}')" - .format(**locals())]) + .format(**locals())]) + elif "kde" in desktop: + string = """ + var allDesktops = desktops();for (i=0;i Date: Tue, 4 Aug 2020 02:34:25 -0500 Subject: [PATCH 2/5] ?? --- pywal/wallpaper.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index 542bc16..c199aef 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -7,8 +7,8 @@ import shutil import subprocess import urllib.parse -import settings -import util +from .settings import HOME, OS, CACHE_DIR +from . import util def get_desktop_env(): @@ -134,7 +134,7 @@ def set_desktop_wallpaper(desktop, img): def set_mac_wallpaper(img): """Set the wallpaper on macOS.""" db_file = "Library/Application Support/Dock/desktoppicture.db" - db_path = os.path.join(settings.HOME, db_file) + db_path = os.path.join(HOME, db_file) img_dir, _ = os.path.split(img) # Clear the existing picture data and write the image paths @@ -173,19 +173,19 @@ def change(img): desktop = get_desktop_env() - if settings.OS == "Darwin": + if OS == "Darwin": set_mac_wallpaper(img) - elif settings.OS == "Windows": + elif OS == "Windows": set_win_wallpaper(img) else: set_desktop_wallpaper(desktop, img) - logging.info("Desktop is " + desktop) + logging.info("Set the new wallpaper.") -def get(cache_dir=settings.CACHE_DIR): +def get(cache_dir=CACHE_DIR): """Get the current wallpaper.""" current_wall = os.path.join(cache_dir, "wal") From 2329b1859fc98f8a9710fd462798335d3a06538d Mon Sep 17 00:00:00 2001 From: threadreaper Date: Tue, 4 Aug 2020 02:38:38 -0500 Subject: [PATCH 3/5] Added a .css theme template for Notepadqq. --- pywal/export.py | 1 + pywal/templates/colors-nqq.css | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pywal/templates/colors-nqq.css diff --git a/pywal/export.py b/pywal/export.py index 8f581b9..45f9a34 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -92,6 +92,7 @@ def get_export_type(export_type): "json": "colors.json", "konsole": "colors-konsole.colorscheme", "kitty": "colors-kitty.conf", + "nqq": "colors-nqq.css", "plain": "colors", "putty": "colors-putty.reg", "rofi": "colors-rofi.Xresources", diff --git a/pywal/templates/colors-nqq.css b/pywal/templates/colors-nqq.css new file mode 100644 index 0000000..9396cdb --- /dev/null +++ b/pywal/templates/colors-nqq.css @@ -0,0 +1,31 @@ +/* + * pywal theme template for notepadqq by threadreaper + * https://github.com/threadreaper + */ + +.cm-s-nqqwal .CodeMirror-gutters {{ background: {background} !important; }} +.cm-s-nqqwal .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded {{ color: {foreground}; }} +.cm-s-nqqwal .CodeMirror-cursor {{ border-left: 1px solid {foreground}; background-color: rgba({color6.rgb},0.4)}} +.cm-s-nqqwal {{ background-color: {background}; color: {foreground}; }} +.cm-s-nqqwal span.cm-builtin {{ color: {color2}; font-weight: bold; }} +.cm-s-nqqwal span.cm-comment {{ color: {color8}; }} +.cm-s-nqqwal span.cm-keyword {{ color: {color3}; font-weight: bold; }} +.cm-s-nqqwal span.cm-atom {{ color: {color4}; }} +.cm-s-nqqwal span.cm-def {{ color: {color5}; }} +.cm-s-nqqwal span.cm-variable {{ color: {color6}; }} +.cm-s-nqqwal span.cm-variable-2 {{ color: {color5}; }} +.cm-s-nqqwal span.cm-string {{ color: {color2}; }} +.cm-s-nqqwal span.cm-string-2 {{ color: {color2}; }} +.cm-s-nqqwal span.cm-number {{ color: {color5}; }} +.cm-s-nqqwal span.cm-tag {{ color: {color3}; }} +.cm-s-nqqwal span.cm-property {{ color: {color6}; }} +.cm-s-nqqwal span.cm-attribute {{ color: {color6}; }} +.cm-s-nqqwal span.cm-qualifier {{ color: {color4}; }} +.cm-s-nqqwal span.cm-meta {{ color: {color5}; }} +.cm-s-nqqwal span.cm-header {{ color: {color3}; }} +.cm-s-nqqwal span.cm-operator {{ color: {color3}; }} +.cm-s-nqqwal span.CodeMirror-matchingbracket {{ box-sizing: border-box; background: transparent; border-bottom: 1px solid; }} +.cm-s-nqqwal span.CodeMirror-nonmatchingbracket {{ border-bottom: 1px solid; background: none; }} +.cm-s-nqqwal .CodeMirror-activeline-background {{ background: rgba({color5.rgb},0.4); }} +.cm-s-nqqwal div.CodeMirror-selected {{ background: {color3}; }} +.cm-s-nqqwal .CodeMirror-focused div.CodeMirror-selected {{ background: {color0}); }} From d695168a441d99ebdd189c4aedbd951bde906bc6 Mon Sep 17 00:00:00 2001 From: threadreaper Date: Tue, 4 Aug 2020 03:11:22 -0500 Subject: [PATCH 4/5] Errors fixed. --- pywal/export.py | 2 +- pywal/wallpaper.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pywal/export.py b/pywal/export.py index 45f9a34..1250528 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -92,7 +92,7 @@ def get_export_type(export_type): "json": "colors.json", "konsole": "colors-konsole.colorscheme", "kitty": "colors-kitty.conf", - "nqq": "colors-nqq.css", + "nqq": "colors-nqq.css", "plain": "colors", "putty": "colors-putty.reg", "rofi": "colors-rofi.Xresources", diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index c199aef..f654187 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -91,7 +91,7 @@ def set_wm_wallpaper(img): def set_desktop_wallpaper(desktop, img): """Set the wallpaper for the desktop environment.""" desktop = str(desktop).lower() - + if "xfce" in desktop or "xubuntu" in desktop: xfconf(img) @@ -125,8 +125,7 @@ def set_desktop_wallpaper(desktop, img): d.writeConfig("Image", "%s")}; """ util.disown(["qdbus", "org.kde.plasmashell", "/PlasmaShell", "org.kde.PlasmaShell.evaluateScript", - string % img]) - + string % img]) else: set_wm_wallpaper(img) From c3faf0e1cf4600551f9fe979d265b04ee7cef62d Mon Sep 17 00:00:00 2001 From: threadreaper Date: Tue, 4 Aug 2020 03:15:26 -0500 Subject: [PATCH 5/5] Errors fixed. --- pywal/wallpaper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index f654187..7d6ae5f 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -121,11 +121,11 @@ def set_desktop_wallpaper(desktop, img): string = """ var allDesktops = desktops();for (i=0;i