File: source_gnome-shell.py

package info (click to toggle)
gnome-shell 3.22.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,968 kB
  • ctags: 6,979
  • sloc: ansic: 43,851; sh: 4,729; xml: 959; makefile: 719; cpp: 58; python: 35; sed: 16; perl: 13
file content (27 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from apport.hookutils import *
import os

def is_process_running(proc):
    '''
    Determine if process has a registered process id
    '''
    log = command_output(['pidof', proc])
    if not log or log[:5] == "Error" or len(log)<1:
        return False
    return True

def add_info(report):
    attach_gsettings_package(report, 'gnome-shell-common')
    attach_gsettings_schema(report, 'org.gnome.desktop.interface')

    result = ''

    dm_list = apport.hookutils.command_output(['sh', '-c', 
	'apt-cache search \"display manager\" | cut -d \' \' -f1 | grep -E \"dm$|gdm3\"'])

    for line in dm_list.split('\n'):
        if (is_process_running(line)):
            result = line
            break

    report['DisplayManager'] = result