2022-01-25 04:32:31 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
2020-04-18 19:46:19 +00:00
|
|
|
# Python imports
|
2023-09-18 01:26:11 +00:00
|
|
|
import argparse
|
|
|
|
import faulthandler
|
|
|
|
import traceback
|
2022-01-25 04:32:31 +00:00
|
|
|
from setproctitle import setproctitle
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
2020-04-18 19:46:19 +00:00
|
|
|
# Application imports
|
2023-09-18 01:26:11 +00:00
|
|
|
from __builtins__ import *
|
|
|
|
from app import Application
|
|
|
|
|
|
|
|
|
2020-04-18 19:46:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2023-09-18 01:26:11 +00:00
|
|
|
''' Set process title, get arguments, and create GTK main thread. '''
|
2022-01-25 04:32:31 +00:00
|
|
|
|
2023-09-18 01:26:11 +00:00
|
|
|
try:
|
|
|
|
setproctitle(f'{app_name}')
|
2022-01-25 04:32:31 +00:00
|
|
|
faulthandler.enable() # For better debug info
|
2023-09-18 01:26:11 +00:00
|
|
|
|
2020-04-18 19:46:19 +00:00
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
# Add long and short arguments
|
2023-09-18 01:26:11 +00:00
|
|
|
parser.add_argument("--theme", "-t", default="default", help="Set the theme. Options [orange, red, purple, green].")
|
|
|
|
parser.add_argument("--debug", "-d", default="false", help="Do extra console messaging.")
|
|
|
|
parser.add_argument("--trace-debug", "-td", default="false", help="Disable saves, ignore IPC lock, do extra console messaging.")
|
2020-04-18 19:46:19 +00:00
|
|
|
|
|
|
|
# Read arguments (If any...)
|
2022-01-25 04:32:31 +00:00
|
|
|
args, unknownargs = parser.parse_known_args()
|
|
|
|
|
2023-09-18 01:26:11 +00:00
|
|
|
if args.debug == "true":
|
|
|
|
settings_manager.set_debug(True)
|
|
|
|
|
|
|
|
if args.trace_debug == "true":
|
|
|
|
settings_manager.set_trace_debug(True)
|
|
|
|
|
|
|
|
Application(args, unknownargs)
|
2020-04-18 19:46:19 +00:00
|
|
|
except Exception as e:
|
2022-01-25 04:32:31 +00:00
|
|
|
traceback.print_exc()
|
|
|
|
quit()
|