missingIconsFinder: also scan share/pixmaps

This commit is contained in:
2025-11-11 16:34:22 +09:00
parent e280d614e5
commit 8af21cd762

View File

@@ -5,25 +5,23 @@ import re
import subprocess
from collections import defaultdict
# nix-locate -r "share/icons/hicolor/[^/]+/apps/.*\.*" --all | awk '{print substr($4, length($4) - 3 + 1)}' | sort -u
# nix-locate -r "share/(icons/hicolor/[^/]+/apps|pixmaps)/.*\.[^/]+" --all | awk '{print substr($4, length($4) - 3 + 1)}' | sort -u
ICON_SUFFIXES = [
'bmp',
'cns',
'eep',
'gif',
'icns'
'ico',
'jpeg',
'jpg',
'nse',
'png',
'svg',
'vgz',
'svgz',
'xpm',
]
ICON_SUFFIXES += [x.upper() for x in ICON_SUFFIXES]
LOCATE_REGEX = f'share/(applications/[^/]+\\.desktop|icons/hicolor/[^/]+/apps/[^/]+\\.({'|'.join(ICON_SUFFIXES)}))'
LOCATE_REGEX = f'share/(applications/[^/]+\\.desktop|pixmaps/[^/]+\\.({'|'.join(ICON_SUFFIXES)})|icons/hicolor/[^/]+/apps/[^/]+\\.({'|'.join(ICON_SUFFIXES)}))'
result = subprocess.run(['nix-locate', '-r', LOCATE_REGEX, '--all'], capture_output=True)