Putting a picture as a folder icon in Mint 19.3 (solved)

Chat about anything related to Linux Mint
Post Reply
ruprecht
Level 1
Level 1
Posts: 8
Joined: Sat May 23, 2020 10:15 am

Putting a picture as a folder icon in Mint 19.3 (solved)

Post by ruprecht »

I already wrote about this issue in a wider post, but I want to emphasize this issue in particular again. Putting a picture as a folder icon is highly important for me since I have hundreds folders (if not more) to deal with, and finding my way in it by name would get me mad, with pictured icon I can find a folder in a blink.
Well - it is possible to put a picture as a folder icon, but is more clumsy in Mint 19.3. In Mint 18.3 I can drag a photo to the little square in the properties window and it becomes the folder's icon, in 19.3 it does not work, and maybe it is the place to ask the Mint team to fix this bug. The browsing option in 18.3 is more elegant and easy to use, since the default folder to browse is the one that I am in it. Even more - there is a preview option of the picture I want to choose, by clicking on a picture in the "select custom icon" window I can see a small image of the picture. It is so comfortable and so quick to work with. May I ask Mint team to consider these issues too, if one has to deal with a lot of folders it is very significant. After all if it exists in Mint 18,3, it should not be too difficult to do the same in Mint 19.3 and on the following Mints.

Yours with all the respect
Last edited by ruprecht on Mon Jul 06, 2020 2:22 pm, edited 3 times in total.
User avatar
Portreve
Level 10
Level 10
Posts: 3317
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida

Re: Putting a picture as a folder icon in Mint 19.3

Post by Portreve »

A friend of mine who uses a Mac has about a gazillion folders with customized icons, and personally I think the mechanics behind customized icons is better in Mac OS X than in any GNU+Linux desktop environment I've seen.

The only customized icons I deal with at this point are drive icons, and that's because they persist and will show up on other systems when the drive is mounted.
Please remember to mark your fixed problem [SOLVED].

Running Linux Mint Cinnamon 20.0.

The noblest of all dogs is the hot-dog; it feeds the hand that bites it.
— Dr. Lawrence J. Peter
User avatar
GS3
Level 7
Level 7
Posts: 1742
Joined: Fri Jan 06, 2017 7:51 am

Re: Putting a picture as a folder icon in Mint 19.3

Post by GS3 »

I like to have folders on the desktop, each with its own icon. One work-around is to put the folders in some other place and then put shortcuts on the desktop to those folders because it is easy to assign icons to the shortcuts.

This is also practical because if the folders are under the home directory they get backed up automatically.
Please do not use animated GIFs in avatars because many of us find them distracting and obnoxious. Thank you.
User avatar
absque fenestris
Level 9
Level 9
Posts: 2509
Joined: Sat Nov 12, 2016 8:42 pm
Location: Confoederatio Helvetica

Re: Putting a picture as a folder icon in Mint 19.3

Post by absque fenestris »

Folder with own pictures: as far as it is Mint MATE 19.3 I see no problem.
Click on the folder icon in "Properties" > in the window that opens, navigate to a picture folder of your choice and double-click the desired picture. Then set the size with "Resize Icon ...".
Is actually exactly the same as on the Mac.

Image
Linux Mint 18.3 Sylvia (MATE) 32-bit - Acer D250 Netbook
Linux Mint 20 Ulyana (Cinnamon) 64-bit - Huawei MateBook X Pro
Mick-Cork
Level 4
Level 4
Posts: 269
Joined: Sun Mar 23, 2014 10:10 pm
Location: West Cork & London

Re: Putting a picture as a folder icon in Mint 19.3

Post by Mick-Cork »

absque fenestris wrote:
Fri Jun 19, 2020 4:38 pm
Folder with own pictures: as far as it is Mint MATE 19.3 I see no problem.
Click on the folder icon in "Properties" > in the window that opens, navigate to a picture folder of your choice and double-click the desired picture. Then set the size with "Resize Icon ...".
Is actually exactly the same as on the Mac.

Image
That's handy to know AF. Just tried it in 19.3 Cinnamon and it works fine there as well as far as assigning a picture. Not sure where to find 'Resize Icon' though, I might just be missing it or maybe not an option in Cinnamon?
User avatar
absque fenestris
Level 9
Level 9
Posts: 2509
Joined: Sat Nov 12, 2016 8:42 pm
Location: Confoederatio Helvetica

Re: Putting a picture as a folder icon in Mint 19.3

Post by absque fenestris »

Not sure where to find 'Resize Icon'
Select folder, right click mouse, directly under "Delete". Unfortunately, this only works in MATE. No wonder I can never choose between Cinnamon and MATE ...
Linux Mint 18.3 Sylvia (MATE) 32-bit - Acer D250 Netbook
Linux Mint 20 Ulyana (Cinnamon) 64-bit - Huawei MateBook X Pro
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Putting a picture as a folder icon in Mint 19.3

Post by smurphos »

