Stop Recording icon always showing on waybar
System details
Omarchy 3.1.1
What's wrong?
'Stop Recording' icon always showing on waybar. It is also inconsistently showing across the three monitors, and no recording is saved when i click the icon
Strange. Try omarchy-restart-waybar. Possible it got stuck from something. Did you ever do a recording?
https://github.com/basecamp/omarchy/issues/2628
Strange. Try
omarchy-restart-waybar. Possible it got stuck from something. Did you ever do a recording?
Never started any recordings. Just 'showed up'.
omarchy-restart-waybar fixed it for me. Haven't restarted yet. So, can't report if the fix is permanent or not.
Can confirm I get the same thing occasionally since updating omarchy. I haven't even entered the record command. Clicking it print a notification that a recording was saved, but nothing is actually saved
Same behavior for me. I have noticed that clicking does stop and save the recording. I can get the icon to disappear with a right click though. While it's still running, right clicking does nothing. Left clicking stops it and then I can right click to make it disappear.
Also if anyone is having the issue that it's not recording at all on some screens: I have noticed that the recording cannot handle negative pixel coordinates. So if your monitor.conf sets up screens with negative coordinates, you'll have to change that and then it seems to work. Found out by running the omarchy-cmd-screenrecord command manually in the terminal.
I also have the same behavior. I haven't started any recording and upon clicking the icon it lets me select an area on my screen (similar to the screenshot selection).
I noticed this yesterday as well.
cc @ryanrhughes.. somehow gpu-screen-recorder must be running? Here's the indicator:
if pgrep -f "gpu-screen-recorder" >/dev/null; then
echo '{"text": "", "tooltip": "Stop recording", "class": "active"}'
else
echo '{"text": ""}'
fi
same problem here.
gpu-screen-recorder doesn't seem to be running
interestingly, I have a dual screen setup - and it only shows on one screen
aha: when I say pkill -RTMIN+8 waybar without a recording indicator, it then shows one.
I have the same issue, and I have two screens when I click on it on one screen I goes to the other screen an so on running omarchy-restart-waybar fixed it (at least toporarily, lets see if it will appear again)
not an issue with gpu screen recorder. uninstalled gpu-screen-recorder and tried recording. it shows its recording and saving files. but nothing was recorded. and the icon still persists in waybar. i restarted waybar but still the issue crops up everytime.
right clicking makes the issue go away until next reboot or trigger screenshot or recording.
my guess something to do with whatever you are using to control the screen shots and recording.
On Omarchy 3.1.4 I noticed the same issue. The recording icon appeared for me after signing back in after a system suspend.
When I clicked on the icon my mouse pointer changed to crosshairs to allow for selecting a section of screen to record or take a snapshot of.
I did not try to record anything, but instead pressed the escape key. The crosshairs disappeared and the screen recording icon disappeared as well.
I dug into this and might have found why the indicator appears randomly. The issue is a race condition when pgrep finds itself in the process list.
The underlying script $OMARCHY_PATH/default/waybar/indicators/screen-recording.sh uses
if pgrep -f "gpu-screen-recorder" >/dev/null; then
to check if recording is active. However, pgrep -f searches the full command line of ALL running processes - including its own.
On multi-monitor setups, waybar appears to run the indicator script twice simultaneously (once per monitor). When both scripts execute at nearly the same time, each pgrep process finds the OTHER pgrep process in the system's process list, creating a false positive.
When I logged the events, it showed:
[10:01:13.853] Script called
[10:01:13.854] Script called ← Two calls, milliseconds apart
[10:01:13.854] pgrep matches: [223056 pgrep -fa gpu-screen-recorder]
[10:01:13.853] pgrep matches: [223058 pgrep -fa gpu-screen-recorder]
On my dual-monitor setup I got two different PIDs (223056 and 223058) - these are likely the two pgrep processes launched for each monitor. Each one finds the other running and thinks recording is active.
Proposed Fix:
Change line 2 in $OMARCHY_PATH/default/waybar/indicators/screen-recording.sh from:
if pgrep -f "gpu-screen-recorder" >/dev/null; then
To:
if pgrep -f "^gpu-screen-recorder" >/dev/null 2>&1; then
The ^ anchor limits regexp matches to the start of the command line.
How to test:
- Without fix:
pkill -RTMIN+8 waybarincorrectly shows the indicator (possibly only on multi-monitor setups) - With fix:
pkill -RTMIN+8 waybarkeeps indicator hidden - With fix:
omarchy-cmd-screenrecordcorrectly shows indicator when recording, hides when stopped. Working as expected.
Would appreciate tests by others, especially with multi-monitor setups.
@davidszp Tested this fix with a dual monitor setup. It seems to fix the issue as described.
Confirmed from my side as well
Confirmed this fix with a dual monitor config. Thank you!
Fixed on dev. Thanks @davidszp 👍