python-clipboard-speaker

Want your computer to speak a bit? Mark some text and let it rip.
git clone https://kaka.farm/~git/python-clipboard-speaker
Log | Files | Refs | README | LICENSE

clipboard_speaker_kill.py (384B)


      1 #!/usr/bin/env python3
      2 
      3 import os
      4 import pathlib
      5 import signal
      6 
      7 CLIPBOARD_SPEAKER_PATH = pathlib.Path.home() / ".clipboard-speaker"
      8 PID_FILE_PATH = CLIPBOARD_SPEAKER_PATH / "pid"
      9 
     10 
     11 def main() -> None:
     12     with PID_FILE_PATH.open("r") as pid_file:
     13         pid = int(pid_file.read())
     14     os.remove(PID_FILE_PATH)
     15     os.kill(pid, signal.SIGTERM)
     16 
     17 
     18 if __name__ == "__main__":
     19     main()