| #!${{pkgs.python3}}/bin/python3 |
| device_argument = "--default-source" if "-i" in args else "" |
| control_argument += "-i" if "-u" in args else "" |
| control_argument += "-d" if "-d" in args else "" |
| control_argument += "-t" if "-m" in args else " 5" |
| f"${{pkgs.pamixer}}/bin/pamixer {device_argument} {control_argument} --set-limit 150" |
| if subprocess.getoutput(f"${{pkgs.pamixer}}/bin/pamixer {device_argument} --get-mute") |
| volume = subprocess.getoutput(f"${{pkgs.pamixer}}/bin/pamixer {device_argument} --get-volume") |
| socket_path = f"{os.environ['XDG_RUNTIME_DIR']}/xob.sock" |
| with open(socket_path, "w") as socket: |
| socket.write(f"{volume}{mute_char}\n") |