Skip to content

Conversation

@Lomadriel
Copy link
Member

@Lomadriel Lomadriel commented Mar 12, 2019

Fix #1127.

Add an interval for each hook (new key hook-*-interval), those keys are not required. If they are not present they are defaulted to 0 and it signifies that the hook should not be recalled. Otherwise the hook will be called every hook-*-interval seconds.

@abrouwers
Copy link

I have a use for this, as I'm using a simple weather module that I'd like to update (a) Every 10 minutes, or (b) if I click ("what is the weather right now? after opening my laptop quickly). I tried applying this PR to test, but it doesn't seem to apply to 3.5.5. Is there any update available? I'd be happy to test if so.

Basically, what I'm hoping will work is something like:

[module/weather]
type = custom/ipc
hook-0 = python3 ~/.config/polybar/scripts/weather.py
initial = 1
interval = 600
click-left = polybar-msg hook weather 1

############################################################

Here's what I see when I try to apply:

$ patch -Np1 -i ../1852.patch
patching file include/modules/ipc.hpp
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 12 (offset -2 lines).
Hunk #3 FAILED at 23.
2 out of 3 hunks FAILED -- saving rejects to file include/modules/ipc.hpp.rej
patching file src/modules/ipc.cpp
Hunk #1 FAILED at 1.
Hunk #6 FAILED at 144.
2 out of 6 hunks FAILED -- saving rejects to file src/modules/ipc.cpp.rej
patching file include/modules/ipc.hpp
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED -- saving rejects to file include/modules/ipc.hpp.rej
patching file include/utils/string.hpp
patching file src/modules/ipc.cpp
Hunk #1 FAILED at 96.
Hunk #2 succeeded at 148 with fuzz 2 (offset -45 lines).
1 out of 2 hunks FAILED -- saving rejects to file src/modules/ipc.cpp.rej

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPC module interval support

2 participants