]> git.rmz.io Git - dotfiles.git/blobdiff - bin/clean-hunspell
add clean-hunspell script
[dotfiles.git] / bin / clean-hunspell
diff --git a/bin/clean-hunspell b/bin/clean-hunspell
new file mode 100755 (executable)
index 0000000..625e4c3
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# make sure to only remove symlinks and unneeded dicts
+keep_dicts=('de_DE' 'fr_FR' 'en_US' 'en_GB')
+dicts="$(ls /usr/share/hunspell/* /usr/share/myspell/dicts/*)"
+
+for keep_dict in ${keep_dicts[@]}; do
+    dicts=$(echo $dicts | sed  "s/\S*${keep_dict}\S* //g")
+done
+
+sudo rm ${dicts[@]}