projecthamster / hamster-shell-extension

Shell extension for hamster
http://projecthamster.org
GNU General Public License v3.0
215 stars 91 forks source link

Not working with gnome-shell 3.32 #307

Closed matclab closed 4 years ago

matclab commented 5 years ago

This nice extension does not work anymore on gnome-shell 3.32. logs say:

JS ERROR: TypeError: this.factsBox is undefined
                  _refresh@/home/matclab/.local/share/gnome-shell/extensions/contact@projecthamster.org/widgets/panelWidget.js:191:3
                  asyncCallback@resource:///org/gnome/gjs/modules/overrides/Gio.js:133:13
ldoktor commented 5 years ago

I'm using version with https://github.com/projecthamster/hamster-shell-extension/pull/299 and getting a different error:

bře 28 18:53:47 localhost.localdomain gnome-shell[14920]: JS ERROR: TypeError: this._construct is not a function
                                                           newClass@resource:///org/gnome/gjs/modules/_legacy.js:114:32
                                                           _init@/home/medic/.local/share/gnome-shell/extensions/contact@projecthamster.org/widgets/panelWidget.js:102:25
                                                           wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
                                                           deferred_enable@/home/medic/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:143:32
                                                           Controller/enable/<@/home/medic/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:132:21
                                                           _makeProxyWrapper/</<@resource:///org/gnome/gjs/modules/overrides/Gio.js:243:21

But also does not work. I depend on this plugin, but unfortunately don't know javascript enough to fix it. Would someone please take a look at this? I'm open to some form of donation...

ernestask commented 5 years ago

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361 and https://gitlab.gnome.org/GNOME/gnome-shell-extensions/commit/bab4be1a597226a5fe8a29dcf3848be47e16a5e5 should be a start.

Edit: also https://gitlab.gnome.org/GNOME/gnome-shell-extensions/commit/ba27cc4a64daf7f62174653362741de30c2f5b86

ldoktor commented 5 years ago

Thank you, another source of information could be another extension I can't live without that had been already ported: https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/pull/510

aldomann commented 5 years ago

@ernestask's branch works great on my system.

wolffi commented 5 years ago

Works great. Thanks a lot @ernestaks! A minor inconvenience, auto-completion does not seem to work in the "What are you doing" dialog.

ernestask commented 5 years ago

I’m pretty sure there should be something in the journal in that case. Otherwise, I am not really interested in further working on this.

jimmytheneutrino commented 5 years ago

Guys, it's been 3 months and we have 2 functional PR versions available. This is, IMHO, the best time tracker for Gnome but it does feel that it is a bit under-loved right now (the latest commit to the main repo was more than one year ago).

Could somebody please look into this, @elbenfreund, @tstriker, @FredericGuilbault? Maybe guys from the main hamster repo could help, @ederag, @GeraldJansen ?

Maybe one of the PR authors @ernestask, @hedayat or @mwilck might want to become new maintainers?

ernestask commented 5 years ago

Maybe one of the PR authors @ernestask, @hedayat or @mwilck might want to become new maintainers?

Not particularly. Only looked into this because a distant colleague was having issues.

mwilck commented 5 years ago

I have no ambition to become the maintainer of this extension. I'm currently maintaining hamster for openSUSE (I'm much more into Python than Javascript). For openSUSE, I decided to package the extension as RPM to compensate for it being missing on the GNOME extensions web site.

I guess in theory, anyone of us could submit an update to extensions.gnome.org. We should be aware that the 3.32 and 3.30 versions are strictly incompatible though; not sure how other extension writers handle that. 3.32 users are probably still the minority today. Does extensions.gnome.org handle the GNOME version dependencies automatically somehow, I mean, is it possible to submit the same extension multiple times, for multiple GNOME shell versions?

aldomann commented 5 years ago

@mwilck as far as I'm concerned (if the UI is any indication), the website does handle different versions of a same extension, as it in fact allows your to download different versions of a given extension (tagged by the version of GS it's compatible with).

I think the problem would be that it has to be the original developer the one who submits an updated version. A possible solution would be to just have it as a new extension instead.

ederag commented 5 years ago

Maybe guys from the main hamster repo could help

Well, maintaining the main original hamster is already eating too much of my time, so no thanks :wink: I'll just make sure that the dbus interface stays compatible. Thanks to this dbus interface, this extension is well separated, so it is perfect to have a distinct maintainer.

hedayat commented 5 years ago

I'm also not someone who can be a real maintainer for this extension. However, if maintaining would mean accepting merge requests and trying to solve small bugs; it'd be possible (I was already thinking about creating a fork with such a goal for myself). But, I'm really not a Javascript guy, and certainly not a good maintainer for this project specially officially. And... there is no need to have a single maintainer. :P I'd be more than willing to help with maintaining this project as far as my time permits.

FredericGuilbault commented 5 years ago

I also think it's the best time tracker for linux But Im out of this project.

I have worked on a rewrite of hamster project in nodejs. https://gitlab.com/FredericGuilbault/gerboise But at this point it berly usable. So not much of a solution ATM.


IMO, at this point of abandon, whatever @hedayat do, it's better then nothing so +1

It been few years alerady but I remember there was some code shared between hamster-shell-extension and the cinamon version of this plugin. Then, cinnamon people asked to become maintainers of their projectHamster extention and integrated it in their big repo who contain all the cinnamon applets. That's a thing I recall.

mwilck commented 5 years ago

Sounds good to me too. @hedayat, I'd be willing to help as time and abilities permit, but like you I'm also not a Javascript guy. I have personal interest to make sure the extension works. It's a shame that maintaining extensions is being made so difficult by the core developers.

FredericGuilbault commented 5 years ago

it is.

aldomann commented 4 years ago

@FredericGuilbault are you still working on Gerboise?

GeraldJansen commented 4 years ago

A simple, alternative gnome-shell extension could be constructed with https://github.com/p-e-w/argos and Hamster CLI commands. That would require less maintenance because Argos is well maintained for Gnome updates.

matclab commented 4 years ago

@GeraldJansen Good idea… I've done a very rough first implementation which depends on xsv and piep (I'll probably do a pure python implementation later) :

It proposes to choose an activy among one of the last 14 days. You may still add new activity with hamster CLI.

#!/bin/sh

LC_ALL=C hamster current \
   | piep "p if p == 'No activity' else p.split(',')[0].split()[2:]"
echo "---"
now=$(date +%Y-%m-%d)
last=$(date +%Y-%m-%d -d "14 days ago")
echo "Stop | terminal=false refresh=true bash='hamster stop'"
LC_ALL=C hamster export tsv "$last" "$now"  \
   | xsv select -d"\t" "activity,category,description,tags" | xsv sort \
   | tail -n+2 | uniq \
   | piep "p.splitcomma()|l=f'#{p[3]}' if p[3] else ''
        | f'{p[0]}@{p[1]},{p[2]} {l}' | p.strip(', ')
        | p + f' | terminal=false refresh=true bash=\'hamster start \"{p}\"\''"
FredericGuilbault commented 4 years ago

@aldomann Yes I do, Quite slowly, but im still on it. I had many trouble with nwjs + sqlite. Gerboise is far from ready for production in term of functionality, code quality and stability. but That's what I use ATM.

It be more motivating if I had users/contributors/interested people.

aldomann commented 4 years ago

I've made a more polished version of @matclab's Argos script trying to replicate hamster-shell-extension's UX as much as possible.

#!/bin/sh

# Top bar status
LC_ALL=C hamster current \
    | piep "' | iconName=media-playback-start-symbolic' if p == 'No activity' else ' | iconName=media-playback-stop-symbolic'"
echo "---"

# Print current activity
echo "Current activity | size=10 | color=#919191"
LC_ALL=C hamster current \
    | piep "p if p == 'No activity' else p.split(',')[0].split()[2:]"
# Stop current activity
LC_ALL=C hamster current \
    | piep "'Stop Tracking | terminal=false refresh=true bash=\'hamster stop\'' if p != 'No activity' else ''"

# Get list of recent activities
now=$(date +%Y-%m-%d)
last=$(date +%Y-%m-%d -d "14 days ago")
echo "Recent activities | size=10 | color=#919191"
LC_ALL=C hamster export tsv "$last" "$now"  \
    | xsv select -d"\t" "activity,category,description,tags" | xsv sort \
    | tail -n+2 | uniq \
    | piep "p.splitcomma()|l=f'#{p[3]}' if p[3] else ''
        | f'{p[0]}@{p[1]},{p[2]} {l}' | p.strip(', ')
        | '--' + p + f' | terminal=false refresh=true bash=\'hamster start \"{p}\"\''"

# Additional GUI options
echo "---"
echo "Show Overview | terminal=false refresh=true bash='hamster overview'"
echo "Add Earlier Activity | terminal=false refresh=true bash='hamster add'"

image image

Some points to keep in mind:

Missing features

matclab commented 4 years ago

And here is a pure python version expanding on @aldomann one: https://gist.github.com/matclab/3a36d46e16bee776d0739292bcacaa9b I'll try to do a proper git repo…

aldomann commented 4 years ago

Didn't realise Argos supported Python. That's great, since bash can be a bit messy for some more complex stuff.

mwilck commented 4 years ago

@matclab, nice work in incredibly little time!

Yet AFAICS it's still missing the features I need most about the extension - being able to type in a new activitiy (with autocompletion) and the "edit activity" buttons.

So for the time being, I hope the JS extension can be repaired once more.

matclab commented 4 years ago

@mwilck unfortunately Argos does not allow for easy user input. However, I've added a "+" icon in order to launch the hamster UI for adding new action with completion. It only works well with hamster v2+, as hamster 1.04 does not quit once the window is closed, which gives a lot unused background process after some times.

The new version has its own repo: https://github.com/matclab/argos-hamster-plugin, which will allow to discuss it there and stop polluting this issue.

matclab commented 4 years ago

Closing in favor of issue #315

mwilck commented 4 years ago

See #315 for a fix for GNOME 3.34.

DirkHoffmann commented 4 years ago

Solution for 3.32 (title of this issue!) is mentioned in #315 (comment) and #301.