Change way to get arch
parent
3aa1432d4c
commit
03d993a28f
|
@ -3,6 +3,7 @@
|
||||||
import locale
|
import locale
|
||||||
import gettext
|
import gettext
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import gi
|
import gi
|
||||||
|
@ -13,6 +14,7 @@ class ManjaroHello():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# App vars
|
# App vars
|
||||||
self.app = "manjaro-hello"
|
self.app = "manjaro-hello"
|
||||||
|
|
||||||
# Path vars
|
# Path vars
|
||||||
config_path = os.path.expanduser("~") + "/.config/"
|
config_path = os.path.expanduser("~") + "/.config/"
|
||||||
#share_path = "/usr/share/"
|
#share_path = "/usr/share/"
|
||||||
|
@ -57,7 +59,9 @@ class ManjaroHello():
|
||||||
self.window = self.builder.get_object("window")
|
self.window = self.builder.get_object("window")
|
||||||
|
|
||||||
# Set window subtitle
|
# Set window subtitle
|
||||||
self.builder.get_object("headerbar").props.subtitle = self.infos["codename"] + " " + self.infos["release"] + " " + self.infos["arch"]
|
if self.infos["codename"] and self.infos["release"]:
|
||||||
|
self.builder.get_object("headerbar").props.subtitle = self.infos["codename"] + " " + self.infos["release"] + " "
|
||||||
|
self.builder.get_object("headerbar").props.subtitle += self.infos["arch"]
|
||||||
|
|
||||||
# Initialize pages
|
# Initialize pages
|
||||||
for page in ("readme", "release", "involved"):
|
for page in ("readme", "release", "involved"):
|
||||||
|
@ -139,9 +143,9 @@ class ManjaroHello():
|
||||||
def get_infos():
|
def get_infos():
|
||||||
lsb = get_lsb_information()
|
lsb = get_lsb_information()
|
||||||
infos = {}
|
infos = {}
|
||||||
infos["codename"] = lsb.get("CODENAME", 0)
|
infos["codename"] = lsb.get("CODENAME", None)
|
||||||
infos["release"] = lsb.get("RELEASE", 0)
|
infos["release"] = lsb.get("RELEASE", None)
|
||||||
infos["arch"] = "64-bit" if os.uname()[4] else "32-bit"
|
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
||||||
infos["live"] = os.path.isfile("/bootmnt/manjaro") or os.path.isfile("/run/miso/bootmnt/manjaro")
|
infos["live"] = os.path.isfile("/bootmnt/manjaro") or os.path.isfile("/run/miso/bootmnt/manjaro")
|
||||||
|
|
||||||
return infos
|
return infos
|
||||||
|
|
Loading…
Reference in New Issue