SafeEyes
SafeEyes copied to clipboard
Do Not Disturb does not honor "Do Not Interrupt"
I am not sure how the method is working, but, at least the application appears in px aux:
sntentos@optiplex-9010 [2018-05-11 10:24:24]:~$ ps aux | grep 'zoo[m]'
sntentos 20751 0.0 0.0 13292 1580 ? S Μάι07 0:00 /usr/bin/zoom zoommtg://zoom.us/join?
sntentos 20756 0.0 0.0 4504 844 ? S Μάι07 0:00 sh -c export SSB_HOME=/home/sntentos/.zoom; export QSG_INFO=1; export LD_LIBRARY_PATH=/opt/zoom; /opt/zoom/zoom "zoommtg://zoom.us/join? "
sntentos 20757 0.4 1.6 5003840 533296 ? Sl Μάι07 25:32 /opt/zoom/zoom zoommtg://zoom.us/join?
Hi, May I know the app name. Sorry I couldn't find it using the command name.
Until we fix the problem you can try this solution.
- Open that application and a terminal
- Enter
xprop WM_CLASSin terminal, hit enter and click on that application window - It will print the window class of that app (For example I got
WM_CLASS(STRING) = "Navigator", "Firefox"for Firefox) - Add the window class to always interrupt in
Do Not Disturbpreference.
@slgobinath The application name is Zoom (https://zoom.us/)
WM_CLASS(STRING) = "zoom", "zoom"
... and it's already in the configuration :confused:

Of course, I have no idea how they are implementing Full Screen :confused: I always keep it to be Full Screen, but, depending on sharing status etc, it is possible that the application goes to "windowed mode" (but still covers a high monitor percentile) and/or maximized mode.
I still keep in topmost on the active monitor, most of the time
Further question: would that configuration be correct also?

(The issue is still active for me obviously)
You need to separate them by space. I have to change this to comma in the next version.
Why not do both at the same time? They are both "valid" separators since you don't do Window Title as in e.g. Do Not Disturb does not honor "Do Not Interrupt" · Issue #254 · slgobinath/SafeEyes - Google Chrome
A documenting tooltip would be nice on whatever is the final decision.
+1 I will implement is soon.
Could you please help me to test the Zoom application.
- Save the following code as
test.pysomewhere.
import subprocess, time
import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
from gi.repository import GdkX11
print("Switch to the window you want to test and wait for 10 sec...")
time.sleep(10) # Adjust the waiting time in seconds based on your convenient
screen = Gdk.Screen.get_default()
active_window = screen.get_active_window()
if active_window:
active_xid = str(active_window.get_xid())
cmdlist = ['xprop', '-root', '-notype', '-id',
active_xid, 'WM_CLASS', '_NET_WM_STATE']
try:
stdout = subprocess.check_output(cmdlist).decode('utf-8')
except subprocess.CalledProcessError:
print('Error in finding full-screen application')
else:
print(stdout)
- Open Zoom.
- Execute the script from Terminal using
python3 test.py - Switch to Zoom and wait for 10 seconds (
time.sleep(10)is used to give you enough time to switch to Zoom but you may need to wait for at least 10 seconds while having Zoom as the active window) - After 10 seconds, switch to the Terminal and share the output here.
Result:
$ ./safeeyes_iss254_test.py
Switch to the window you want to test and wait for 10 sec...
WM_CLASS = "zoom", "zoom"
_NET_WM_STATE = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_FOCUSED
$
Of course, I think it would reasonable to start filtering by FullScreen windows in "production code" (i.e. somehow query all _NET_WM_STATE = _NET_WM_STATE_FULLSCREEN windows).
That "test code" could be more useful.
and/or this code as a plugin:
def interact(banner=None):
import readline # optional, will allow Up/Down/History in the console
import code, sys
# use exception trick to pick up the current frame
try:
raise None
except:
frame = sys.exc_info()[2].tb_frame.f_back
# evaluate commands in current namespace
namespace = frame.f_globals.copy()
namespace.update(frame.f_locals)
code.interact(banner=banner, local=namespace)
Actually, the test code was from the plugin code. Your output looks good. There should be a logical mistake in my code: https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/plugins/donotdisturb/plugin.py#L41 I will check this today.
Actually, the test code was from the plugin code. Your output looks good. There should be a logical mistake in my code: https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/plugins/donotdisturb/plugin.py#L41 I will check this today.
Of course, I think it would reasonable to start filtering by FullScreen windows in "production code" (i.e. somehow query all _NET_WM_STATE = _NET_WM_STATE_FULLSCREEN windows).
Well ... as I mentioned: Don't get_active_window()!
On a multi-screen environment, I might have one app in fullscreen, and use the rest of the monitors for something else.
I believe the code should check if "there is a visible fullscreen window". Or, at least, if "there is a full screen window that's not minimized" (if it is possible for a fullscreen window to be "minimized")
I'm also using Zoom but never maximize it and only run it when doing calls, so I rewrote the plugin to check for any windows with the given class: https://github.com/toupeira/dotfiles/tree/master/config/safeeyes/plugins/donotdisturb-apps ( (also using libwnck instead of xprop)
Maybe this could be added as a checkbox Only skip breaks for fullscreen windows, though I'm not sure how that would play with the Interrupt these windows regardless of their state option.
Another feature could be matching on window title rather than class, so for Zoom you could only match meeting windows with ^Zoom Meeting ID: .