Skip to content

Instantly share code, notes, and snippets.

@ivanrad
Created July 19, 2022 23:09
Show Gist options
  • Save ivanrad/6b152f874c192d33fdf5f4d865ada04e to your computer and use it in GitHub Desktop.
Save ivanrad/6b152f874c192d33fdf5f4d865ada04e to your computer and use it in GitHub Desktop.
growl style notifications using OSC 9
#!/usr/bin/env bash
if [ $# == 0 ]; then
msg=$(cat -)
else
msg="$@"
fi
if [ -n "$TMUX" ]; then
client_tty=$(tmux display-message -p '#{client_tty}')
printf $'\e]9;%s\a' "${msg}" > $client_tty
else
printf $'\e]9;%s\a' "${msg}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment