Add a live path var
parent
4975a88f73
commit
4b058266a2
|
@ -40,10 +40,11 @@ class ManjaroHello():
|
||||||
self.preferences_path = self.config_path + self.app + ".json"
|
self.preferences_path = self.config_path + self.app + ".json"
|
||||||
self.urls_path = self.data_path + "urls.json"
|
self.urls_path = self.data_path + "urls.json"
|
||||||
self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop"
|
self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop"
|
||||||
|
self.live_path = "/run/miso/bootmnt/manjaro"
|
||||||
|
|
||||||
# Load important vars
|
# Load important vars
|
||||||
self.preferences = self.get_preferences()
|
self.preferences = self.get_preferences()
|
||||||
self.infos = get_infos()
|
self.infos = self.get_infos()
|
||||||
self.urls = read_json(self.urls_path)
|
self.urls = read_json(self.urls_path)
|
||||||
|
|
||||||
# Init window
|
# Init window
|
||||||
|
@ -267,26 +268,25 @@ class ManjaroHello():
|
||||||
"""Event for clicked link."""
|
"""Event for clicked link."""
|
||||||
webbrowser.open_new_tab(self.urls[link.get_name()])
|
webbrowser.open_new_tab(self.urls[link.get_name()])
|
||||||
|
|
||||||
|
def get_infos(self):
|
||||||
|
"""Get informations about user's system.
|
||||||
|
:return: informations about user's system
|
||||||
|
:rtype: dict
|
||||||
|
"""
|
||||||
|
lsb = get_lsb_infos()
|
||||||
|
infos = {}
|
||||||
|
infos["codename"] = lsb.get("CODENAME", None)
|
||||||
|
infos["release"] = lsb.get("RELEASE", None)
|
||||||
|
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
||||||
|
infos["live"] = os.path.exists(self.live_path)
|
||||||
|
return infos
|
||||||
|
|
||||||
def on_delete_window(self, *args):
|
def on_delete_window(self, *args):
|
||||||
"""Event to quit app."""
|
"""Event to quit app."""
|
||||||
self.save_preferences()
|
self.save_preferences()
|
||||||
Gtk.main_quit(*args)
|
Gtk.main_quit(*args)
|
||||||
|
|
||||||
|
|
||||||
def get_infos():
|
|
||||||
"""Get informations about user's system.
|
|
||||||
:return: informations about user's system
|
|
||||||
:rtype: dict
|
|
||||||
"""
|
|
||||||
lsb = get_lsb_infos()
|
|
||||||
infos = {}
|
|
||||||
infos["codename"] = lsb.get("CODENAME", None)
|
|
||||||
infos["release"] = lsb.get("RELEASE", None)
|
|
||||||
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
|
||||||
infos["live"] = os.path.exists("/run/miso/bootmnt/manjaro")
|
|
||||||
return infos
|
|
||||||
|
|
||||||
|
|
||||||
def get_lsb_infos():
|
def get_lsb_infos():
|
||||||
"""Read informations from the lsb-release file.
|
"""Read informations from the lsb-release file.
|
||||||
:return: args from lsb-release file
|
:return: args from lsb-release file
|
||||||
|
|
Loading…
Reference in New Issue