-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
arch_updates: hourly cache_timeout, add a note about alpm-hooks #2219
Conversation
df73d90
to
eefe604
Compare
@geoffliu what do you think of that please? |
(Thought) If the py3status maintainers could add this hook for The manual refreshes still occurs when the users restarts/reloads i3 -- which may be the reason the PR was put together, but prevents anyone from doing non-timed refreshes (say, for testing purposes). One more thing about Maybe it's possible to add various hook files ourselves for various update modules. Idk. |
@geoffliu Pls respond. |
I must be missing the big picture. I mean, the arch_update module cache_timeout can be configured-set a lower timeout if you don't want to wait for the default refresh rate to update the module. You can also set up an 'on_click(x)' to run checkupdates, and that will also clear the module cache (personally have seen this behavior). Worst case, refresh py3status. I also think it might be better to just provide a sample hook in the module's documentation-that way the user can decide for themselves if a hook would serve them. My 0010 cents.... |
There is (currently) no With I like the idea of very small interval (10s at most) cache to prevent updater command from being executed every time somebody restarted/reloaded py3status/i3 and the idea of not having to use/rely on/read Improve |
Fair enough; I missed that it was changed in 24888b3. I did have a somewhat long-winded reply in mind, but in retrospect, the module always worked fine for me (displayed number of pending updates, and didn't display when there were none It wasn't a big thing if the module didn't refresh immediately after running an update, because I knew that I had just updated. |
@lasers the hook you're talking about is a alpm config if I understand correctly. I don't understand what you mean by py3status maintainers "adding it". That's user optimization depending on their distro and should be kept as-is imho. |
We could provide system hook just like neovim and many others.
Using an example with $ pacman -Qo /usr/share/libalpm/hooks/nvimdoc.hook
/usr/share/libalpm/hooks/nvimdoc.hook is owned by neovim 0.9.4-2 $ cat /usr/share/libalpm/hooks/nvimdoc.hook
[Trigger]
Operation = Install
Operation = Upgrade
Operation= Remove
Type = Path
Target = usr/share/nvim/runtime/doc/
[Action]
Description = Updating Neovim help tags...
Exec = /usr/bin/nvim -es --cmd ":helptags /usr/share/nvim/runtime/doc/" --cmd ":q"
When = PostTransaction
All this does is to refresh And if users really don't want this, they can override hooks too.
There are some hooks such as
With hook - https://gitlab.archlinux.org/archlinux/packaging/packages/neovim |
@lasers @ultrabug Sorry for the late response. This is a much cleaner solution. I wasn't so thrilled with the custom caching scheme to begin with, hence the reservation in my original PR. What would be involved in getting the arch packager to include such a hook though? Do you have experience getting that pushed through? But I'm all for reverting my change and manually adding a hook in the meantime. |
@lasers Just tested on my Arch setup, the hook file works great. Thank you for pointing this out! |
We'd have to reach out to them both ( Same thing for other update modules in the future. |
Well let's ask the Arch packager directly then, Monsieur @Antiz96 please would you consider adding a hook to the Arch package s'il te plaît ? :D |
Hi everyone,
That should be doable :) |
I can add the following alpm hook to the py3status [extra] package (and eventually leave a comment to the py3status-git AUR package's page so its maintainer can take the action as well, if you want me to).
Specifying
Can this hook be added right now or should we wait for a new I remain available if needed :) |
I can update this PR later to remove the optional note and to mention something about new hook refreshes along with new default The best part about this is that |
New release I also left a comment on py3status-git AUR package's page. |
f3f3ec7
to
2d60764
Compare
2d60764
to
b164439
Compare
@ultrabug Dis ready. |
Merci @Antiz96 ! |
De rien ! |
I have no dog in this fight.
Alternative solution to #2215. I think this is more clean approach because it's done without trying to cache something nor confuse users with possibly some false positive / changes... For instance, if users clicked on
arch_updates
on the bar, would it run the updater command or just giving the users same cached information... or what if users want the updater command to be executed via clicks, py3-cmd, et cetera instead? I assume it wouldn't really update the numbers... Also, this should be much much way less polling.I'm blindly making changes here on different distro. I would need somebody "BTW I Use Arch" to test this.
Closes #2217
Fixes #2215