aleta-postre/tasks/icon-count.sh

77 lines
2.1 KiB
Bash
Raw Normal View History

2022-01-05 02:25:46 +01:00
#!/bin/bash
# SPDX-FileCopyrightText: 2022 debgerme <fossgerme@tuta.io>
#
# SPDX-License-Identifier: GPL-3.0-or-later
2022-01-05 02:25:46 +01:00
set -o errexit # exit on error
# first, set the functions
function iconcount_set_cols ()
{
# set the colors
colorone="\e[1;34m"
colortdo="\e[1;31m"
colorcom="\e[1;32m"
colorreset="\e[0m"
}
function iconcount_get_numbers ()
{
# get the numbers
icons_total="$(find icons/apps/ icons/places/ icons/devices/ icons/categories/ icons/status/ icons/mimetypes/ icons/actions/ icons/animations/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# apps
2022-01-10 00:34:50 +01:00
icons_apps="$(find icons/apps/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# actions
icons_actions="$(find icons/actions/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# categories
2022-01-10 00:34:50 +01:00
icons_cate="$(find icons/categories/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# devices
2022-01-10 00:34:50 +01:00
icons_devices="$(find icons/devices/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# mimetypes
2022-01-10 00:34:50 +01:00
icons_mime="$(find icons/mimetypes/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# places
2022-01-10 00:34:50 +01:00
icons_places="$(find icons/places/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# status
2022-01-10 00:34:50 +01:00
icons_status="$(find icons/status/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
# animations
2022-01-10 00:34:50 +01:00
icons_animations="$(find icons/animations/ -mindepth 1 -maxdepth 1 -not -path '*/\.*' | wc -l)"
2022-01-05 02:25:46 +01:00
}
function iconcount_display_numbers ()
{
# print the list
2022-01-10 00:34:50 +01:00
printf "${colorcom}All: ${colorreset}${icons_total}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "________________\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Apps: ${colorreset}${icons_apps}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Actions: ${colorreset}${icons_actions}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Categories: ${colorreset}${icons_cate}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Devices: ${colorreset}${icons_devices}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Mimetypes: ${colorreset}${icons_mime}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Places: ${colorreset}${icons_places}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Status: ${colorreset}${icons_status}\\n"
2022-01-05 02:25:46 +01:00
2022-01-10 00:34:50 +01:00
printf "${colorone}Animations: ${colorreset}${icons_animations}\\n"
2022-01-05 02:25:46 +01:00
}
iconcount_set_cols
iconcount_get_numbers
iconcount_display_numbers