summaryrefslogtreecommitdiff
path: root/hel
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-10-02 23:20:23 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-10-02 23:20:23 +0200
commit81d1878ff325f0a41fc34fdaa4005e5b3ab48407 (patch)
treee54980d3a1a276d1e51f23e0a26ad0979987d629 /hel
parente2a6413ae8151c6415b8baa01abac95381d7e5d7 (diff)
downloadnixos-81d1878ff325f0a41fc34fdaa4005e5b3ab48407.tar
nixos-81d1878ff325f0a41fc34fdaa4005e5b3ab48407.tar.gz
nixos-81d1878ff325f0a41fc34fdaa4005e5b3ab48407.tar.bz2
nixos-81d1878ff325f0a41fc34fdaa4005e5b3ab48407.tar.xz
nixos-81d1878ff325f0a41fc34fdaa4005e5b3ab48407.zip
extract title for notification
Diffstat (limited to 'hel')
-rw-r--r--hel/recv-media.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/hel/recv-media.nix b/hel/recv-media.nix
index 9cc7b014..06483cdf 100644
--- a/hel/recv-media.nix
+++ b/hel/recv-media.nix
@@ -1,4 +1,4 @@
1{ stdenv, coreutils, writeScriptBin, eject }: 1{ stdenv, coreutils, writeScriptBin, eject, ffmpeg }:
2 2
3writeScriptBin "recv-media" '' 3writeScriptBin "recv-media" ''
4 #!${stdenv.shell} 4 #!${stdenv.shell}
@@ -23,5 +23,9 @@ writeScriptBin "recv-media" ''
23 touch -c -m -t "$2" "''${target}" 23 touch -c -m -t "$2" "''${target}"
24 fi 24 fi
25 25
26 printf "%s\n%s\n" $(basename "$1") "" | /var/setuid-wrappers/notify-gkleen -a recv-media || true 26 (
27 title=$(${ffmpeg}/bin/ffmpeg -i "''${target}" -f ffmetadata 2>/dev/null | sed -r '/^title=/!d; s/^title=//')
28 [[ -z "''${title}" ]] && title=$(basename "$1")
29 printf "%s\n%s\n" "''${title}" "" | /var/setuid-wrappers/notify-gkleen -a recv-media || true
30 ) || true
27'' 31''