From 708b4aa2b6deb5ebacf45f43d9d13aa7bbe4a35b Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 18 Jan 2016 09:22:03 +1100 Subject: [PATCH] demlo: Add 'humour.lua' --- .config/demlo/demlorc | 2 +- .config/demlo/scripts/const.lua | 15 ++++++++++----- .config/demlo/scripts/humour.lua | 11 +++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .config/demlo/scripts/humour.lua diff --git a/.config/demlo/demlorc b/.config/demlo/demlorc index 07eb219f..0a18a024 100644 --- a/.config/demlo/demlorc +++ b/.config/demlo/demlorc @@ -31,4 +31,4 @@ removesource = false -- Scripts to run by default. -- Order matters, e.g. 'path' can be influenced by the modifications made by 'tag'. -scripts = {'const', 'tag', 'sub', 'case', 'punctuation', 'encoding', 'flac2ogg', 'path', 'cover'} +scripts = {'const', 'tag', 'sub', 'case', 'punctuation', 'encoding', 'flac2ogg', 'humour', 'path', 'cover'} diff --git a/.config/demlo/scripts/const.lua b/.config/demlo/scripts/const.lua index c1ee6a31..5a9d9d35 100644 --- a/.config/demlo/scripts/const.lua +++ b/.config/demlo/scripts/const.lua @@ -22,16 +22,21 @@ const_custom = { "d'Acide", --French - 'contre', - 'entre', + 'avec', 'chez', 'dans', - 'sur', + 'de', + 'des', + 'du', + 'le', + 'la', + 'les', 'que', 'qui', 'quoi', - 'comment', - 'quand', + 'sur', + 'un', + 'une', -- German 'der', diff --git a/.config/demlo/scripts/humour.lua b/.config/demlo/scripts/humour.lua new file mode 100644 index 00000000..c8cfc68d --- /dev/null +++ b/.config/demlo/scripts/humour.lua @@ -0,0 +1,11 @@ +-- Output 'humour' genre to a separate library. +-- Run before 'path'. + +local ossep = osseperator or '/' + +local genre = o.genre and o.genre:lower():gsub([[\s]],'_') +if genre and genre == 'humour' then + library = os.getenv('HOME') .. ossep .. 'humour' +else + library = os.getenv('HOME') .. ossep .. 'music' +end