def suspend_screensaver():
    """suspend linux screensaver"""
proc = subprocess.Popen(
    'gsettings set org.gnome.desktop.screensaver idle-activation-enabled false'
    , shell=True)
proc.wait()

def resume_screensaver():
    """resume linux screensaver"""
proc = subprocess.Popen(
    'gsettings set org.gnome.desktop.screensaver idle-activation-enabled true',
    shell=True)
proc.wait()
Запретить заставку с помощью Python