Last active
September 27, 2023 01:48
-
-
Save syneart/aa8f2f27a103a7f1e1812329fa192e65 to your computer and use it in GitHub Desktop.
Default start caffeine in active mode (patch for caffeine-indicator 2.9.4 [https://launchpad.net/caffeine])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27a28 | |
> import subprocess | |
64,68d64 | |
< # Handle command line arguments | |
< parser = argparse.ArgumentParser(prog=PROGRAM_NAME, description='Toggle desktop idleness inhibition') | |
< parser.add_argument('-V', '--version', action='version', version=PROGRAM_NAME + ' ' + VERSION) | |
< parser.parse_args() | |
< | |
179d174 | |
< | |
187a183,195 | |
> | |
> # Handle command line arguments | |
> parser = argparse.ArgumentParser(prog=PROGRAM_NAME, description='Toggle desktop idleness inhibition') | |
> parser.add_argument('-V', '--version', action='version', version=PROGRAM_NAME + ' ' + VERSION) | |
> parser.add_argument('-D', '--inactive', action="store_true", dest='inactive', help='Inactive desktop idleness inhibition') | |
> args = parser.parse_args() | |
> | |
> if (args.inactive): | |
> subprocess.call(["pkill", "-SIGINT", "caffeine"]) | |
> sys.exit(1) | |
> | |
> caffeine.toggle_activated() | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm glad you found the results you were looking for ~