Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with zsh #19

Open
crypdick opened this issue Sep 4, 2017 · 54 comments
Open

Does not work with zsh #19

crypdick opened this issue Sep 4, 2017 · 54 comments

Comments

@crypdick
Copy link

crypdick commented Sep 4, 2017

When I run the script I get a zsh: = not found error. The problem lies with the == checks in bing_wallpaper.sh#L26-L44 (see http://slopjong.de/2012/07/02/compatibility-between-zsh-and-bash/).

@dzmanto
Copy link

dzmanto commented Sep 5, 2017 via email

@dzmanto
Copy link

dzmanto commented Sep 5, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 5, 2017

Thanks for your quick response! Here's the output:

 ✘ crypdick@laptop ~  bash bing_wallpaper.sh en-US true
convert: unable to read font `Droid Sans' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Droid Sans' @ error/annotate.c/RenderFreetype/1362.
convert: unable to read font `Droid Sans' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Droid Sans' @ error/annotate.c/RenderFreetype/1362.
convert: no such image `/tmp/bing_wallpaper_rxhBgS.jpg' @ error/mogrify.c/MogrifyImageList/8775.
convert: no images defined `/tmp/bing_wallpaper_rxhBgS.jpg' @ error/convert.c/ConvertImageCommand/3258.

@dzmanto
Copy link

dzmanto commented Sep 6, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 6, 2017

@dzmanto:

-rw------- 1 crypdick crypdick 517457 Sep  5 19:09 /tmp/bing_wallpaper_rxhBgS.jpg
crypdick@laptop ~  which mogrify
/usr/bin/mogrify
 crypdick@laptop ~  mogrify /tmp/bing_wallpaper_rxhBgS.jpg
 crypdick@laptop ~ 

@dzmanto
Copy link

dzmanto commented Sep 6, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 6, 2017

Yep.
bing_wallpaper_rxhbgs

@dzmanto
Copy link

dzmanto commented Sep 6, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 6, 2017

I'm using i3. I just tried disabling nitrogen and enabling compton and it looks like it's working now! Thanks for the help Daniela 🥇

@dzmanto
Copy link

dzmanto commented Sep 6, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 8, 2017

It works, but I still get font warnings.

crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
convert: unable to read font `Nimbus Sans' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Nimbus Sans' @ error/annotate.c/RenderFreetype/1362.
convert: unable to read font `Nimbus Sans' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Nimbus Sans' @ error/annotate.c/RenderFreetype/1362.
convert: no such image `/tmp/bing_wallpaper_swfREe.jpg' @ error/mogrify.c/MogrifyImageList/8775.
convert: no images defined `/tmp/bing_wallpaper_swfREe.jpg' @ error/convert.c/ConvertImageCommand/3258.

@dzmanto
Copy link

dzmanto commented Sep 8, 2017 via email

@crypdick
Copy link
Author

Sorry for the late response, was getting hit by a hurricane. I do not see anything like that (other than the Bing logo).

@dzmanto
Copy link

dzmanto commented Sep 12, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 13, 2017

Thanks! I made it through fine ^_^ I ran this script twice. Both times, it downloaded the photo of the day and saved it using a different filename (don't know if that's intended behavior) but this time my wallpaper did not get replaced.

 crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1362.
convert: no such image `/home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg' @ error/mogrify.c/MogrifyImageList/8775.
convert: no images defined `/home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg' @ error/convert.c/ConvertImageCommand/3258.
 ✘ crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh                  
convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1362.
convert: no such image `/home/crypdick/Pictures/Bing/bing_wallpaper_21110.jpg' @ error/mogrify.c/MogrifyImageList/8775.
convert: no images defined `/home/crypdick/Pictures/Bing/bing_wallpaper_21110.jpg' @ error/convert.c/ConvertImageCommand/3258.

@dzmanto
Copy link

dzmanto commented Sep 13, 2017 via email

@crypdick
Copy link
Author

^ this worked flawlessly :) I'm on Manjaro Linux.

@dzmanto
Copy link

dzmanto commented Sep 13, 2017 via email

@crypdick
Copy link
Author

 ✘ crypdick@pito  ~  convert -background "#00000080" -fill white -gravity center -size 1024 -font "Arial" -pointsize 22 caption:"test title" /home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg +swap -gravity south -composite /home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg
