This commit is contained in:
2024-10-18 22:19:09 +02:00
parent a850f644de
commit ece099b6a4
11 changed files with 1056 additions and 229 deletions

View File

@@ -1,10 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ $TERM == screen* ]] ; then
if [[ $TERM == screen* || $TERM == tmux* ]] ; then
printf "\033Ptmux;\033\033]"
else
printf "\033]"
@@ -13,7 +13,7 @@ function print_osc() {
# More of the tmux workaround described above.
function print_st() {
if [[ $TERM == screen* ]] ; then
if [[ $TERM == screen* || $TERM == tmux* ]] ; then
printf "\a\033\\"
else
printf "\a"
@@ -26,6 +26,8 @@ function show_help() {
echo " Begin bouncing the dock icon if another app is active" 1>& 2
echo " $(basename $0) stop" 1>& 2
echo " Stop bouncing the dock icon if another app is active" 1>& 2
echo " $(basename $0) once" 1>& 2
echo " Bounce the dock icon once if another app is active" 1>& 2
echo " $(basename $0) fireworks" 1>& 2
echo " Show an explosion animation at the cursor" 1>& 2
}
@@ -42,6 +44,12 @@ function stop_bounce() {
print_st
}
function bounce_once() {
print_osc
printf "1337;RequestAttention=once"
print_st
}
function fireworks() {
print_osc
printf "1337;RequestAttention=fireworks"
@@ -61,6 +69,9 @@ then
elif [[ $1 == stop ]]
then
stop_bounce
elif [[ $1 == once ]]
then
bounce_once
elif [[ $1 == fireworks ]]
then
fireworks