Mick-Cork wrote:
Fri Jun 19, 2020 5:18 pm
That's handy to know AF. Just tried it in 19.3 Cinnamon and it works fine there as well as far as assigning a picture. Not sure where to find 'Resize Icon' though, I might just be missing it or maybe not an option in Cinnamon?
You have to switch to a legacy non grid desktop view in Cinnamon to be able to individually resize desktop icons. This switch is not exposed in the GUI - but can be accessed via dconf-editor or dconf/gsettings in the command line - /org/nemo/desktop/use-desktop-grid is the key.

@ruprecht - you might like this - https://github.com/smurphos/nemo_action ... om-emblems

Allows you to do things like this...

Image
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
ruprecht
Level 1
Level 1
Posts: 8
Joined: Sat May 23, 2020 10:15 am

Re: Putting a picture as a folder icon in Mint 19.3

Post by ruprecht »

Thank you all, first I have to mention that in my post (the first one on this page) I meant Cinnamon mint (18.3 and 19.3). I know that it is possible to put a picture as a folder icon in Mint 19.3, but I referred to how clumsy and difficult it is and how much longer does it take in Mint 19 and 20, comparing to Mint 18.3 with Cinnamon 3.6.7,which is a pleasure to work with. It looks like in Mint 19 &20 Nemo was downgraded in its abilities and evolution.
Am I the only one that it disturbs him? Or are there more?

smurphos - thank you for your link, but I think it is beyond my abilities, anyhow I Will try it on a VM, there all my disasters are tolerable.
Last edited by ruprecht on Sun Jun 21, 2020 12:22 am, edited 2 times in total.
User avatar
Portreve
Level 10
Level 10
Posts: 3317
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida

Re: Putting a picture as a folder icon in Mint 19.3

Post by Portreve »

OMG, I honestly had no idea you could do that in Cinnamon. Looks like I'm gonna have some work cut out for me. :lol:

smurphos and absque fenestris, thank you both very much!!!
Please remember to mark your fixed problem [SOLVED].

Running Linux Mint Cinnamon 20.0.

The noblest of all dogs is the hot-dog; it feeds the hand that bites it.
— Dr. Lawrence J. Peter
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Putting a picture as a folder icon in Mint 19.3

Post by smurphos »

ruprecht wrote:
Sat Jun 20, 2020 12:49 pm
Am I the only one that it disturbs him? Or are there more?
Here's something that might help your work flow.

In Nemo right click the picture you want and select copy.

Right click the target folder and select properties.

Click the folder icon in the properties window to open the icon picker, click on the search entry to give it focus and right click to paste.

Click on the thumbnail of your pic.

Press Select

Drag and drop not working is a bug - it is trying to assign the path to the icon, but not in a format the icon picker can understand. I'll report that.

Edit to add - https://github.com/linuxmint/mint20-beta/issues/159
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
ruprecht
Level 1
Level 1
Posts: 8
Joined: Sat May 23, 2020 10:15 am

Re: Putting a picture as a folder icon in Mint 19.3

Post by ruprecht »

smurphos - thank you again, thanks for reporting the bug, I really appreciate it, I do hope that it will be fixed.
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Putting a picture as a folder icon in Mint 19.3

Post by smurphos »

ruprecht wrote:
Sun Jun 21, 2020 12:33 am
smurphos - thank you again, thanks for reporting the bug, I really appreciate it, I do hope that it will be fixed.
No worries. Here's another solution for you. This adds a right click context menu item for directories - Apply Custom Icon that opens a file picker in that Directory.

Copy and paste these commands into a terminal. Each code block is a single command to be pasted in full - press enter after pasting.

Code: Select all

tee ~/.local/share/nemo/actions/apply_custom_icon.nemo_action <<'EOB'
[Nemo Action]
Name=Apply Custom _Icon
Comment=Apply a custom icon to #F
Exec=<apply_custom_icon.sh %F>
Icon-Name=image-x-generic-symbolic
Selection=s
Extensions=dir
EscapeSpaces=true
Dependencies=zenity;
EOB

Code: Select all

tee ~/.local/share/nemo/actions/apply_custom_icon.sh <<'EOB'
#!/bin/dash
#Shell script for nemo action apply_custom_icon
#Requires zenity - apt install zenity
#Picker
if [ -d "$1" ]; then
  SOURCE_DIR="$1"
  else
  SOURCE_DIR=$(xdg-user-dir PICTURES)
fi
SOURCE_PIC=$(zenity --file-selection --filename="$SOURCE_DIR"/ --file-filter='Supported media (jpg/png/gif/tiff) | *.jp*g *JP*G *.png *.PNG *.gif *.GIF *.tif* *.TIF^' --file-filter='All files | *' --title "Select source file")
if [ -z "$SOURCE_PIC" ]; then
  exit 1;
fi
#Apply new icon
gio set -t string "$1" metadata::custom-icon "file://$SOURCE_PIC"
touch "$1"
EOB

Code: Select all

chmod +x ~/.local/share/nemo/actions/apply_custom_icon.sh
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
ruprecht
Level 1
Level 1
Posts: 8
Joined: Sat May 23, 2020 10:15 am

Re: Putting a picture as a folder icon in Mint 19.3

Post by ruprecht »

smurphos wrote:
No worries. Here's another solution for you. This adds a right click context menu item for directories - Apply Custom Icon that opens a file picker in that Directory.
A bit late, but I tried it just now, and it is B R I L I A N T !!!!!
You pretty much solved my problem. A great relieve.
I do hope that the bug will be fixed as well, but this is for the Mint team.
Again thank you so much, what a great guy you are. :D :D :D
Grateful4Linux
Level 2
Level 2
Posts: 78
Joined: Wed Aug 07, 2019 8:02 pm

Re: Putting a picture as a folder icon in Mint 19.3

Post by Grateful4Linux »

smurphos wrote:
Sun Jun 21, 2020 2:23 am
ruprecht wrote:
Sun Jun 21, 2020 12:33 am
smurphos - thank you again, thanks for reporting the bug, I really appreciate it, I do hope that it will be fixed.
No worries. Here's another solution for you. This adds a right click context menu item for directories - Apply Custom Icon that opens a file picker in that Directory.

Copy and paste these commands into a terminal. Each code block is a single command to be pasted in full - press enter after pasting.

Code: Select all

tee ~/.local/share/nemo/actions/apply_custom_icon.nemo_action <<'EOB'
[Nemo Action]
Name=Apply Custom _Icon
Comment=Apply a custom icon to #F
Exec=<apply_custom_icon.sh %F>
Icon-Name=image-x-generic-symbolic
Selection=s
Extensions=dir
EscapeSpaces=true
Dependencies=zenity;
EOB

Code: Select all

tee ~/.local/share/nemo/actions/apply_custom_icon.sh <<'EOB'
#!/bin/dash
#Shell script for nemo action apply_custom_icon
#Requires zenity - apt install zenity
#Picker
if [ -d "$1" ]; then
  SOURCE_DIR="$1"
  else
  SOURCE_DIR=$(xdg-user-dir PICTURES)
fi
SOURCE_PIC=$(zenity --file-selection --filename="$SOURCE_DIR"/ --file-filter='Supported media (jpg/png/gif/tiff) | *.jp*g *JP*G *.png *.PNG *.gif *.GIF *.tif* *.TIF^' --file-filter='All files | *' --title "Select source file")
if [ -z "$SOURCE_PIC" ]; then
  exit 1;
fi
#Apply new icon
gio set -t string "$1" metadata::custom-icon "file://$SOURCE_PIC"
touch "$1"
EOB

Code: Select all

chmod +x ~/.local/share/nemo/actions/apply_custom_icon.sh
Wow, that is awesome, Smurphos!! Thank you so much for providing that code. It makes it so much faster and easier to set a photo as the icon. :D
heimdal
Level 1
Level 1
Posts: 4
Joined: Wed Mar 08, 2017 5:35 pm

Re: Putting a picture as a folder icon in Mint 19.3 (solved)

Post by heimdal »

smurphos thank you!

I was going to ask if there was any way to revert to the Mint 19 and earlier way of setting folder icons, but there is no need now.

Brilliant! :D
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: Putting a picture as a folder icon in Mint 19.3

Post by lewtwo »

absque fenestris wrote:
Fri Jun 19, 2020 4:38 pm
Folder with own pictures: as far as it is Mint MATE 19.3 I see no problem.
Click on the folder icon in "Properties" > in the window that opens, navigate to a picture folder of your choice and double-click the desired picture. Then set the size with "Resize Icon ...".
Is actually exactly the same as on the Mac.
Seems to work in:
Linux Mint 20 Ulyana 64-bit, MATE 1.24.0
as well (Thank thee). :D

For those wanting to switch icons the Standard ICON files are stored in /usr/share/icons.
There are a LOT of files there. I could not find the icon for the user's home folder.
I am adding an attached zip file to address that issue.
home folder 64.png
home folder 64.png (2.53 KiB) Viewed 403 times
You can also download free icons from https://freeicons.io
Attachments
home folder.zip
(25.66 KiB) Downloaded 4 times
"Engineering is the art of planning and forethought."
http://www.keywild.com
User avatar
absque fenestris
Level 9
Level 9
Posts: 2509
Joined: Sat Nov 12, 2016 8:42 pm
Location: Confoederatio Helvetica

Re: Putting a picture as a folder icon in Mint 19.3 (solved)

Post by absque fenestris »

Image

usr/share/icons/Mint-X/places ...

Pay attention to "places". No matter what icon flavor.
Linux Mint 18.3 Sylvia (MATE) 32-bit - Acer D250 Netbook
Linux Mint 20 Ulyana (Cinnamon) 64-bit - Huawei MateBook X Pro
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: Putting a picture as a folder icon in Mint 19.3 (solved)

Post by lewtwo »

absque fenestris wrote:
Mon Aug 03, 2020 9:45 pm
Pay attention to "places". No matter what icon flavor.
Thank thee :D
"Engineering is the art of planning and forethought."
http://www.keywild.com
Post Reply

Return to “Chat about Linux Mint”