Skip to content

Instantly share code, notes, and snippets.

@GuilhermeBarile
Created January 5, 2016 18:21
Show Gist options
  • Save GuilhermeBarile/a3d91319e83c65624708 to your computer and use it in GitHub Desktop.
Save GuilhermeBarile/a3d91319e83c65624708 to your computer and use it in GitHub Desktop.
Enable PSD thumbnails on nautilus - from http://askubuntu.com/a/671089/91770
#!/bin/bash
# -----------------------------------------------------------
# -- Write psdthumbnailer
# -----------------------------------------------------------
OUTFILE=/usr/lib/psdthumbnailer
(
sudo cat <<'EOF'
# bin/bash
# Arguments / Parameters %i %o %s
f_in=$1
f_out=$2
f_size=$3
# Execute Convert PSD to PNG through ImageMagick
exec convert "psd:$f_in[0]" -scale "$f_sizex$f_size" "png:$f_out"
EOF
) > $OUTFILE
# -----------------------------------------------------------
# -- Write photoshop.thumbnailer
# -----------------------------------------------------------
OUTFILE=/usr/share/thumbnailers/photoshop.thumbnailer
(
sudo cat <<'EOF'
# bin/bash
[Thumbnailer Entry]
TryExec=/usr/lib/psdthumbnailer
Exec=/usr/lib/psdthumbnailer %i %o %s
MimeType=image/vnd.adobe.photoshop; image/x-photoshop; image/x-psd;
EOF
) > $OUTFILE
# -----------------------------------------------------------
# -- Set File Permissions
# -----------------------------------------------------------
sudo chmod 0755 /usr/lib/psdthumbnailer
sudo chmod 0644 /usr/share/thumbnailers/photoshop.thumbnailer
# -----------------------------------------------------------
# -- Add GConf Hooks to parse thumbnails
# -----------------------------------------------------------
sudo gconftool-2 --set /desktop/gnome/thumbnailers/image@vnd.adobe.photoshop/enable --type bool true
sudo gconftool-2 --set /desktop/gnome/thumbnailers/image@vnd.adobe.photoshop/command --type string "/usr/lib/psdthumbnailer %i %o %s %i %o %s"
# -----------------------------------------------------------
# -- Install Dependencies
# -----------------------------------------------------------
sudo apt-get install imagemagick
@jcklpe
Copy link

jcklpe commented Jul 23, 2019

Doesn't seem to work for me :/

@GuilhermeBarile
Copy link
Author

@jcklpe
This is 4 years old and I haven't used it since then, do you have imagemagick installed?

@jcklpe
Copy link

jcklpe commented Jul 28, 2019

@guillhermeBarile

Yup. Looking around though I think this might be because a new install of Ubuntu 12 and up has a slightly different syntax for setting getconf settings. That's what my understanding from reading around was. I can't actually say that for sure but from my googling it looks to be that issue.

I found a ppa package maintained by a guy that others say works but doesn't work for me.

https://moritzmolch.com/1749

It could not work for me because I ran this script beforehand. I think I have properly reset stuff though so not really sure what's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment