-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Unity indicator official #184
Comments
An indicator for Unity would be very welcome, let me know if you need any pointers (still getting acquainted with the codebase myself though). Had a look at #82 but that PR is all over the place... I think it makes sense to keep this in its own repository, maybe you can start one and when you're ready to submit a PR we'll create it on our side as well. |
Where's the upvote? I just updated the default version that Ubuntu ships with 14.04 from GitHub and the App is unusable for me in the current state. |
@riker09 yep the current version only targets Gnome Shell and CLI at the moment. Contributions are welcome! |
Hi! I started looking into this. A basic hamster-indicator script wouldn't be too difficult to create, and wouldn't need to be "all over the place". I wrote a basic proof of concept, with "Stop tracking", "Show overview" and "Add earlier activity" working. Starting a new activity is a bit more complicated. Furthermore I'm duplicating code from hamster-cli... a bit of refactoring would help to respect the DRY principle. (Or maybe I should add the indicator code to hamster-cli. I guess I still need to better understand the relations between hamster-cli and the dbus services.) Which leads me to my question: should I make it work with the trunk or with the last stable? The code has diverged quite a lot since 1.04. Is anyone running "bleeding edge"? toupeira, tbaugis? |
@nchachereau I would say bleeding edge since there already exists a Unity indicator that works with stable. I am running bleeding edge on Ubuntu without an indicator. |
@nchachereau I'd also say bleeding edge, it's pretty stable for me and I'm planning to make a 1.05 release before the end of the year (fingers crossed). What problems are you encountering on implementing "Add activity" vs. "Add earlier activity"? Isn't it pretty much the same, just without an end time? |
The distinction between “Add activity” and “Add earlier activity” doesn't make sense with the new GUI in the trunk. I had seen that from the code, but as I hadn't tried it yet, so I was referring to a now obsolete distinction. Bleeding edge seems stable indeed, but I encountered quite a few bugs. I will report them and/or work on them in the next few weeks. Regarding the indicator, here are a few thoughts:
So here is a first prototype: https://gist.github.com/nchachereau/2460d0224b0b9df5b61e I will propose a pull request when we have decided on the issues above. Unlike what I thought, the amount of code duplicated from hamster-cli is quite small, no need to refactor. (Source of the image: http://www.albertomilone.com/wordpress/?p=502) |
Thanks!
If it's not too much effort I would implement the same options as the shell extension: The label combines the activity name and duration, which makes sense IMHO since most people probably want either both or just the icon. Also I just noticed that "Icon" displays a blank icon and "Label and icon" displays only the duration, will add another issue for those ;-)
For reference, the Gnome extension looks like this: If you decide to implement the label inside the indicator it would probably make sense to not show it again in the menu, but then you'd need another way to add a new activity. Regarding "Close indicator", unless this is common in Unity indicators and/or there's no other way to manage indicators, I would leave it out to avoid accidentally removing the indicator. Regarding "Preferences", I suggest naming it "Tracking Settings" as well. |
Thank you for these comments! Regarding options, application indicators require an icon. I propose following options:
The user would thus be able to mix and match (personally I like seeing the duration, but I usually know what I am doing). The last option comes from the original hamster-appindicator. I'll have to find/create better icons, as the original “glow” icon doesn't look very nice. (I haven't given much thought about the wording yet. Tell me if you have better ideas, as I am not a native English speaker.)
Well, if I look at the indicators I have, they always have a "Quit" menu entry. They usually are the main or only GUI for the application, so that this option terminates both the indicator and the application (e.g. redshift, which changes the color of the screen; parcellite, a clipboard manager; Dropbox; etc). Quitting by mistake is not a real problem, you just run the application again. The indicators that do not allow quitting are the “system” indicators such as network-manager, keyboard switching, messaging, sound, ... I'd argue that Hamster does not belong to this category, and that we, as users, may not always want Hamster in our panel. Thus, the question now becomes: should the Hamster indicator only allow closing it, or really “quitting” also terminating the DBus services and closing any open windows? I still wanted to look into that, but this seems the way to go, as simply starting Hamster again will restart the services as well.
Done. Right now, it is still mostly a single python script, but all in all I think it would be: a python script, several icons, a Gsettings schema file, a .desktop launcher file, maybe a Glade UI file for the indicator settings. I think it makes most sense to consider it almost a separate application, just as the Gnome extension also is a separate repo. How should I proceed to propose a new repository for project hamster? |
I've created a repository at https://github.com/projecthamster/unity-indicator and added your user, welcome to the Project Hamster organization! :-)
Sounds good! I'd just keep the options short, something like this:
I'd say yes if you agree, not sure how to do that though since the hamster CLI doesn't implement it either. |
Thanks! 😄
Well you can just call the Quit() methods on both services. However, I now have a dilemma. “Close indicator” may not suggest that this will close any open windows. “Quit” may suggest that this will also stop tracking (it won't, nor am I sure it should). Maybe use “Quit” anyway, and users will learn along the way? Offer the choice as a setting, just as there are options to stop tracking on shutdown or when the computer becomes idle? |
Hmm yeah I guess that's just the way Hamster works, so I'd use "Quit" and let it keep tracking, maybe the user even still uses Hamster through the CLI. |
I think a user option would be preferable. Typically when I close a program, I do not assume its daemon is still running in the background unless I specifically requested it to do so. |
As far as I know there's no daemon left running when you kill the DBus services, but if you don't explicitly mark the last activity as stopped, it will simply stay active when you start Hamster again. |
Your contrasting answers nicely capture my dilemma...
Technically, that's absolutely true. Which is a very good reason to quit the DBus services in the first place. They will restart as soon as they are called anyway.
And I think that's what @holocronweaver meant: not the technical meaning of “I do not expect a background process to continue running and take memory space”, but rather “I do not expect the current activity in Hamster to remain active”. So I implemented an option, it's called “Stop tracking on indicator close” (it is thus similar to “Stop tracking on idle” in the tracking settings). It is enabled by default. The menu item then explicitly reads “Quit and stop tracking”. It just reads “Quit” if you disable the option (but then you know what you're doing). This is what it looks like: @holocronweaver: Since you opened this bug, would you mind testing my work? git clone https://github.com/projecthamster/unity-indicator.git
cd unity-indicator
sudo cp data/hamster-indicator.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
sudo cp data/icons/ubuntu-mono-dark/24x24/* /usr/share/icons/ubuntu-mono-dark/apps/24/
sudo gtk-update-icon-cache /usr/share/icons/ubuntu-mono-dark
./hamster-indicator (Obviously, this only installs the ubuntu-mono-dark icons; edit as needed. I ended up using the icons from Milone's hamster-appindicator, but replacing the “glow” icons with the standard colored ones.) Tell me what you think! Next things on my list:
|
@nchachereau is correct, I meant continuing activity tracking after the app closes. For some reason I thought a daemon process was involved - no idea why. =) Anyhow, I tested the indicator. Seems to work great on Ubuntu 14.04. I tried all the available options, one by one, then all at once, and everything seemed to work. The only odd bug I noticed is when I first launched the indicator, the 'Quit' button was not there, but after playing with the options a bit and tracking a few activities, it appeared. Overall, great job! Thanks so much for getting this done. Exactly what I had in mind. Is there a way I could send a little coin your way? Sadly I have inexplicably been having trouble with hamster itself (see #197), so I can't be 100% sure everything works with an functional installation. BTW, your TODO list looks good to me. I don't know anything about packaging, though I could lend a hand by looking it up if no one else here is familiar. Edit: Actually, I have a requested TODO item that may or may not be related to this project. A global hotkey to open the change activity dialog would be awesome. |
I just noticed this as well. Fixed.
Thanks!! I'm glad you like it.
Frankly I never looked into this coin thing... just help make Hamster better, that would be awesome! Took note of your global hotkey wish. It may belong to Hamster itself, however. |
👍 Sounds like a good solution! |
Will it be able to use unity's quicklist and badge? |
If you have any programming skills, you are welcome to look into this and propose a patch, especially if the code is distinct from the indicator 😄 I may look into this after I finished the indicator itself, but no promises. I find the indicator nice because you do not need an icon in the launcher. For those wondering, I should be able to finish the indicator in the next week or so. |
Thx for your hard work~~ Indicator seems more powerful, I'm looking forward to try! Nicolas Chachereau 於 2014年12月24日 19:00 寫道:
|
Is unity-indicator project abandoned? I've posted pull-request more than a month ago but still no response. Does it have any maintainer? |
Hi Vasily, sorry, I've been extremely busy... I'll look into your PR this week-end. It is great having someone else contributing to the code! |
Any chance this work will also result in a system tray entry for KDE Plasma 5's system tray? |
@daytonb Unless KDE has a Unity indicator interface, I don't see how it could. |
Further discussions about unity can go to |
A status icon makes hamster much easier to keep track of.
Currently the only hamster status icon that works in the Unity desktop environment is the hamster indicator (http://www.webupd8.org/2011/07/install-hamster-indicator-time-tracking.html). From what I can tell, it has been abandoned by its creator. Since it is no longer updated for the latest hamster release, Ubuntu is shipping an old version of hamster in its repositories so that the indicator continues to function.
I feel a status icon is critical enough to hamster functionality, and Ubuntu a popular enough distro, that it should be officially supported, either as a separate git repo under projecthamster or within the hamster repo. Doing so would allow Ubuntu to package newer hamster versions (a good thing for both devs and users). Plus it would make it easier for others to improve Unity integration by making contributions.
We could also use this opportunity to fix #156 and finally get Ubuntu support into proper shape. As-is, the git version of Hamster is not very usable on Ubuntu out of the box.
I am willing to do the bulk of the work to make this happen, but want to hear thoughts from the maintainers and community before I proceed.
(BTW, pull request #82 seems to have already integrated the indicator into hamster. May be worth a look.)
The text was updated successfully, but these errors were encountered: