e-mailing photos direct to joggler

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

e-mailing photos direct to joggler

Post by iamFuNgUs »

Does anyone know if it is possible to e-mail photos directly to an o2 joggler?
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

With the default firmware and opera with a webmail account, you can just pick up your email that way. with the additional distributions you can do it in a similar way. you could even set something up like a special account, use fetchmail, get it to download email, extract images and automatically add them to a slideshow ;-) requires some scripting knowledge but this is the sort of thing I like about linux, and its flexibility.
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

Adding straight to a slide show is what i am after, i am no good at scripting but i will certainly look into it. I am going back packing and think it would be quite cool if i could e-mail/add pics to slide show for my parents whilst away.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

something like this looks like it would be a good starting point. http://www.howtolinuxhelp.com/subject-r ... raman.html
in your case instead of sending the images to the printer, you just copy them to the screensaver folder, in fact you can just point uudeview to the folder, so the script on that link would only need some minor changes.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

Just made a quick proof of concept (I liked your idea and thought it must be tried!) and it works well. This should work on all the ubuntu based distros i provide for the joggler.

I set up an email account specifically for this for testing.

First install some tools we need

Code: Select all

sudo apt-get install uudeview fetchmail
and create some directories

Code: Select all

mkdir -p /home/joggler/AutoPictures/{Mail,Pictures}
Then create a file called .xscreensaver in /home/joggler with the following contents:

Code: Select all

imageDirectory: /home/joggler/AutoPictures/Pictures
and a file .fetchmailrc in /home/joggler with the following contents:

Code: Select all

poll yourmailserver
proto POP3
user youremaillogin
pass yourpassword
this should be chmodded to 600 with

Code: Select all

chmod 600 .fetchmailrc
then i make a script to grab the emails and process the attachments. call it whatever you like

Code: Select all

#!/bin/bash
FILETYPES=.jpg
FILENAME=$(date +%H%M%S).txt
MAILDIR=~/AutoPictures/Mail
PICDIR=~/AutoPictures/Pictures
/usr/bin/fetchmail --bsmtp $MAILDIR/$FILENAME
if [ "$?" = "0" ]; then
  /usr/bin/uudeview +e $FILETYPES -p $PICDIR -i $MAILDIR/$FILENAME
  rm ~/.xscreensaver-getimage.cache
  # if you want to remove the emails as they are received
  # rm $MAILDIR/$FILENAME
fi
and chmod u+x the script

and tell it to run at a certain time

Code: Select all

crontab -e
with the contents

Code: Select all

*/10 * * * * /path/to/yourscript.sh
now do

Code: Select all

sudo nano -w /usr/share/applications/screensavers/glslideshow.desktop
and where you have "Exec=/usr/lib/xscreensaver/glslideshow -root" change it to

Code: Select all

Exec=/usr/lib/xscreensaver/glslideshow -root -pan 6 -duration 6
now we need to rebuild a cache so this config change is picked up. You might want to logout/back in after doing this.

Code: Select all

sudo /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications > /usr/share/applications/desktop.en_GB.utf8.cache
That should be it. every 10 mins the script should run, download email and decode any jpgs to the AutoPictures/Pictures folder. It then removes the screensavers image cache so it picks up the new images.

[edit]
after this initial set-up there was one issue. the same image was shown again and again. seems that gnome-screensaver is a bit restrictive and unconfigurable by default. i installed "xscreensaver" and ran xscreensaver-demo and used that to configure the glscreensaver settings and it worked well after that. I would be inclined to do this anyway http://www.ubuntugeek.com/how-to-replac ... buntu.html
or alternatively http://emresaglam.com/blog/924 (that last link works for me here, without configuring with xscreensaver). I had just missed the cache file before.

[edit] I have now fixed up the above code and instructions so that you can ignore the previous remarks above. the code removes the image cache
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

Nice one, i will deffo have a fiddle with it ;), any particular ubuntu distro you'd suggest? Maverick i'd assume.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

the most "touch screen friendly" is jolios, and this would work on that too. I actually use that now, even though I started of with linux mint etc. try em all and decide which gui you like best ;-)
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

Hi,

I've had a play and apart from my hotmail account not being made correctly. I am a little confused when it comes to the bottom end of you instructions.

I've created the script and called it .grab, then gone back into terminal and typed chmod u+x .grab, that seems to run ok but when i do crontab -e it gives me a choice of 3, i select 2 which is nano (just because i see nano in the commands below).

This gives me a terminal windows called GNU nano 2.2.4, i am assuming i type the rest of the code in here? once i've done this how do i save? if i just close it it says theres still processes running, tried this once and when i reopened it it was blank. This is confusing me a little, any ideas where i am going wrong?
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

iamFuNgUs wrote: This gives me a terminal windows called GNU nano 2.2.4, i am assuming i type the rest of the code in here? once i've done this how do i save? if i just close it it says theres still processes running, tried this once and when i reopened it it was blank. This is confusing me a little, any ideas where i am going wrong?
ctrl+o then enter to save.

http://www.tuxradar.com/content/text-ed ... -made-easy
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

ah cool, i see. Cheers for that. Mine doesn't seem to be working at the moment, will redo it all again once the sun has gone ;)

Ignore that, got that working now.
Last edited by iamFuNgUs on Fri Apr 29, 2011 12:02 pm, edited 1 time in total.
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

Realised what i was doing wrong for the last bit, only thing i can see now is the final command sudo /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications > /usr/share/applications/desktop.en_GB.utf8.cache gives me access denied, i haven't set any admin accounts etc its just a distro i downloaded from a link on this forum (Ubuntu 10.10 (Maverick) (Joggler Image v1.10 - 23/04/2011), any ideas? sorry to keep asking, total newbie when it comes to linux
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

iamFuNgUs wrote:Realised what i was doing wrong for the last bit, only thing i can see now is the final command sudo /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications > /usr/share/applications/desktop.en_GB.utf8.cache gives me access denied, i haven't set any admin accounts etc its just a distro i downloaded from a link on this forum (Ubuntu 10.10 (Maverick) (Joggler Image v1.10 - 23/04/2011), any ideas? sorry to keep asking, total newbie when it comes to linux
sorry I made a mistake. it should be

sudo -s
then /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications > /usr/share/applications/desktop.en_GB.utf8.cache

else the pipe will be done from the non sudo user.
iamFuNgUs
Posts: 7
Joined: Tue Apr 05, 2011 4:31 pm

Re: e-mailing photos direct to joggler

Post by iamFuNgUs »

still giving me permission denied unfortunately.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

Re: e-mailing photos direct to joggler

Post by BuZz »

iamFuNgUs wrote:still giving me permission denied unfortunately.
when do you "sudo -s" you get a prompt with a # ?

then the second line should do it.
Post Reply