cinatic / stocks-extension

A extension to display stock quotes in GNOME Shell Panel
GNU General Public License v3.0
84 stars 31 forks source link

Minimally viable subset of core code to have a second instance (until multi-symbol is added) #37

Closed eddelbuettel closed 3 years ago

eddelbuettel commented 3 years ago

Thanks for writing stocks-extensions -- it works fabulously well. I added a comment to #20 as it would be lovely to have more than one symbol at a time.

I was hoping to help a little towards that goal (despite my unfamiliarity with Javascript...) but copying the code over to a second directory in ~/.local/share/gnome-shell/extensions and carefully replacing all 'handles' to the 2nd repository.

Turns out this doesn't work, possibly because "state" is kept somewhere else. Would you be able to help me with one or two tips towards making a dual (or more) display possible? I currently run with ^GSPC which is fabulous as it gives (free) real-time updates during market hours, and ES=F which complements with GLOBEX 23hour/5day coverage (but at a delay). Would be lovely to see them next to each other.

cinatic commented 3 years ago

out of curiosity i made an example how that can be achieved, it is not easy actually (https://github.com/cinatic/stocks-extension/compare/v16...v16_clone?expand=1)

  1. rename 'StockExtension' -> 'StockExtension2' org.gnome.shell.extensions.stocks -> org.gnome.shell.extensions.stocks2 stocks@infinicode.de -> stocks2@infinicode.de

  2. build and move new extension make && rm -fR ~/.local/share/gnome-shell/extensions/stocks2@infinicode.de/ && cp -r _build/stocks@infinicode.de ~/.local/share/gnome-shell/extensions/stocks2@infinicode.de

however #20 is coming very soon

eddelbuettel commented 3 years ago

Ran make from the new 'clone' branch and copied it in, restarted gnome shell (Alt-F2 <ret> r <ret>) and now see two Stocks Extensions in the menu but they are both names Stocks Extension and I can only activate one at a time. That's basically where I was before too.

Not a biggie. If #20 is coming I can wait. I was mostly curious 'if this would work'. Seems like not quite yet...

cinatic commented 3 years ago

it works on my machine™ ^^ i might missed something to or it might be a distro / gnome-shell version thing.

Have you enabled both extensions in gnome-tweaks? If it can not be enabled you most likely will see the error in looking glass.
Alt- F2 <ret> lg <ret> -> Goto Extensions Tab -> Search for second Stocks Extension if errors then there should be an show errors button

eddelbuettel commented 3 years ago

Good call on gnome-tweaks, I have a conflict there:

image

lg complains that there already is a status (can't cut and paste) for role stocksMenu.

eddelbuettel commented 3 years ago

Gosh, my apologies -- too much going on.

While I have those errors it actually works but I didn't notice as the default is in the 'middle' whereas I move my standard use to the right. I do now have my existing instance (with ES=F and ^GSPC) and your cloned one (with Alibaba by default). So all good!

Thank you!

eddelbuettel commented 3 years ago

The v16_clone branch achieves a second instance, so I guess we can close this.