Created
January 5, 2016 18:21
-
-
Save GuilhermeBarile/a3d91319e83c65624708 to your computer and use it in GitHub Desktop.
Enable PSD thumbnails on nautilus - from http://askubuntu.com/a/671089/91770
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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.