diff options
| author | Anton Bobov <abobov@gmail.com> | 2020-09-23 22:06:27 +0500 |
|---|---|---|
| committer | Anton Bobov <abobov@gmail.com> | 2020-09-25 16:57:17 +0500 |
| commit | 9784c2e0469e7c8619cacbfb14249288763bba87 (patch) | |
| tree | 792ca7dac03072529ea89908adc228b7d022346e | |
| parent | 7494421ec6281de1ee7d327601223537b325a7a1 (diff) | |
Updates.
| -rwxr-xr-x | .gitignore | 2 | ||||
| -rw-r--r-- | files/.config/beets/config.yaml | 10 | ||||
| -rwxr-xr-x | files/.task/hooks/on-add-spell-check.py | 25 | ||||
| -rw-r--r-- | install.conf.yaml | 1 |
4 files changed, 30 insertions, 8 deletions
@@ -22,3 +22,5 @@ /files/.task/* !/files/.task/hooks/ + +/files/.config/beets/state.pickle 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()) diff --git a/install.conf.yaml b/install.conf.yaml index 29316dc..6172994 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -39,6 +39,7 @@ ~/.config/xfce4/terminal: files/.config/xfce4/terminal ~/.config/redshift.conf: files/.config/redshift.conf ~/.config/pgcli: files/.config/pgcli + ~/.config/beets: files/.config/beets - shell: - [git submodule update --init --recursive, Installing submodules] |
