Skip to content

Commit

Permalink
feat:add sound feedback (#22)
Browse files Browse the repository at this point in the history
play short sound when opening or closing apps to acknowledge the action audibly, a dialog would be too verbose for a nearly instant action
  • Loading branch information
JarbasAl authored Oct 17, 2024
1 parent bcbf9d9 commit 33b0bc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def launch_app(self, app: str) -> bool:
try:
# Launch the application in a new process without blocking
subprocess.Popen(shlex.split(cmd), shell=self.settings.get("shell", False))
self.acknowledge()
return True
except Exception as e:
LOG.error(f"Failed to launch {app}: {e}")
Expand Down Expand Up @@ -152,6 +153,7 @@ def close_by_window(self, app: str) -> bool:
if not self.settings.get("terminate_all", False):
break

self.acknowledge()
return True

def match_process(self, app: str) -> Iterable[psutil.Process]:
Expand Down Expand Up @@ -190,6 +192,7 @@ def close_by_process(self, app: str) -> bool:
LOG.error(f"Failed to terminate {proc}")

if terminated:
self.acknowledge()
LOG.debug(f"Terminated PIDs: {terminated}")
return True
return False
Expand Down

0 comments on commit 33b0bc4

Please sign in to comment.