diff --git a/README.md b/README.md index 528e81b..8d90450 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Run it simply with, or preferably put it to run on boot as: ``` $ eyestrainreminder ``` -Or to remove: +Optional parameters can be viewed through "$ eyestrainreminder -h", but let you mute the notification sound, turn off notifications by default and invert the tray icon colors. +In order to remove it, just run: ``` pip uninstall EyeStrainReminder ``` \ No newline at end of file diff --git a/eyestrainreminder/__main__.py b/eyestrainreminder/EyeStrainReminder.py similarity index 81% rename from eyestrainreminder/__main__.py rename to eyestrainreminder/EyeStrainReminder.py index 9150244..78f49e9 100755 --- a/eyestrainreminder/__main__.py +++ b/eyestrainreminder/EyeStrainReminder.py @@ -18,9 +18,9 @@ MINUTE = 60 DIR = os.path.dirname(os.path.abspath(__file__)) icon = None -mute = False -disable_notifications = False -invert_icons = False +#mute = False +#disable_notifications = False +#invert_icons = False notify_thread = None def init(): @@ -96,6 +96,15 @@ def play_sound(): if not mute: playsound(f"{DIR}/files/default.wav") +def parse_args(): + + parser = argparse.ArgumentParser() + parser.add_argument("-m", "--mute", action="store_true", default=False, help="Mute notification sounds by default") + parser.add_argument("-n", "--disable_notifications", action="store_true", default=False, help="Disable notifications by default") + parser.add_argument("-i", "--invert_icons", action="store_true", default=False, help="Default to the dark icon for light themes") + args = parser.parse_args() + globals().update(args.__dict__) + def main(): init() while 1: @@ -104,6 +113,7 @@ def main(): uninit() if __name__ == '__main__': + parse_args() notify_thread = threading.Thread(target=main, name="Notify Thread") notify_thread.start() create_tray_icon() diff --git a/eyestrainreminder/__init__.py b/eyestrainreminder/__init__.py index 9833a09..2410f58 100644 --- a/eyestrainreminder/__init__.py +++ b/eyestrainreminder/__init__.py @@ -1 +1 @@ -from .__main__ import * \ No newline at end of file +from .EyeStrainReminder import * \ No newline at end of file