ptymsg 539 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # Copyright ©2017-2023 Jason Trunks
  3. # https://notabug.org/JasKinasis/cmus-scripts
  4. # Send a message to all pty's
  5. # This was something I was considering using alongside nowplay and statustty
  6. # But this sends the message to all open tty's, including the one running cmus
  7. # and vim etc.. XD
  8. # 2020-07-06 - NOTE: pty's don't seem to be used in Debian any-more, so this script no longer works.
  9. if [[ $# == 1 ]]; then
  10. ptys="$(ls /dev | \grep pty)"
  11. for line in $(echo -e "$ptys")
  12. do
  13. echo "$1" > "/dev/$line"
  14. done
  15. fi