diff options
author | Guillermo Ramos | 2024-03-19 18:42:16 +0100 |
---|---|---|
committer | Guillermo Ramos | 2024-03-19 18:42:16 +0100 |
commit | 093ef9ec9c0b7a95f756bab33299dada50d087f4 (patch) | |
tree | e384b300beb2ba55b0db6291c0daf567cb543af0 | |
parent | a412ce9c78cddd4f8438adaac89eac81024a3a2e (diff) | |
download | cli-093ef9ec9c0b7a95f756bab33299dada50d087f4.tar.gz |
cycle_pa_sinks: notify-send if not tty
-rwxr-xr-x | cycle_pa_sinks | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cycle_pa_sinks b/cycle_pa_sinks index 63c8a48..c9e8d31 100755 --- a/cycle_pa_sinks +++ b/cycle_pa_sinks @@ -10,5 +10,10 @@ new_sink=$(pacmd list-sinks | awk '/index/{print; i=1} i&&/device.product.name/{ new_sink_idx=$(echo "$new_sink" | head -n1 | cut -c12-) new_sink_name=$(echo "$new_sink" | tail -n1 | cut -f2 -d'"') -echo "Setting default sink to: #$new_sink_idx ($new_sink_name)"; +msg="Setting default sink to: #$new_sink_idx ($new_sink_name)" +if [ -t 0 ]; then + echo "$msg" +else + notify-send -u low -t 2000 "$msg" +fi pacmd set-default-sink $new_sink_idx |