Unused icons to check later

This commit is contained in:
Willy-JL
2024-10-24 17:35:09 +01:00
parent 8174ffa5b3
commit b7f98e344c
2 changed files with 41 additions and 10 deletions

31
scripts/check_unused_icons.py Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import pathlib
root = pathlib.Path(__file__).parent / ".."
icons = root / "assets/icons"
def source_dir_uses_icon(dir: str, name: str):
count = 0
name = name.encode()
for file in (root / dir).glob("**/*.c"):
try:
if name in file.read_bytes():
count += 1
except Exception:
print(f"Faield to read {file}")
return count
for category in icons.iterdir():
if not category.is_dir():
continue
for icon in category.iterdir():
if icon.is_dir() and (icon / "frame_rate").is_file():
name = "&A_" + icon.name.replace("-", "_")
else:
name = "&I_" + "_".join(icon.name.split(".")[:-1]).replace("-", "_")
count = 0
for dir in ("applications", "furi", "lib", "targets"):
count += source_dir_uses_icon(dir, name)
print(f"{name} used {count} times")
if count == 0:
print(f"====== {name} is not used! ======")

View File

@@ -3985,11 +3985,11 @@ Variable,+,I_Percent_10x14,const Icon,
Variable,+,I_Pin_arrow_up_7x9,const Icon,
Variable,+,I_Pin_attention_dpad_29x29,const Icon,
Variable,+,I_Pin_back_arrow_10x8,const Icon,
Variable,+,I_Pin_cell_13x13,const Icon,
Variable,-,I_Pin_cell_13x13,const Icon,
Variable,+,I_Pin_pointer_5x3,const Icon,
Variable,+,I_Pin_star_7x7,const Icon,
Variable,+,I_Play_25x27,const Icon,
Variable,+,I_Play_hvr_25x27,const Icon,
Variable,-,I_Play_25x27,const Icon,
Variable,-,I_Play_hvr_25x27,const Icon,
Variable,+,I_Pressed_Button_13x13,const Icon,
Variable,+,I_Quest_7x8,const Icon,
Variable,+,I_RFIDDolphinReceive_97x61,const Icon,
@@ -4072,13 +4072,13 @@ Variable,+,I_floppydisk_10px,const Icon,
Variable,+,I_green_19x20,const Icon,
Variable,+,I_green_hover_19x20,const Icon,
Variable,+,I_heat_30x51,const Icon,
Variable,+,I_hourglass0_24x24,const Icon,
Variable,+,I_hourglass1_24x24,const Icon,
Variable,+,I_hourglass2_24x24,const Icon,
Variable,+,I_hourglass3_24x24,const Icon,
Variable,+,I_hourglass4_24x24,const Icon,
Variable,+,I_hourglass5_24x24,const Icon,
Variable,+,I_hourglass6_24x24,const Icon,
Variable,-,I_hourglass0_24x24,const Icon,
Variable,-,I_hourglass1_24x24,const Icon,
Variable,-,I_hourglass2_24x24,const Icon,
Variable,-,I_hourglass3_24x24,const Icon,
Variable,-,I_hourglass4_24x24,const Icon,
Variable,-,I_hourglass5_24x24,const Icon,
Variable,-,I_hourglass6_24x24,const Icon,
Variable,+,I_iButtonDolphinVerySuccess_92x55,const Icon,
Variable,+,I_iButtonKey_49x44,const Icon,
Variable,+,I_ibutt_10px,const Icon,
1 entry status name type params
3985 Variable + I_Pin_arrow_up_7x9 const Icon
3986 Variable + I_Pin_attention_dpad_29x29 const Icon
3987 Variable + I_Pin_back_arrow_10x8 const Icon
3988 Variable + - I_Pin_cell_13x13 const Icon
3989 Variable + I_Pin_pointer_5x3 const Icon
3990 Variable + I_Pin_star_7x7 const Icon
3991 Variable + - I_Play_25x27 const Icon
3992 Variable + - I_Play_hvr_25x27 const Icon
3993 Variable + I_Pressed_Button_13x13 const Icon
3994 Variable + I_Quest_7x8 const Icon
3995 Variable + I_RFIDDolphinReceive_97x61 const Icon
4072 Variable + I_green_19x20 const Icon
4073 Variable + I_green_hover_19x20 const Icon
4074 Variable + I_heat_30x51 const Icon
4075 Variable + - I_hourglass0_24x24 const Icon
4076 Variable + - I_hourglass1_24x24 const Icon
4077 Variable + - I_hourglass2_24x24 const Icon
4078 Variable + - I_hourglass3_24x24 const Icon
4079 Variable + - I_hourglass4_24x24 const Icon
4080 Variable + - I_hourglass5_24x24 const Icon
4081 Variable + - I_hourglass6_24x24 const Icon
4082 Variable + I_iButtonDolphinVerySuccess_92x55 const Icon
4083 Variable + I_iButtonKey_49x44 const Icon
4084 Variable + I_ibutt_10px const Icon