同じ必要性(または好奇心)を持つ他の人を助けるのは私の答えではありませんが(私の上司が解決策を提供してくれました)、これにも答える可能性があります。 
tl; dr:D-Busを使用して、ロック画面のアクティブ/非アクティブ信号を取得します。
そうですD-バスメッセージングが広くGNOMEアプリケーションによってサポートされている、とスクリーンセーバーアプリは、特に、と思われるGNOME-スクリーンセーバーアプリが Gnomeのシェルの公式のロックアプリです。
そのため、テストするには、dbus-monitorを実行して応答を取得するだけです。
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'"
このアクティビティをファイルに記録するための小さなpythonスクリプトを作成しました。
#!/usr/bin/env python
from datetime import datetime
import os
import pwd
import subprocess
import time
LOG_FILE = os.path.expanduser('~/hours_log.csv')
cmd = subprocess.Popen(["dbus-monitor \"type='signal',interface="
                        "'org.gnome.ScreenSaver'\""], shell=True,
                       stdout=subprocess.PIPE)
running = 0
while 1:
    time.sleep(0.1)
    if running:
        output = cmd.stdout.readline()
        status = 'unlocked' if 'true' in output else 'locked'
        new_line = "{time} {user} {status} the screen\n".format(
            time=datetime.now().ctime(),
            user=pwd.getpwuid(os.getuid())[0],
            status=status
        )
        with open(LOG_FILE, 'a') as f:
            f.write(new_line)
        running = 0
    line = cmd.stdout.readline()
    if "ActiveChange" in line and 'org.gnome.ScreenSaver' in line:
        running = 1
               
              
.shファイルに入れて、Gnomeのスタートアップアプリケーションに追加しました。缶に書かれていることを実行するthx