Search $XDG_DATA_HOME/icons before ~/.icons
This commit is contained in:
parent
a376840e78
commit
81bddba5d6
1 changed files with 5 additions and 0 deletions
|
|
@ -12,6 +12,10 @@
|
|||
def xdg_data_dirs() -> tuple[str, ...]:
|
||||
return tuple(os.environ.get('XDG_DATA_DIRS', '/usr/local/share/:/usr/share/').split(os.pathsep))
|
||||
|
||||
@run_once
|
||||
def xdg_data_home() -> str:
|
||||
return os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share/'))
|
||||
|
||||
|
||||
@run_once
|
||||
def icon_dirs() -> list[str]:
|
||||
|
|
@ -20,6 +24,7 @@ def a(x: str) -> None:
|
|||
if os.path.isdir(x):
|
||||
ans.append(x)
|
||||
|
||||
a(os.path.join(xdg_data_home(), 'icons'))
|
||||
a(os.path.expanduser('~/.icons'))
|
||||
for x in xdg_data_dirs():
|
||||
a(os.path.join(x, 'icons'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue