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,13 +268,7 @@ 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 on_delete_window(self, *args):
|
def get_infos(self):
|
||||||
"""Event to quit app."""
|
|
||||||
self.save_preferences()
|
|
||||||
Gtk.main_quit(*args)
|
|
||||||
|
|
||||||
|
|
||||||
def get_infos():
|
|
||||||
"""Get informations about user's system.
|
"""Get informations about user's system.
|
||||||
:return: informations about user's system
|
:return: informations about user's system
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
|
@ -283,9 +278,14 @@ def get_infos():
|
||||||
infos["codename"] = lsb.get("CODENAME", None)
|
infos["codename"] = lsb.get("CODENAME", None)
|
||||||
infos["release"] = lsb.get("RELEASE", None)
|
infos["release"] = lsb.get("RELEASE", None)
|
||||||
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
|
||||||
infos["live"] = os.path.exists("/run/miso/bootmnt/manjaro")
|
infos["live"] = os.path.exists(self.live_path)
|
||||||
return infos
|
return infos
|
||||||
|
|
||||||
|
def on_delete_window(self, *args):
|
||||||
|
"""Event to quit app."""
|
||||||
|
self.save_preferences()
|
||||||
|
Gtk.main_quit(*args)
|
||||||
|
|
||||||
|
|
||||||
def get_lsb_infos():
|
def get_lsb_infos():
|
||||||
"""Read informations from the lsb-release file.
|
"""Read informations from the lsb-release file.
|
||||||
|
|
Loading…
Reference in New Issue