Simplify subtitle by removing not useful infos (version and arch)
They have nothing to do in manjaro-hello.merge-requests/64/head
parent
1aae96bfc2
commit
5202c56d5c
|
@ -5,7 +5,6 @@ import gi
|
||||||
import json
|
import json
|
||||||
import locale
|
import locale
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
import webbrowser
|
import webbrowser
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
|
@ -18,6 +17,8 @@ class ManjaroHello():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# App vars
|
# App vars
|
||||||
self.app = "manjaro-hello"
|
self.app = "manjaro-hello"
|
||||||
|
system = "Manjaro Gellivara"
|
||||||
|
|
||||||
dev = False
|
dev = False
|
||||||
for arg in sys.argv:
|
for arg in sys.argv:
|
||||||
if arg == "--dev":
|
if arg == "--dev":
|
||||||
|
@ -54,19 +55,7 @@ class ManjaroHello():
|
||||||
self.window = self.builder.get_object("window")
|
self.window = self.builder.get_object("window")
|
||||||
|
|
||||||
# Subtitle of headerbar
|
# Subtitle of headerbar
|
||||||
try:
|
self.builder.get_object("headerbar").props.subtitle = system
|
||||||
codename = subprocess.Popen("lsb_release -c", stdout=subprocess.PIPE, shell=True).communicate()
|
|
||||||
codename = codename[0].decode("utf-8")
|
|
||||||
release = subprocess.Popen("lsb_release -r", stdout=subprocess.PIPE, shell=True).communicate()
|
|
||||||
release = release[0].decode("utf-8")
|
|
||||||
if ":" in codename and ":" in release:
|
|
||||||
codename = codename.split(":")[1].strip().capitalize()
|
|
||||||
release = release.split(":")[1].strip()
|
|
||||||
arch = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
|
||||||
subtitle = codename + " " + release + " " + arch
|
|
||||||
self.builder.get_object("headerbar").props.subtitle = subtitle
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Load logo
|
# Load logo
|
||||||
if os.path.isfile(logo_path):
|
if os.path.isfile(logo_path):
|
||||||
|
|
Loading…
Reference in New Issue