After running racket-lang install-script all my /usr/share/application/*.desktop files have broken icon paths and corresponding shortcuts are displayed with question marks. Paths are overwritten like this (for standard terminal):


I'm wondering, if there was a way of broking them at once, maybe there is some easy way to fix them all at once? The problem is I don't know how those paths were looking before. I've tried to replace "/usr/share/racket/" prefix to "/usr/share/app-install/icons/" because I've found this folder has related icons, but this doesn't work until I explicitly specify icon's extension so I can't just write some simple replace script here (icon extensions vary from app to app: in some cases there is "/usr/share/app-install/icons/app.svg", in other "/usr/share/app-install/icons/another-app.png").


You can just change icon path to application name. Try this:

for file in /usr/share/applications/*.desktop; do
    grep 'Icon=/usr/share/racket/' "$file" /dev/null
    sed -i 's:^Icon=/usr/share/racket/:Icon=:' "$file"

Save it as a script ('script.sh') and run it as root ('sudo sh script.sh').

It will fix all files which need changing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.