Assuming that #shelf is a text-type (perhaps with a fixed set of values) then this advanced rule should work.
Here is the text shown in the dialog
Code:
program:
switch(
field('#enum2'),
'^read$', 'success.png',
'^to-read$', 'play-button.png',
'^backlog$', 'line.png',
'^dnf$', 'error.png',
'^dont-touch$', 'forbidden-light-grey.png',
'^currently-reading$', 'medical-1.png',
'^favorite$', 'eye-1.png',
'')
The search fields (read, to-read, etc) are regular expressions, which is why they are anchored (begin with ^ and end with $).
I used #enum2 because I don't have a column named #shelf.