refactor: nixify / clean remaining dots scripts
This commit is contained in:
1 parent
9030f33842
commit
9110789527
53 files changed
+265
-655
No files matched your search
Executable
+28
@@ -0,0 +1,28 @@
|
||||
fn="/tmp/fontnames.txt"
|
||||
|
||||
contains_dash() {
|
||||
[[ "$1" =~ - ]]
|
||||
}
|
||||
|
||||
update() {
|
||||
: > "$fn"
|
||||
|
||||
font_list=$(fc-list -f "%{fullname}\n")
|
||||
|
||||
echo "$font_list" | while read -r line ; do
|
||||
|
||||
first="$(echo "$line" | cut -d',' -f1)"
|
||||
last="$(echo "$line" | cut -d',' -f2)"
|
||||
|
||||
if contains_dash "$first"; then
|
||||
echo "$last" >> "$fn"
|
||||
else
|
||||
echo "$first" >> "$fn"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
--update) update;;
|
||||
*) sort -u "$fn" | awk 'NF' | fzf;;
|
||||
esac
|
||||
Reference in new issue
Block a user