7

I'm trying to change the icon of the "stack" (folders) in the dock (Plank). I made a folder in Home and put on the links that I wanted on. Then, I dragged that folder to Plank. This makes a shortcut to the selected folder on Plank. My question is: How I can change that icon?

2

Changing dock folder icon is not possible in Plank, but in order to get "stacking", the folder-on-dock--with-no-icon is not the only solution.

Instead of having a folder button in the dock without a real icon, we can have a normal launcher with multiple "Desktop Actions" - and WITH proper icon(s).

The practical difference is that with a no-icon dock folder you left-click to get the list of launchers, while here you will have to right-click the dock icon.

We are familiar with desktop actions, as they are present in other dock launchers as right-click options like those of Firefox or Chromium (to start a new window in incognito mode or temporary profile) or of media players like Clementine or Deadbeef (Play, Pause, Stop, Previous, Next).

Right-clicking the Clementine launcher you get this:

enter image description here

The number and type of actions accessible with double-click is set by editing the corresponding desktop file. Usually those actions lack icons, but those can be added once a Icon= line is put under each action as below.

The form of such a file should be like this:

[Desktop Entry]
Icon=
Name=
Actions=FIRST-ACTION;SECOND-ACTION
Type=Application

[Desktop Action FIRST-ACTION]
Name=
Exec=
Icon=

[Desktop Action SECOND-ACTION]
Name=
Exec=
Icon=

The Exec= line under [Desktop Entry] category (to run a program with a single left click like normal dock launchers) is not absolutely necessary, but it is useful and it can also be added, and I would use that for the most important of the programs or commands in this group (Music/Noise in the example below).

I will give an example for a "stack" of audio players. For this I will create the launcher .desktop file (using gedit text editor):

gedit ~/.local/share/applications/play_music.desktop

With these lines:

[Desktop Entry]
Icon=multimedia-audio-player
Name=Play music
Icon=multimedia-audio-player
Actions=vlc;deadbeef;clementine;banshee;pavucontrol
Type=Application

[Desktop Action vlc]
Name=Play VLC
Exec=vlc 
Icon=vlc

[Desktop Action deadbeef]
Name=Play Deadbeef
Exec=deadbeef
Icon=deadbeef

[Desktop Action clementine]
Name=Play Clementine
Exec=clementine
Icon=clementine


[Desktop Action banshee]
Name=Play Banshee
Exec=banshee
Icon=banshee

[Desktop Action pavucontrol]
Name=PulseAudio Volume Control
Exec=pavucontrol
Icon=multimedia-volume-control

To make the file executable:

chmod +x ~/.local/share/applications/play_music.desktop

The Icon= line under Desktop Entry category will get the main dock icon (in this case the Music/Noise one); the icons for each desktop action are those in each desktop action group. (In case new icons are needed: find the proper png icon with any name, put the icon in ~/.local/share/icons and edit the file above to have the same name as the icon in the line Icon=).

For each program that you want to access in this way you can add one or more such actions.

My desktop file above will give this:

enter image description here

6

It's not possible to change. This is currently drawn by cairo code in Plank. It is not an external asset and it can't be styled with Gtk.CSS

0

It is possible, but you need Nautilus:

Open Nautilus and find your folder > right click on it and select properties > click on the folder icon at the top right of the properties window > choose your new icon.

Once you have done that add your folder to the dock (remove it first if it is already there).

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.