convert: unable to read font `Arial' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Arial' @ error/annotate.c/RenderFreetype/1362.
convert: unable to read font `Arial' @ warning/annotate.c/RenderType/964.
convert: unable to read font `Arial' @ error/annotate.c/RenderFreetype/1362.
convert: no such image `/home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg' @ error/mogrify.c/MogrifyImageList/8775.
convert: no images defined `/home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg' @ error/convert.c/ConvertImageCommand/3258.
 ✘ crypdick@pito  ~  ls /home/crypdick/Pictures/Bing 
bing_wallpaper_17121.jpg  bing_wallpaper_21110.jpg
 crypdick@pito  ~  

I checked the jpegs, there is nothing wrong with them.

@dzmanto
Copy link

dzmanto commented Sep 14, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 14, 2017

crypdick@pito  ~  convert /home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg -fill white -box "#00000080" -gravity South -pointsize 22 -size 1024 -annotate +0+0 " test title1 " /home/crypdick/Pictures/Bing/bing_wallpaper_17121.jpg 

convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1362.

@dzmanto
Copy link

dzmanto commented Sep 14, 2017 via email

@crypdick
Copy link
Author

 ✘ crypdick@pito  ~/Apps/tools   master  convert -version 
Version: ImageMagick 6.9.9-11 Q16 x86_64 2017-09-03 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenCL OpenMP 
Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib

@dzmanto
Copy link

dzmanto commented Sep 15, 2017 via email

@crypdick
Copy link
Author

mogrify: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1362

@dzmanto
Copy link

dzmanto commented Sep 15, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 16, 2017

 crypdick@pito ~  gs -version
GPL Ghostscript 9.21 (2017-03-16)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.

@dzmanto
Copy link

dzmanto commented Sep 17, 2017 via email

@crypdick
Copy link
Author

Ah, it sounds like we're getting close.

 crypdick@pito  ~  convert -list fonts 
convert: unrecognized list type `fonts' @ error/convert.c/ConvertImageCommand/2053.

@dzmanto
Copy link

dzmanto commented Sep 17, 2017 via email

@crypdick
Copy link
Author

@dzmanto
Copy link

dzmanto commented Sep 18, 2017 via email

@crypdick
Copy link
Author

Success!

bing_wallpaper_17121

@dzmanto
Copy link

dzmanto commented Sep 21, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 22, 2017

Hmm. It updated my background without any errors, but I don't see any text. Edit: I wonder if it's just that the text is being covered by my taskbar. What line should I edit to make the title print in the center of the image?

@dzmanto
Copy link

dzmanto commented Sep 22, 2017 via email

@crypdick
Copy link
Author

crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
/usr/bin/wc
8
17

@dzmanto
Copy link

dzmanto commented Sep 22, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 22, 2017 via email

@dzmanto
Copy link

dzmanto commented Sep 23, 2017 via email

@crypdick
Copy link
Author

Ah yes! They are properly annotated!

@dzmanto
Copy link

dzmanto commented Sep 24, 2017 via email

@crypdick
Copy link
Author

Linux pito 4.9.51-1-MANJARO #1 SMP PREEMPT Wed Sep 20 10:37:40 UTC 2017 x86_64 GNU/Linux

@dzmanto
Copy link

dzmanto commented Sep 25, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 26, 2017

The output is "WM". My actual environment is i3wm.

@dzmanto
Copy link

dzmanto commented Sep 26, 2017 via email

@crypdick
Copy link
Author

Output:

 crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
south
bitstream annotating background image
convert: missing an image filename `south' @ error/convert.c/ConvertImageCommand/3255.
bing_wallpaper.sh: line 265: -composite: command not found

No annotation on the wallpaper fyi.

@dzmanto
Copy link

dzmanto commented Sep 27, 2017 via email

@crypdick
Copy link
Author

crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 

south
bitstream annotating background image
convert: unrecognized gravity type `-composite' @ error/convert.c/ConvertImageCommand/1721.

I inspected the picture in /tmp/ and it did not have an annotation.

@dzmanto
Copy link

dzmanto commented Sep 29, 2017 via email

@crypdick
Copy link
Author

crypdick commented Sep 30, 2017

No annotation :( Here's the CLI output:

 crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
WM
north
bitstream annotating background image
convert: missing an image filename `north' @ error/convert.c/ConvertImageCommand/3255.
bing_wallpaper.sh: line 268: -composite: command not found

@dzmanto
Copy link

dzmanto commented Sep 30, 2017 via email

@crypdick
Copy link
Author

crypdick commented Oct 6, 2017

Sorry for the delayed response. Somehow the notification was cleared before I saw it. The wallpaper downloaded and was annotated properly 💯

 crypdick@pito  ~/Apps/bing-desktop-wallpaper-changer   master  sh bing_wallpaper.sh 
WM
north
bitstream annotating background image

@dzmanto
Copy link

dzmanto commented Oct 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants