def get_shell_version():
    try:
        for line in subprocess.check_output(['gnome-shell', '--version']).decode().splitlines():
            m = fullmatch('GNOME Shell (?P<version>[0-9.]+)', line)
            if m:
                return m.group('version')
    except BaseException:
        print('Warning, cannot retrieve current Gnome Shell version', file=sys.stderr)
def get_shell_version():
    try:
        for line in subprocess.check_output(['gnome-shell', '--version']).decode().splitlines():
            m = fullmatch('GNOME Shell (?P<version>[0-9.]+)', line)
            if m:
                return m.group('version')
    except BaseException:
        print('Warning, cannot retrieve current Gnome Shell version', file=sys.stderr)