stocks-extension
stocks-extension copied to clipboard
More customisation possible?
Hi. I do like a lot this software but will be great to have some more customisation options like:
- Custom fonts. Right now the fonts are barely visible in my screen, I need to get close to screen to be able to read the numbers.
- Option to show only the price without the (price change$ | percentage%)
-
font family is used from the the gnome theme and font sizes should be more or less based upon the themes defaults. You already have the possiblity to modify the styling by extending the stylesheet.css in your installation folder. What theme do you use?
-
yep i plan to add a flexible way so that users can define their own template / values to display
Another good addition would be some sort of notification when thresholds are met. Such as if a given stock passes a given price. Some rule-based notifications?
Another good addition would be some sort of notification when thresholds are met. Such as if a given stock passes a given price. Some rule-based notifications?
Indeed, an useful feature, but for me the font size is the most annoying. I need to stare too close to my monitor to be able to read the price of the stocks.
yep i plan to add a flexible way so that users can define their own template / values to display
Sounds interesting! What kind of template system were you thinking of? I've been maintaining my own super minimal ticker display variant that I'd love to get rid of.
Just hearing the word "template" results in an idea like
{name} {quote}{currency} ({change}{currency} | {percent}%)
but it doesn't translate well to multiple St.Label
instances with different fonts, colors, alignment etc. Do the St widgets have something more suitable for this?
that is what i have in my mind, each field would be a own St.Label
, no color customization yet
I can imagine providing some modifiers like {change:small:bold:left} and a {linebreak} and then let's see how this will look like in the end. Actually i am not very confident with the positioning, y/x_align & expand often is not really doing what i expected
so my desired view would be like this
{name:bold}{linebreak}{quote:small}{currency:small} ({change:small}{currency:small} | {percent:small}%)
or maybe this more would be more convenient
{block:bold}{name}{endblock}{linebreak}{block:small}{quote}{currency} ({change}{currency} | {percent}%){endblock}
How do you like this kind of variant that separates text formatting and template variables?
<small><b>{name}</b><br/>{quote}{currency} ({change}{currency} | {percent}%)</small>
<p>{symbol}</p>{quote}<small>{currency} ({change}{currency} {percent}%)</small>
<b>{symbol}<b> {quote}<small>{currency}</small>
{quote}
My personal favorite is a meaningless plain number to make it more pleasant to share the screen.
Looks good, i looked around maybe it's even possible to put that straight into st label as markup
https://docs.gtk.org/gtk4/class.Label.html#markup-styled-text https://gitlab.gnome.org/GNOME/mutter/-/issues/1324
Nice. A quick attempt suggests that foreground colors are not respected but otherwise, it looks really promising.
<span foreground="red">Red</span> <b>bold</b> <i>italic</i> <small>small</small> <sub>sub</sub> <sup>sup</sup>
I've removed stylesheets and trimmed the whole extension all the way down to:
function enable () {
let button = new PanelMenu.Button()
let label = new St.Label()
label.get_clutter_text().set_markup('<span color="red">fg</span> <span background="red">bg</span> <b>bold</b>')
button.add_actor(label)
Main.panel.addToStatusArea('stocksMenu', button)
}
Still no success with the foreground color.
I'm only able to change the foreground color by setting a style class, but that applies to the whole label, of course... Do you have any ideas or should we go back to parsing the markup by hand?
I'm on Ubuntu 22.04 / GNOME 42. Could someone else give this a try?
@jpnurmi i just tried it, muellner mentioned here https://gitlab.gnome.org/GNOME/mutter/-/issues/1324 that if you put a single whitespace the font color works as well
label.get_clutter_text().set_markup(' <span color="red">fg</span> <span background="red">bg</span> <b>bold</b>')
do you want to continue with this modification? i think i will not be able to start until weekend or maybe even next weekend
Great, that works! Sounds like we have a plan. No rush :)
I made a fork that might be of interest to you guys here, it does not allow font changes but it allows one to customize what is displayed in each ticker item such as quote, change$ and change%. Settings are per-stock in portfolios items, so each ticker item can be customized properly...
Some more work is needed for fonts styles however.