Skip to content

Commit a217b16

Browse files
committed
Use logging for everything and make it prettier
1 parent 8854d07 commit a217b16

File tree

4 files changed

+149
-107
lines changed

4 files changed

+149
-107
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ dark_blend_multiplier = 1.0
216216
# This WILL OVERWRITE any set colors and reload KWin
217217
#sierra_breeze_buttons_color = True
218218

219-
# Dynamically update Konsole color scheme by switching profiles
220-
# The name of your Konsole profile (except TempMyou as its reserved for this to work)
221-
# you can get a list of your profiles with the command konsole --list-profiles
219+
# Dynamically updated Konsole color scheme
220+
# Accepted value is the name of your current Konsole profile, except TempMyou and Default profile as is read only
222221
# Default is commented (disabled)
222+
# WARNING:
223+
# I recommend you to backup the ~/.local/share/konsole/ folder before trying this because it will edit your profiles
223224
# NOTE:
224-
# This will edit your profile, from ~/.local/share/konsole/
225-
# and make a temp named TempMyou.profile to switch between them to update color schemes
226-
# It is recommended to backup that folder before enabling this
225+
# This makes a temp profile named TempMyou.profile and MaterialYou/MaterialYouAlt color schemes to switch between them automatically in all open Konsole instances
226+
# You can make direct changes to your profile, but for the color scheme edit MaterialYou one
227227
#konsole_profile = Profile 1
228228
```
229229

kde-material-you-colors.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import time
23
import os
34
import argparse
@@ -51,22 +52,21 @@
5152
# Get config from file
5253
config = utils.Configs(args)
5354
options_old = config.options
54-
print(f"Config: {options_old}")
55+
logging.debug(f"Config: {options_old}")
5556
icons_old = [options_old['iconslight'], options_old['iconsdark']]
5657
light_old = options_old['light']
5758
# Get the current wallpaper on startup
5859
wallpaper_old = utils.currentWallpaper(options_old)
5960
kde_globals_light_old=utils.kde_globals_light()
6061
pywal_light_old=options_old['pywal_light']
6162
konsole_profile_old=options_old['konsole_profile']
62-
print(konsole_profile_old)
6363
konsole_profile_mod_time_old = None
6464
if konsole_profile_old != None:
6565
konsole_profile_mod_time_old = utils.get_last_modification(utils.KONSOLE_DIR+konsole_profile_old+".profile")
6666
if wallpaper_old != None and wallpaper_old[1] != None:
6767
wallpaper_old_type = wallpaper_old[0]
6868
wallpaper_old_data = wallpaper_old[1]
69-
print(f'Using wallpaper: {wallpaper_old_data}')
69+
logging.info(f'Using wallpaper: {wallpaper_old_data}')
7070
colors = utils.get_color_schemes(wallpaper_old,options_old['ncolor'])
7171

7272
# if wallpaper is image save time of last modification
@@ -75,7 +75,7 @@
7575
else:
7676
wallpaper_mod_time_old = None
7777

78-
light = None
78+
light = False
7979
if options_old['light'] == None:
8080
if kde_globals_light_old != None:
8181
light=kde_globals_light_old
@@ -131,7 +131,7 @@
131131
pywal_light_changed = pywal_light_old != pywal_light_new
132132
konsole_profile_changed = konsole_profile_old != konsole_profile_new
133133
konsole_profile_modified = konsole_profile_mod_time_new != konsole_profile_mod_time_old
134-
134+
light=False
135135
if options_new['light'] == None:
136136
if kde_globals_light_new != None:
137137
light=kde_globals_light_new
@@ -143,9 +143,9 @@
143143

144144
if wallpaper_changed or options_changed or wallpaper_modified:
145145
if wallpaper_changed or wallpaper_modified:
146-
print(f'Wallpaper changed: {wallpaper_new_data}')
146+
logging.info(f'Wallpaper changed: {wallpaper_new_data}')
147147
if options_changed:
148-
print(f"New Config: {options_new}")
148+
logging.debug(f"New Config: {options_new}")
149149
colors = utils.get_color_schemes(wallpaper_new,options_new['ncolor'])
150150
if colors != None:
151151
schemes = ThemeConfig(colors,wallpaper_new_data,light_blend_multiplier=options_new['lbm'], dark_blend_multiplier=options_new['dbm'])

sample_config.conf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ dark_blend_multiplier = 1.0
7272
# Default is False
7373
# NOTE:
7474
# This WILL OVERWRITE any set colors and reload KWin
75-
sierra_breeze_buttons_color = True
75+
#sierra_breeze_buttons_color = True
7676

77-
# Dynamically update Konsole color scheme by switching profiles
78-
# The name of your Konsole profile (except TempMyou as its reserved for this to work)
79-
# you can get a list of your profiles with the command konsole --list-profiles
77+
# Dynamically updated Konsole color scheme
78+
# Accepted value is the name of your current Konsole profile, except TempMyou and Default profile as is read only
8079
# Default is commented (disabled)
80+
# WARNING:
81+
# I recommend you to backup the ~/.local/share/konsole/ folder before trying this because it will edit your profiles
8182
# NOTE:
82-
# This will edit your profile, from ~/.local/share/konsole/
83-
# and make a temp named TempMyou.profile to switch between them to update color schemes
84-
# It is recommended to backup that folder before enabling this
83+
# This makes a temp profile named TempMyou.profile and MaterialYou/MaterialYouAlt color schemes to switch between them automatically in all open Konsole instances
84+
# You can make direct changes to your profile, but for the color scheme edit MaterialYou one
8585
#konsole_profile = Profile 1

0 commit comments

Comments
 (0)