chiark / gitweb /
bin/disorder-notify, dot/e16-bindings: Escape HTMLish stuff in notifications.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jul 2018 00:05:25 +0000 (01:05 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 26 Jul 2018 00:05:25 +0000 (01:05 +0100)
The documentation I found didn't obviously mention that this text was
HTMLish.  Oh, well.

bin/disorder-notify
dot/e16-bindings

index e530cc35701a4bfd2f005b57ed5b5eadf4b167a0..e801d3d4290d3026d2f044621ada5e9fe14336bc 100755 (executable)
@@ -3,6 +3,9 @@
 sub notify ($$) {
   my ($head, $body) = @_;
 
+  $body =~ s:\&:&amp;:g;
+  $body =~ s:\<:&lt;:g;
+  $body =~ s:\>:&gt;:g;
   my $kid = fork;
   defined $kid or return;
   if (!$kid) {
index 064a3c34113c7e918a2ccb6cc9662756cb796ece..2250e4830cbdb1f70c54e4924f578304083bfaca 100644 (file)
@@ -65,7 +65,7 @@ KeyDown   C5 apostrophe exec xinitcmd disobedience
 KeyDown   C5     plus exec media-keys volume-up
 KeyDown   C5    minus exec media-keys volume-down
 KeyDown   C5   period exec media-keys enable/disable
-KeyDown   C5    comma exec gdbus call -e -d org.freedesktop.Notifications -o /org/freedesktop/Notifications -m org.freedesktop.Notifications.Notify -- DisOrder 0 audio-volume-high "Now playing" "$(media-keys now-playing)" "[]" "{}" 5000
+KeyDown   C5    comma exec gdbus call -e -d org.freedesktop.Notifications -o /org/freedesktop/Notifications -m org.freedesktop.Notifications.Notify -- DisOrder 0 audio-volume-high "Now playing" "$(media-keys now-playing | sed 's:&:&amp;:g; s:<:&lt;:g; s:>:&gt;:g')" "[]" "{}" 5000
 KeyDown   C5    slash exec media-keys scratch
 KeyDown   C5    space exec media-keys play/pause
 KeyDown   C5       F1 menus show file.menu