[Bug]: `icons.yaml` does not seem to override icons
hawkw opened this issue ยท 6 comments
Version
- latest
version
eliza@theseus ~ $ lsd --version
lsd 1.1.2
What OS are you seeing the problem on?
Linux
installation
From Nixpkgs
term
eliza@theseus ~ $ echo $TERM
alacritty
ls-colors
eliza@theseus ~ $ echo $LS_COLORS
rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
What happened?
I have an icons.yaml
file in $HOME/config/lsd/icons.yaml
. The icons.theme
key in $HOME/.config/lsd/config.yaml
is set to "unicode", and icons.when
is set to "auto". However, my specified file type icons in icons.yaml
do not seem to override the defaults.
For example:
eliza@theseus ~ $ lsd ~/.config/lsd
๐ config.yaml ๐ icons.yaml
eliza@theseus ~ $ cat ~/.config/lsd/config.yaml
color:
when: auto
hyperlink: auto
icons:
separator: ' '
theme: unicode
when: auto
eliza@theseus ~ $ cat ~/.config/lsd/icons.yaml
filetype:
device_block: ๐ด
device_char: ๐ต
dir: ๐
executable: ๐
file: ๐
pipe: โญ
socket: ๐ง
eliza@theseus ~ $ ls
๐ Code ๐ Desktop ๐ Documents ๐ Downloads ๐ hubris.core.ringbuf-counts ๐ keybase ๐ Music ๐ Pictures ๐ Public ๐ se.jpeg ๐ Templates ๐ Videos ๐ vudials.log
eliza@theseus ~ $ lsd
๐ Code ๐ Downloads ๐ Music ๐ se.jpeg ๐ vudials.log
๐ Desktop ๐ hubris.core.ringbuf-counts ๐ Pictures ๐ Templates
๐ Documents ๐ keybase ๐ Public ๐ Videos
eliza@theseus ~ $ lsd /dev
๐จ autofs ๐จ hidraw2 ๐จ kvm ๐ rtc ๐จ tty26 ๐จ tty54 ๐จ vcs6
๐ block ๐จ hpet ๐ log ๐จ rtc0 ๐จ tty27 ๐จ tty55 ๐จ vcs7
๐จ btrfs-control ๐ hugepages ๐จ loop-control ๐ shm ๐จ tty28 ๐จ tty56 ๐จ vcsa
๐ bus ๐จ hwrng ๐ฝ loop0 ๐จ snapshot ๐จ tty29 ๐จ tty57 ๐จ vcsa1
๐ char ๐จ i2c-0 ๐ฝ loop1 ๐ snd ๐จ tty3 ๐จ tty58 ๐จ vcsa2
๐จ console ๐จ i2c-1 ๐ฝ loop2 ๐ stderr ๐จ tty30 ๐จ tty59 ๐จ vcsa3
๐ core ๐จ i2c-10 ๐ฝ loop3 ๐ stdin ๐จ tty31 ๐จ tty6 ๐จ vcsa4
๐ cpu ๐จ i2c-11 ๐ฝ loop4 ๐ stdout ๐จ tty32 ๐จ tty60 ๐จ vcsa5
๐จ cpu_dma_latency ๐จ i2c-12 ๐ฝ loop5 ๐จ tee0 ๐จ tty33 ๐จ tty61 ๐จ vcsa6
๐จ cuse ๐จ i2c-13 ๐ฝ loop6 ๐จ tpm0 ๐จ tty34 ๐จ tty62 ๐จ vcsa7
๐จ dbc ๐จ i2c-14 ๐ฝ loop7 ๐จ tpmrm0 ๐จ tty35 ๐จ tty63 ๐จ vcsu
๐ disk ๐จ i2c-15 ๐ mapper ๐จ tty ๐จ tty36 ๐จ tty7 ๐จ vcsu1
๐ฝ dm-0 ๐จ i2c-16 ๐จ media0 ๐จ tty0 ๐จ tty37 ๐จ tty8 ๐จ vcsu2
๐ฝ dm-1 ๐จ i2c-17 ๐จ mem ๐จ tty1 ๐จ tty38 ๐จ tty9 ๐จ vcsu3
๐ dri ๐จ i2c-18 ๐ mqueue ๐จ tty10 ๐จ tty39 ๐จ ttyS0 ๐จ vcsu4
๐จ drm_dp_aux0 ๐จ i2c-19 ๐ net ๐จ tty11 ๐จ tty4 ๐จ ttyS1 ๐จ vcsu5
๐จ drm_dp_aux1 ๐จ i2c-2 ๐จ ng0n1 ๐จ tty12 ๐จ tty40 ๐จ ttyS2 ๐จ vcsu6
๐จ drm_dp_aux2 ๐จ i2c-20 ๐จ null ๐จ tty13 ๐จ tty41 ๐จ ttyS3 ๐จ vcsu7
๐จ drm_dp_aux3 ๐จ i2c-21 ๐จ nvme0 ๐จ tty14 ๐จ tty42 ๐จ udmabuf ๐ vfio
๐จ drm_dp_aux4 ๐จ i2c-22 ๐ฝ nvme0n1 ๐จ tty15 ๐จ tty43 ๐จ uhid ๐จ vga_arbiter
๐จ drm_dp_aux5 ๐จ i2c-3 ๐ฝ nvme0n1p1 ๐จ tty16 ๐จ tty44 ๐จ uinput ๐จ vhci
๐จ drm_dp_aux6 ๐จ i2c-4 ๐ฝ nvme0n1p2 ๐จ tty17 ๐จ tty45 ๐จ urandom ๐จ vhost-net
๐จ drm_dp_aux7 ๐จ i2c-5 ๐ฝ nvme0n1p3 ๐จ tty18 ๐จ tty46 ๐จ userfaultfd ๐จ vhost-vsock
๐จ drm_dp_aux8 ๐จ i2c-6 ๐จ nvram ๐จ tty19 ๐จ tty47 ๐จ userio ๐จ video0
๐จ fb0 ๐จ i2c-7 ๐จ port ๐จ tty2 ๐จ tty48 ๐ v4l ๐จ video1
๐ fd ๐จ i2c-8 ๐จ ppp ๐จ tty20 ๐จ tty49 ๐จ vcs ๐จ watchdog
๐จ full ๐จ i2c-9 ๐จ ptmx ๐จ tty21 ๐จ tty5 ๐จ vcs1 ๐จ watchdog0
๐จ fuse ๐จ iio:device0 ๐ pts ๐จ tty22 ๐จ tty50 ๐จ vcs2 ๐จ zero
๐จ gpiochip0 ๐ input ๐จ random ๐จ tty23 ๐จ tty51 ๐จ vcs3
๐จ hidraw0 ๐จ kfd ๐จ rfkill ๐จ tty24 ๐จ tty52 ๐จ vcs4
๐จ hidraw1 ๐จ kmsg ๐ root ๐จ tty25 ๐จ tty53 ๐จ vcs5
eliza@theseus ~ $
Note that the overridden directory, block device, char device, and file icons in icons.yaml
are not used.
What expected?
I would have expected the overridden icons to be used, as described in the README here.
What else?
It seems like the documentation on setting a custom icon theme in the README may no longer describe lsd
's actual behavior? Looking at lsd/src/theme.rs
, it looks like the Theme
struct now attempts to parse an icon theme, color theme, and Git symbols from the same file:
Lines 18 to 26 in 9b310da
Lines 39 to 83 in 9b310da
I'd be happy to open a PR to either update the documentation or fix the implementation so that it does what the documentation says! However, before doing that, it would be great to hear from the maintainers regarding what the intended behavior here is. Is the icon theme still supposed to be parsed from $XDG_CONFIG_HOME/lsd/icons.yaml
as described in the README, or is the apparent behavior of parsing both the icons and color theme from the same YAML file correct? If the current behavior is intended, how is the new theme file supposed to be used --- where should it be located, and how do I point lsd
at it?
@hawkw FYI, this appears to be fixed as of version 1.1.5. Here are some custom overrides in my icons.yaml
file:
The custom icons are only applied when the icon theme is fancy
, as evidenced by these lines:
Lines 16 to 26 in 82124fd
This should ideally be reflected in the documentation, I spent quite a while trying to figure out why my icons were not working.
@hxlnt , I am not able to reproduce your setup with the same version. Could you please share your icons.yaml
file?
@nilp0inter Sure, though the characters won't render correctly here, as they require a Nerdfont. I've also included my config.yaml.
config.yaml:
classic: false
blocks:
- name
- size
- date
color:
when: auto
theme: custom
date: relative
dereference: false
icons:
when: always
theme: fancy
separator: " "
indicators: false
layout: tree
recursion:
enabled: false
depth: 1
size: short
sorting:
column: name
reverse: false
dir-grouping: first
no-symlink: false
total-size: false
hyperlink: always
symlink-arrow: โ
header: true
icons.yaml
name:
.bashrc: ๏ข
.eslintrc.js: ๏
.eslintrc.json: ๏
.eslintrc.yml: ๏ข
.git: ๏
.gitignore: ๏
.gitlab-ci.yml: ๏ข
.todo: ๏
.trash: ๏
commit_editmsg: ๏
config: ๏ข
desktop: ๏ฉ
description: ๏
documents: ๏
downloads: ๏
fetch_head: ๏
go.mod: ๏
go.sum: ๏
head: ๏
heroku.yml: ๏ข
index: ๏
lib: ๏
license: ๏ฝ
makefile: ๏ฃ
music: ๏
node_modules: ๏
orig_head: ๏
package.json: ๏
pictures: ๏
public: ๏
pyproject.toml: ๏ข
scripts: ๏
src: ๏
tests: ๏
videos: ๏
extension:
1: ๏
2: ๏
3: ๏
4: ๏
asm: ๏
avi: ๏ฌ
bak: ๏ค
bat: ๏
bin: ๏ฑ
bmp: ๏ฅ
c: ๏
cpp: ๏
cert: ๏
cfg: ๏ข
cson: ๏
css: ๏
csv: ๏ฅ
db: ๏ฒ
deb: ๏
doc: ๏ป
docx: ๏ป
ejs: ๏
exe: ๏ฑ
go: ๏
gif: ๏ฌ
git: ๏
h: ๏
hpp: ๏
hex: ๏ฑ
htm: ๏
html: ๏
img: ๏ฅ
ini: ๏ข
ino: ๏
jpeg: ๏ฅ
jpg: ๏ฅ
js: ๏
json: ๏
jsx: ๏
key: ๏ฝ
list: ๏
lock: ๏
log: ๏ญ
lua: ๏
md: ๏
m4v: ๏ฌ
mpeg: ๏ฌ
mpg: ๏ฌ
nes: ๏ฑ
nfo: ๏
old: ๏
otf: ๏จ
png: ๏ฅ
ppt: ๏
pptx: ๏
py: ๏
rar: ๏
rom: ๏ฑ
rs: ๏
rss: ๏จ
save: ๏
sh: ๏
tar: ๏
toml: ๏ข
ts: ๏
tsx: ๏
ttf: ๏จ
txt: ๏ถ
vue: ๏
xls: ๏ฅ
xlsx: ๏ฅ
xml: ๏
yaml: ๏ข
yml: ๏ข
zip: ๏
filetype:
dir: ๏
file: ๏ฅ
@hxlnt Thanks! I was able to identify the issue. It turned out that I was trying to override the Downloads
folder, but it wasn't having the desired effect. Upon further investigation, I discovered that the keys should be in lowercase. To successfully override the icon in the Downloads
directory, I had to include a downloads
entry.
for @hawkw, there are typos in your config, should be device-block
, not device_block
.
for @nilp0inter, the lowercase limitation comes from yaml, we currently do not have a good solution for that, I will try to dive deeper when have time.
this issue is overly divergent, so I am closing it.
please feel free to open an issue for specific questions.