Saturday, February 24, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 12843  / 2 Years ago, wed, may 18, 2022, 6:44:39

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?


More From » gnome

 Answers
0

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 running





gsettings get org.gnome.shell favorite-apps


and 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 is appname.desktop. Then you can run the following to add the application associated to appname.desktop to the favourites:



gsettings set org.gnome.shell favorite-apps "$(gsettings get org.gnome.shell favorite-apps | sed s/.$//), 'appname.desktop']"

[#4465] Thursday, May 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skipu

Total Points: 366
Total Questions: 114
Total Answers: 112

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;