aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2020-09-23 22:06:27 +0500
committerAnton Bobov <abobov@gmail.com>2020-09-25 16:57:17 +0500
commit9784c2e0469e7c8619cacbfb14249288763bba87 (patch)
tree792ca7dac03072529ea89908adc228b7d022346e /files
parent7494421ec6281de1ee7d327601223537b325a7a1 (diff)
Updates.
Diffstat (limited to 'files')
-rw-r--r--files/.config/beets/config.yaml10
-rwxr-xr-xfiles/.task/hooks/on-add-spell-check.py25
2 files changed, 27 insertions, 8 deletions
diff --git a/files/.config/beets/config.yaml b/files/.config/beets/config.yaml
new file mode 100644
index 0000000..437fcc5
--- /dev/null
+++ b/files/.config/beets/config.yaml
@@ -0,0 +1,10 @@
+directory: ~/Music/
+library: ~/Music/beets.db
+plugins: fetchart
+original_date: yes
+
+paths:
+ default: $albumartist/$album ($year)%aunique{}/$track - $title
+
+ui:
+ color: no
diff --git a/files/.task/hooks/on-add-spell-check.py b/files/.task/hooks/on-add-spell-check.py
index 16758f0..6ddb6de 100755
--- a/files/.task/hooks/on-add-spell-check.py
+++ b/files/.task/hooks/on-add-spell-check.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
-from glob import glob
-from os.path import isfile, splitext
import os
import re
import sys
+from glob import glob
+from os.path import isfile, splitext
try:
from hunspell import HunSpell
@@ -12,7 +12,6 @@ except ImportError as e:
print(e)
sys.exit(0)
-
DICT_PATH = '/usr/share/hunspell/'
LANGS = ['en_US', 'ru_RU']
ENV_SKIP = 'TW_IGNORE_SPELL'
@@ -41,10 +40,20 @@ def spellcheck(text):
return errors
+
+def should_run_spellcheck(task):
+ if len(sys.argv) > 1:
+ opts = dict(arg.split(':', 1) for arg in sys.argv[1:])
+ command = opts['command']
+ return command in ['add', 'append', 'log', 'modify', 'prepend']
+ return False
+
+
task = Task.from_input()
-errors = spellcheck(task['description'])
-if len(errors) > 0:
- print('Spell errors:', ', '.join(errors))
- if not ENV_SKIP in os.environ:
- sys.exit(1)
+if should_run_spellcheck(task):
+ errors = spellcheck(task['description'])
+ if len(errors) > 0:
+ print('Spell errors:', ', '.join(errors))
+ if not ENV_SKIP in os.environ:
+ sys.exit(1)
print(task.export_data())