I am aware that you can right-click on an application and choose "Add to Favorites". I am trying to add it to the favorites section without using the GUI at all. Everything needs to be done in the terminal or a script.
Anyone have any ideas?
This is not a duplicate of this question. That is for SETTING the favorites, not ADDING to the favorites. When you right click on an application and choose "Add to Favorites", that must run a script somewhere that takes an input of the application name. What I'm asking is, where is that script or how can I replicate it?
Unfortunately, as an end-user you can only "read" and "write" (also reset) the array that dictates the list of favourite apps by using
dconf
/gsettings
. For example, as mentioned here, you can get the value by runningand write a new value by a suitable
gsettings set
command. There is no straightforward way to append to the array, you can only overwrite.But you can combine these two and have a custom command. You need to know the name of the
.desktop
launcher associated to the application you want to add to the favourites first. Let's say it isappname.desktop
. Then you can run the following to add the application associated toappname.desktop
to the favourites:The path for
dconf
is:/org/gnome/shell/favorite-apps
. For exampleWhich for me produces
So in theory you could use
dconf write
to adjust these values