{"action":"created","issue":{"url":"https://api.github.com/repos/jaagr/polybar/issues/1180","repository_url":"https://api.github.com/repos/jaagr/polybar","labels_url":"https://api.github.com/repos/jaagr/polybar/issues/1180/labels{/name}","comments_url":"https://api.github.com/repos/jaagr/polybar/issues/1180/comments","events_url":"https://api.github.com/repos/jaagr/polybar/issues/1180/events","html_url":"https://github.com/jaagr/polybar/issues/1180","id":315717839,"number":1180,"title":"Backlight not updating correctly","user":{"login":"Jarwain","id":1279360,"avatar_url":"https://avatars0.githubusercontent.com/u/1279360?v=4","gravatar_id":"","url":"https://api.github.com/users/Jarwain","html_url":"https://github.com/Jarwain","followers_url":"https://api.github.com/users/Jarwain/followers","following_url":"https://api.github.com/users/Jarwain/following{/other_user}","gists_url":"https://api.github.com/users/Jarwain/gists{/gist_id}","starred_url":"https://api.github.com/users/Jarwain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jarwain/subscriptions","organizations_url":"https://api.github.com/users/Jarwain/orgs","repos_url":"https://api.github.com/users/Jarwain/repos","events_url":"https://api.github.com/users/Jarwain/events{/privacy}","received_events_url":"https://api.github.com/users/Jarwain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-19T03:46:21Z","updated_at":"2018-04-22T19:56:31Z","closed_at":null,"author_association":"NONE","body":"When I change my brightness, it looks like polybar is updating the stored value, but not actually printing it until I change the brightness again. This results in a value that is behind by an update.\r\n\r\nSay, if my brightness is 45%. I increment it by 5%, and I see my screen get brighter. However, the value stays at 45%. \r\nbrightness(+5%) = Actual: 55%, Polybar: 50%\r\nbrightness(+5%) = Actual: 60%, Polybar: 55%\r\nbrightness(-20%) = Actual: 40%, Polybar: 60%\r\nbrightness(+10%) = Actual: 50%, Polybar 40%\r\n\r\nRestarting polybar prints the correct value.\r\n\r\nI am running a Lenovo Yoga 2 Pro on Fedora 27. \r\nI'm using internal/backlight, because xbacklight is not supported on my system. \r\n`card = intel_backlight`\r\nI have a bash script that updates `/sys/class/backlight/intel_backlight/brightness` with an x% change, bound to function keys via i3\r\n\r\nThis is pretty unimportant, but it's a silly bug and I figured I'd file an issue. I may try digging through the source to resolve this after I'm finished setting up this laptop. "},"comment":{"url":"https://api.github.com/repos/jaagr/polybar/issues/comments/383407905","html_url":"https://github.com/jaagr/polybar/issues/1180#issuecomment-383407905","issue_url":"https://api.github.com/repos/jaagr/polybar/issues/1180","id":383407905,"user":{"login":"patrick96","id":2452038,"avatar_url":"https://avatars1.githubusercontent.com/u/2452038?v=4","gravatar_id":"","url":"https://api.github.com/users/patrick96","html_url":"https://github.com/patrick96","followers_url":"https://api.github.com/users/patrick96/followers","following_url":"https://api.github.com/users/patrick96/following{/other_user}","gists_url":"https://api.github.com/users/patrick96/gists{/gist_id}","starred_url":"https://api.github.com/users/patrick96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrick96/subscriptions","organizations_url":"https://api.github.com/users/patrick96/orgs","repos_url":"https://api.github.com/users/patrick96/repos","events_url":"https://api.github.com/users/patrick96/events{/privacy}","received_events_url":"https://api.github.com/users/patrick96/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T19:56:31Z","updated_at":"2018-04-22T19:56:31Z","author_association":"COLLABORATOR","body":"So this would mean that polybar receives an `inotify_event` but the new value in `/sys/class/backlight/...` is not observed immediately. Seems like very weird behaviour, but maybe the filesystem is only eventually consistent or something like this (which would explain that we receive the inotify event before the file is actually updated for us). Adding a forced timeout seems very hacky to me, there has to be a better way.\r\n\r\n> I read #712 before, it didn't sound quite right because polybar was displaying a mostly accurate number, and does change on update.\r\n\r\nMy theory is that because you increase the brightness, your script first has to read the `backlight` file and thus polybar is updated, but always one step behind. Is polybar still always one step behind, even when you just pipe values into the `backlight` file without actually reading it? Also does polybar receive an inotify event when you do this (run with `-l trace`)?"}}
{"actor":{"display_login":"patrick96"}}