1
0
mirror of https://github.com/slgobinath/SafeEyes.git synced 2024-12-27 00:02:36 +01:00

Merge pull request #546 from antoninkriz/patch-1

Correctly detect GNOME in screensaver plugin and in utility.py
This commit is contained in:
deltragon 2024-06-26 15:49:32 +02:00 committed by GitHub
commit bbcae910ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ def __lock_screen_command():
return ['mate-screensaver-command', '--lock'] return ['mate-screensaver-command', '--lock']
elif desktop_session == 'kde' or 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': elif desktop_session == 'kde' or 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true':
return ['qdbus', 'org.freedesktop.ScreenSaver', '/ScreenSaver', 'Lock'] return ['qdbus', 'org.freedesktop.ScreenSaver', '/ScreenSaver', 'Lock']
elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu'): elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu') or desktop_session.startswith('gnome'):
if utility.command_exist('gnome-screensaver-command'): if utility.command_exist('gnome-screensaver-command'):
return ['gnome-screensaver-command', '--lock'] return ['gnome-screensaver-command', '--lock']
# From Gnome 3.8 no gnome-screensaver-command # From Gnome 3.8 no gnome-screensaver-command

View File

@ -274,7 +274,7 @@ def desktop_environment():
env = 'lxde' env = 'lxde'
elif 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': elif 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true':
env = 'kde' env = 'kde'
elif os.environ.get('GNOME_DESKTOP_SESSION_ID'): elif os.environ.get('GNOME_DESKTOP_SESSION_ID') or desktop_session.startswith('gnome'):
env = 'gnome' env = 'gnome'
elif desktop_session.startswith('ubuntu'): elif desktop_session.startswith('ubuntu'):
env = 'unity' env = 'unity'