Open AndydeCleyre opened 7 years ago
Cannot reproduce it. (1) is correct. (2) is not correct, the dropdown should not start like (1), it should be always visible from start. In my case, this is the behavior I observe.
Can you paste your kargos script? Could you try without latte-dock?
My environment is Kubuntu 16.04 LTS
:
plasma-desktop 5.5.5
qt5: 5.5.1
Sure, I created an empty panel and added a kargos applet with default settings except for the script:
Here's the script:
#!/usr/bin/env python3
from time import localtime, strftime
from donuts import Donut
fmt = " | font=Iosevka size=24"
lt = localtime()
hour, minute = lt[3:5]
anchor = Donut(hour + minute / 60)
surplus = minute % 5
anchor += Donut('.1') if surplus else 0
lead = f"{5 - surplus}→" if surplus else ''
print(f"{lead}{(anchor % 12).places(1, True)}{fmt}")
print('---')
print(f"{strftime('%I:%M %p', lt)}{fmt}")
I do wish the button could be hidden altogether, as displaying it on each click as in (1) disrupts the location of every other item on that panel.
I'm not python expert, I get
File "./script.py", line 15
lead = f"{5 - surplus}→" if surplus else ''
^
SyntaxError: invalid syntax
When:
false
---
)The dropdown button appears and displaces other widgets. The only alternative is an always visible dropdown button, like the one in the "Status & Notifications" widget, whose dropdown button is always visible.
Sorry, I didn't realize you wanted to run my script, I didn't include a custom library it uses anyway. But I get the same behavior with:
#!/bin/bash
echo "1→2.5 | font=Iosevka size=24"
echo "---"
echo "2:24 | font=Iosevka size=24"
The only alternative is an always visible dropdown button
Is it a specific design decision to rule out a never-visible dropdown button?
Ok, I have tested it.
I've set Dropdown always visible to true
.
I addition, I did
killall plasmashell
plasmashell
And the dropdown button appears from the very beginning.
When you restart plasmashell from the console, a lot of output is seen (logs from every widgets of plasma). Can you paste this log to see if there is something strange?
I'm no longer experiencing this bug. ¯\_(ツ)_/¯
Shoot, it just re-appeared. I have the box unchecked, but the icon appears sometimes when the cursor starts or stops hovering.
Interestingly, this behavior stopped while I disabled compositing, and resumed when I re-enabled it.
Right now I'm using this script, with rotation at 8
and preferred height at 300
:
now_playing.5s.py
:
#!/usr/bin/env python3
from plumbum.cmd import playerctl
from plumbum import ProcessExecutionError
fmt = " | font='Iosevka Light' size=21"
get = playerctl['metadata']
def resize(txt, size, pre='» ', post=' «', ellipsis='center'):
free = size - len(txt)
if free >= 0:
a, b = divmod(free, 2)
return f"{pre}{' ' * a}{txt}{' ' * (a + b)}{post}"
elif ellipsis == 'end':
return f"{pre}{txt[:size - 1]}…{post}"
elif ellipsis == 'center':
a, b = divmod(size - 1, 2)
return f"{pre}{txt[:a + b]}…{txt[-a:]}{post}"
try:
title, artist = get('title'), get('artist')
except ProcessExecutionError:
print(f"{fmt} iconName=spotify-indicator bash=spotify onclick=bash")
else:
size = min(15, max(len(artist), len(title)))
print(f"{resize(artist, size)}{fmt}")
print(f"{resize(title, size)}{fmt}")
print('---')
print(f"{title} {fmt}", "iconName=media-album-track")
print(f"{artist} {fmt}", "iconName=view-media-artist")
print(f"{get('album')}{fmt}", "iconName=media-album-cover")
kargos
0.6.0
latte-dock0.6.0.r316.g85eae84
plasma-desktop5.10.0
qt5-base5.8.0
With "Dropdown always visible" unchecked, the following behaviors are observed:
I know (2) is not as intended, but I'm not sure about (1).