Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: Use the kwin blend effect when switching color schemes #59

Merged
merged 1 commit into from
Jul 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def apply_color_schemes(light=False):
color_scheme = THEME_LIGHT_PATH
elif light == False:
color_scheme = THEME_DARK_PATH
kwin_blend_changes()
subprocess.run("plasma-apply-colorscheme "+color_scheme+"2.colors",
shell=True, stderr=subprocess.DEVNULL,stdout=subprocess.DEVNULL)
colorscheme_out = subprocess.check_output("plasma-apply-colorscheme "+color_scheme+".colors",
Expand Down Expand Up @@ -929,4 +929,13 @@ def append_schemes(schemes):
colors.update(wal_dark)

with open(MATERIAL_YOU_COLORS_JSON, 'w', encoding='utf8') as material_you_colors:
json.dump(colors,material_you_colors)
json.dump(colors,material_you_colors)

def kwin_blend_changes():
try:
bus = dbus.SessionBus()
kwin = dbus.Interface(bus.get_object('org.kde.KWin', '/org/kde/KWin/BlendChanges'), dbus_interface='org.kde.KWin.BlendChanges')
kwin.start()
except Exception as e:
logging.warning(f'Could not start blend effect (requires Plasma 5.25 or later):\n{e}')
return None