From 9784c2e0469e7c8619cacbfb14249288763bba87 Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Wed, 23 Sep 2020 22:06:27 +0500 Subject: Updates. --- .gitignore | 2 ++ files/.config/beets/config.yaml | 10 ++++++++++ files/.task/hooks/on-add-spell-check.py | 25 +++++++++++++++++-------- install.conf.yaml | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 files/.config/beets/config.yaml diff --git a/.gitignore b/.gitignore index 65af2e5..ee16968 100755 --- a/.gitignore +++ b/.gitignore @@ -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] -- cgit v1.2.3