dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6cfbcb48277529a42575eece4572a8faf82a2776
parent 9bc008d19aed81a431880a47b7d58da28ab6df2b
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Tue,  1 Mar 2022 09:40:17 +0200

Add notification expiration time.

Diffstat:
Mbin/pulseaudio-sink-port-flip | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/bin/pulseaudio-sink-port-flip b/bin/pulseaudio-sink-port-flip @@ -3,6 +3,9 @@ from subprocess import Popen, PIPE +NOTIFICATION_EXPIRATION_TIME = 3000 + + def get_current_active_port() -> str: pactl_list_sinks = Popen(["pactl", "list", "sinks"], stdout=PIPE) @@ -41,6 +44,14 @@ def main() -> None: current_active_port = get_current_active_port() print("New current active port:", current_active_port) + Popen( + [ + "notify-send", + "Pulseaudio Flip", + f"--expire-time={NOTIFICATION_EXPIRATION_TIME}", + f"New current active port: {current_active_port}", + ] + ) if __name__ == "__main__":