3
# notify_osd: perform some string manipulation on notify-osd messages
4
# and then send to the screen message window
5
# Copyright (C) 2010 Canonical Ltd.
7
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
8
# with help from Mathias Gug <mathias.gug@canonical.com>
10
# This program is free software: you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
# the Free Software Foundation, version 3 of the License.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
26
# Ensure that the notify_osd indicator is enabled
28
open(F, "<$ENV{BYOBU_CONFIG_DIR}/status");
30
if ($i =~ /notify_osd=0/) {
39
$msg =~ s/\[[^,]*, //; # strip the leading "[timestamp, "
40
$msg =~ s/\] /: /; # replace the " ] " following the indicator name, with ":"
41
$msg =~ s/\s+/ /g; # collapse multi-whitespace into one
42
$msg =~ s/\s+$//g; # strip trailing whitespace
43
$msg =~ s/^\s+//g; # strip leading whitespace
44
system("/usr/bin/screen", "-X", "-S", "$ARGV[0]", "at", "*", "msgwait", "$sleep");
45
system("/usr/bin/screen", "-X", "-S", "$ARGV[0]", "at", "*", "echo", "[$msg]");
47
system("/usr/bin/screen", "-X", "-S", "$ARGV[0]", "at", "*", "msgwait", "0");