mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 09:15:22 +01:00
[GH-ISSUE #929] Idle Inhibitor module #1685
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#1685
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JakeStanger on GitHub (Apr 8, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/929
Originally assigned to: @slowsage on GitHub.
https://wayland.app/protocols/idle-inhibit-unstable-v1
Discussed in https://github.com/JakeStanger/ironbar/discussions/928
Originally posted by ildar April 8, 2025
Couldn't find any info if there is the Idle Inhibitor in the ironbar. Could it be implemented?
ref: https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor
@RobertMueller2 commented on GitHub (Jun 19, 2025):
Sharing this because I could imagine this is a show stopper for a number of people. Just stumbled across wayhibitor, this can be used until there's a native module. Config example:
EDIT: couldn't get it to work yet. Looking at a sway debug log, I'm guessing that it doesn't work without a surface with sway. If that's true, that's a reason for implementing it as a client/module.
@ildar commented on GitHub (Jul 3, 2025):
I've taken a look into the waybar sources and found it doesn't deal with wayland protocols at all. It is much simpler, using systemd through DBus.
So I've made a little shell script with this functionality: https://gist.github.com/ildar/ef351cdf65e5b00c834fe7a36f75f59f
It is quite ok as the workaound.
@RobertMueller2 commented on GitHub (Jul 4, 2025):
I also found a custom solution that works well for me within my sway session. I'm using
for_window, which then adds idle inhibition flag to the windowironbar config:
github.com/RobertMueller2/Dotfile-Snippets@b9451e1e4c/ironbar/config.corn (L92)relevant sway config part:
github.com/RobertMueller2/Dotfile-Snippets@b9451e1e4c/sway/config.d/30_idle.conf (L15)systemd-inhibit is a possibility as well. AFAICT it is not reported by ext-idle-notify, at least sway does not do it. But of course swayidle respects it.
My main issue about idle inhibition has always been transparency, even with notifications sent from swayidle. I've had too many surprises of unexpected locks, as well as returning to an unlocked screen after hours of afk. My solution works for me now, but I think if there ever is a native module, it should take all of it into account, idle state, systemd-inhibit, management of own idle inhibition, perhaps even allow to choose whether to use protocol or systemd-inhibit for the latter.
@slowsage commented on GitHub (Aug 27, 2025):
@JakeStanger Please give feedback on this approach when you get a chance.
I think with streaming remaining time, it can work well with ironbar.
@JakeStanger commented on GitHub (Sep 7, 2025):
Sorry I'm a little bit lost here. Can you give some more info please as to what that's doing and what your potential plan for it would be?
@slowsage commented on GitHub (Sep 7, 2025):
How it works (2-liner):
The solution uses systemd's primitives to setup a timer service that runs for n minutes. While the timer is running, idle is blocked and a socket file is available that outputs the time remaining in a streaming/watch fashion.
Relevant commands that ironbar scripts/custom modules can run:
systemctl --user start ironhibit@90m- idea is to have a menu with 30m, 60m, 90m and 120m - clickable to activate idle inhibition for that time. Instead of menu, you could also specify in config.nc -U "$XDG_RUNTIME_DIR/ironhibit.sock"- show time remaining in the timer - like music playback etc if someone wanted it.systemctl --user is-active ironhibit-timer- will check if idle inhibition is active so we can change color of widget/item accordingly.@JakeStanger commented on GitHub (Sep 8, 2025):
Right gotcha. That sounds like a solid approach for a custom module at least.
With the new
ironbar stylecommands and the ability to dynamically add/remove class names, you might not even need that last check. In theory you can change the style as part of the systemd unit directly.I also had a quick look at the native protocol approach again last night. It requires you to pass the
WlSurfaceobject, which is a problem as GTK3 does not expose itand I cannot imagine it ever will. It means without some serious hacks a solid custom approach is probably the best we'll get.EDIT: Looks like it might be possible with GTK4. Might.
@slowsage commented on GitHub (Oct 7, 2025):
Figured out a way to do it as a module inside ironbar itself and still be persistent (transient service). Added wayland option as fallback.
PR: #1190