Commit 71aefb00 authored by phob1an's avatar phob1an 🎧
Browse files

sync

parent 9ed525d5
......@@ -35,7 +35,10 @@ DecorationHover=hhh
ForegroundNormal=bbb
BackgroundNormal=ccc
DecorationHover=ddd
DecorationFocus=ggg"""
DecorationFocus=ggg
[Colors:Header]
ForegroundNormal=ddd"""
......@@ -75,16 +78,6 @@ def color_triplet(h, l, s):
return ','.join([str(r), str(g), str(b)])
def theme_mode():
"""User chooses light or dark"""
try:
q = subprocess.run(['kdialog', '--radiolist', 'Mode', '1', 'Dark',
'on', '2', 'Light', 'off'], capture_output=True)
mode = q.stdout.decode().strip()
except:
mode = 1
return mode
# ---- CullaX ----
......@@ -92,7 +85,7 @@ def theme_mode():
#mode = theme_mode()
# Try sending a notification to show we're working
notify_user("CullaX - Beautifying the Desktop ;) ")
notify_user("CullaX - Beautifying the Desktop")
# Raise flag when finding correct session in plasmarc
flag = False
......@@ -159,53 +152,37 @@ tmp_img = Image.open(wallpaper.rstrip())
tmp_img = tmp_img.resize((512, 512))
tmp_img_path = os.path.expanduser('~/.cullax.png')
tmp_img.save(tmp_img_path)
image_average = colorgram.extract(tmp_img_path, 1)
av_h, av_s, av_l = image_average[0].hsl
print("Image average\t", av_h, av_s/256, av_l/256)
#sys.exit()
colors = colorgram.extract(tmp_img_path, 6)
sat = 0
#print(colors.hsl)
#for i in colors:
#r,g,b = (i.rgb)
#print(rgb_to_hex(i.rgb))
#print(i.rgb)
#sys.exit(0)
colors = colorgram.extract(tmp_img_path, 5)
primary_h, primary_s, primary_l = [ c/256.0 for c in colors[0].hsl ]
colors.sort(key=lambda c: c.hsl.s)
h,s,l = [ c/255.0 for c in colors[len(colors) - 1].hsl ]
# Cleanup temp file
os.remove(tmp_img_path)
# Remove hue for b/w images
if s < 0.011:
s = 0.0
h = 0.0
print("av over 256 ", av_s/256, av_l/256)
new_s = av_s/256
new_l = av_l/256
print("Primary HSL:\t {}, {}, {} ".format(primary_h, primary_s, primary_l))
new_s = 0.0
titlebar_s = 0.25
if primary_s < 0.85 and primary_l > 0.15:
new_s = primary_s + 0.15
# Remove hue for b/w images
#if primary_s < 0.01:
#titlebar_s = 0.0
if new_s < 0.87 and new_l > 0.15:
new_s = new_s + 0.13
panel_background = color_triplet(primary_h, av_l/512, new_s)
panel_background = color_triplet(primary_h, primary_l/2, new_s)
panel_header = color_triplet(primary_h, 0.12, 0.09)
button_hover = color_triplet(h, 0.2, s)
button_hover = color_triplet(primary_h, min(primary_l/1.25,0.7), new_s)
foreground = "255,255,255"
task_focus = color_triplet(primary_h, 0.35, new_s/2)
button_foreground = "252,252,252"
task_focus = color_triplet(primary_h, min(primary_l/1.25,0.7), new_s/2)
button_foreground = "255,255,255"
highlight_color = color_triplet(primary_h, 0.8, new_s)
#highlight_color = color_triplet(h, 0.88, 1)
midlight = color_triplet(h, 0.5, 0.5)
button_background = color_triplet(primary_h, min(primary_l/1.5,0.4), new_s)
titlebar = color_triplet(primary_h, 0.5, titlebar_s)
#print(panel_background)
......@@ -215,7 +192,7 @@ plasma_colors = plasma_colors.replace('aaa', panel_background)
plasma_colors = plasma_colors.replace('bbb', foreground)
plasma_colors = plasma_colors.replace('ddd', highlight_color)
plasma_colors = plasma_colors.replace('eee', button_foreground)
plasma_colors = plasma_colors.replace('fff', midlight)
plasma_colors = plasma_colors.replace('fff', button_background)
plasma_colors = plasma_colors.replace('ccc', panel_header)
plasma_colors = plasma_colors.replace('ggg', task_focus)
plasma_colors = plasma_colors.replace('hhh', button_hover)
......@@ -244,18 +221,22 @@ except IOError as e:
try:
subprocess.run(['kwriteconfig5', '--file=kdeglobals',
'--group=Colors:Selection',
'--key=BackgroundNormal', midlight])
'--key=BackgroundNormal', highlight_color])
subprocess.run(['kwriteconfig5', '--file=kdeglobals',
'--group=Colors:View',
'--key=DecorationFocus',
midlight])
#subprocess.run(['kwriteconfig5', '--file=kdeglobals',
#'--group=WM',
#'--key=activeBackground',
#midlight_color])
#subprocess.run(['kwriteconfig5', '--file=kdeglobals',
#'--group=WM',
#'--key=activeForeground',
#foreground])
button_background])
subprocess.run(['kwriteconfig5', '--file=kdeglobals',
'--group=WM',
'--key=activeBackground',
titlebar])
subprocess.run(['kwriteconfig5', '--file=kdeglobals',
'--group=WM',
'--key=activeForeground',
foreground])
subprocess.run(['kwriteconfig5', '--file=kdeglobals',
'--group=Colors:Button',
'--key=activeForeground',
foreground])
except IOError as e:
sys.exit(e)
[Colors:Window]
ForegroundNormal=255,255,255
BackgroundNormal=14,14,14
BackgroundNormal=12,20,28
ForegroundNegative=212,84,0
[Colors:Selection]
BackgroundNormal=204,204,204
BackgroundNormal=184,204,223
[Colors:Complimentary]
BackgroundNormal=14,14,14
BackgroundNormal=12,20,28
ForegroundNormal=255,255,255
[Colors:Button]
ForegroundNormal=255,255,255
BackgroundNormal=19,19,19
DecorationFocus=204,204,204
DecorationHover=255,0,0
BackgroundNormal=16,27,37
DecorationFocus=184,204,223
DecorationHover=20,32,44
[Colors:View]
ForegroundNormal=255,255,255
BackgroundNormal=33,31,27
DecorationHover=204,204,204
DecorationFocus=89,89,89
\ No newline at end of file
BackgroundNormal=27,30,33
DecorationHover=184,204,223
DecorationFocus=26,32,38
[Colors:Header]
ForegroundNormal=184,204,223
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment