How to change left panel programs with a script?

Solution 1:

Favorite apps are stored in the dconf setting /org/gnome/shell/favorite-apps. You could therefore define the icons that appear there as favorites with a command such as

gsettings set org.gnome.shell favorite-apps "['firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.gedit.desktop', 'thunderbird.desktop']