Skip to content

Instantly share code, notes, and snippets.

@m0rb
Created October 1, 2017 17:38
Show Gist options
  • Save m0rb/cc0794ae399a3fdae291c2c2cf1d078e to your computer and use it in GitHub Desktop.
Save m0rb/cc0794ae399a3fdae291c2c2cf1d078e to your computer and use it in GitHub Desktop.
oysttyer -- bell on notification
-- a/oysttyer.pl
+++ b/oysttyer.pl
@@ -56,7 +56,7 @@
$padded_patch_version = substr($oysttyer_PATCH_VERSION . " ", 0, 2);
%opts_boolean = map { $_ => 1 } qw(
- ansi noansi verbose superverbose oysttyeristas noprompt
+ ansi noansi bell verbose superverbose oysttyeristas noprompt
seven silent hold daemon script anonymous readline ssl
newline vcheck verify noratelimit notrack nonewrts notimeline
synch exception_is_maskable mentions simplestart
@@ -64,7 +64,7 @@
signals_use_posix dostream nostreamreplies streamallreplies
nofilter showusername largeimages origimages doublespace extended
); %opts_sync = map { $_ => 1 } qw(
- ansi pause dmpause oysttyeristas verbose superverbose
+ ansi bell pause dmpause oysttyeristas verbose superverbose
url rlurl dmurl newline wrap notimeline lists dmidurl
queryurl track colourprompt colourme notrack
colourdm colourreply colourwarn coloursearch colourlist idurl
@@ -93,7 +93,7 @@
);
%opts_can_set = map { $_ => 1 } qw(
- url pause dmurl dmpause superverbose ansi verbose
+ url pause dmurl dmpause superverbose ansi bell verbose
update uurl rurl wurl avatar oysttyeristas frurl track
rlurl noprompt shorturl newline wrap verify autosplit
notimeline queryurl colourprompt colourme
@@ -767,6 +767,7 @@
$ansi = ($noansi) ? 0 :
(($ansi || $ENV{'TERM'} eq 'ansi' || $ENV{'TERM'} eq 'xterm-color')
? 1 : 0);
+$bell ||= 0;
$showusername ||= 0;
$largeimages ||= 0;
$origimages ||= 0;
@@ -5829,6 +5830,7 @@
my $nocolour = shift;
my $g = '>>> ';
+ if ($bell) { $g .= "\x07"; };
my $verb = &descape($ref->{'event'});
# https://dev.twitter.com/docs/streaming-apis/messages
@@ -7307,7 +7309,9 @@
$BLUE = ($ansi) ? "${ESC}[34;1m" : '';
$RED = ($ansi) ? "${ESC}[31;1m" : '';
+ $RED .= ($bell) ? "\x07" : '' ;
$GREEN = ($ansi) ? "${ESC}[32;1m" : '';
+ $GREEN .= ($bell) ? "\x07" : '' ;
$YELLOW = ($ansi) ? "${ESC}[33m" : '';
$MAGENTA = ($ansi) ? "${ESC}[35m" : '';
$CYAN = ($ansi) ? "${ESC}[36m" : '';
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment