added click cli options
This commit is contained in:
parent
df74472937
commit
153665883f
@ -6,17 +6,19 @@ Copyright (C) 2025 Fredrick W. Warren
|
|||||||
Licensed under the GNU General Public License.
|
Licensed under the GNU General Public License.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import click
|
||||||
from wmdocklib import wmoo as wmoo
|
|
||||||
import dbus
|
import dbus
|
||||||
import dbus.mainloop.glib
|
import dbus.mainloop.glib
|
||||||
from gi.repository import GLib
|
import logging
|
||||||
import threading
|
|
||||||
import os
|
import os
|
||||||
|
import threading
|
||||||
|
from gi.repository import GLib
|
||||||
from icecream import ic
|
from icecream import ic
|
||||||
|
from wmdocklib import wmoo as wmoo
|
||||||
from xpm_resources import palette, background, patterns
|
from xpm_resources import palette, background, patterns
|
||||||
|
|
||||||
line_height = 9
|
line_height = 9
|
||||||
|
config_file = os.path.expanduser("~/.config") + '/pywmreceived/config.ini'
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -237,13 +239,16 @@ def run_glib_mainloop():
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
loop.quit()
|
loop.quit()
|
||||||
|
|
||||||
def main():
|
@click.command()
|
||||||
|
@click.option('--config', '-c', default=config_file, help='Path to the configuration file.')
|
||||||
|
@click.option('--debug/-d', envvar='DEVELOPMENT', default='false', help='Enable debug output')
|
||||||
|
def main(config, debug):
|
||||||
"""
|
"""
|
||||||
The main entry point of the application.
|
The main entry point of the application.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
"""
|
"""
|
||||||
if os.environ.get("PRODUCTION") == "true":
|
if not debug:
|
||||||
ic.disable()
|
ic.disable()
|
||||||
|
|
||||||
app = Application(font_name='5x8',
|
app = Application(font_name='5x8',
|
||||||
|
Loading…
Reference in New Issue
Block a user