in the Gnome desktop, I know how to create a desktop entry for a custom program. I also know how to pin it to my Favorites by right clicking and selecting Add to Favorites. I want to do that last step in silent mode, from a shell script as part of a larger automation process. Is this possible?

  • What are these favorites? Is it something from a graphical file browser? Which one?
    – terdon
    Jul 18, 2020 at 17:20
  • Gnome desktop (not file browser), sorry for not clarifying, I specified the Gnome tag but not in the post. I'll update the post Jul 18, 2020 at 18:07

1 Answer 1

# Do a check
desktop-file-validate ${HOME}/.local/share/applications/*.desktop

# List apps pinned to dock
gsettings get org.gnome.shell favorite-apps

# Pin new list to dock after editing
gsettings set org.gnome.shell favorite-apps "['doublecmd.desktop', 'textadept.desktop', 'notherapp.desktop', 'okular.desktop']"

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.