LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > DamnSmallLinux
User Name
Password
DamnSmallLinux This forum is for the discussion of DamnSmallLinux.

Notices


Reply
  Search this Thread
Old 05-26-2009, 03:27 PM   #1
htrboy
LQ Newbie
 
Registered: Sep 2007
Posts: 8

Rep: Reputation: 0
Scripts on digital picture frame running DSL


Hi All,

I've made a digital picture frame with an old Thinkpad 600E running DSL version (um, I think) 4.3.7 (maybe??). It works pretty well with a couple minor irritations that I'm hoping to figure out with some help.

On power up, it's supposed to auto login, start up a bash window with aterm (for emergency access if SSH doesn't work), and then start a slideshow using the viewer program FEH. It does all of the above, but it starts FEH under the terminal window so that I have to manually either restart the slideshow so that it covers the window, or minimize the window with the mouse (hope that makes sense). Here is a copy of my .xinitrc file if that helps:

dsl@1[dsl]$ vim .xinitrc
1 # put X windows programs that you want started here.
2 # Be sure to add at the end of each command the &
3 # Begin DPF section
4
5 xset s off &
6 noblank &
7
8 cron &
9
10 /usr/bin/aterm -T "Bash" -e /bin/bash &
11
12 /home/dsl/frame/cron_start_frame.sh &
13
14 # End DPF section
15
16 KEYTABLE="$(getknoppixparam.lua KEYTABLE)"
17 DESKTOP="$(getoption.lua $HOME/.desktop wm)"
18 ICONS="$(getoption.lua $HOME/.desktop icons)"
19
20 umix -lf .umix 2>/dev/null
21
22 [ -f .mouse_config ] && sh .mouse_config &
23

The other small issue is that I have a cron job that runs a script to check my photo folder every few minutes, and if there are any changes (new pics added etc.) the script is supposed to run a second script that kills the currently running slideshow then restarts FEH to include the new pictures.

The cron job runs fine and it gets as far as killing the slide show, but it doesn't restart FEH, and I have to restart it by manually running the restart script via SSH.

Here's a copy of the cron and the other scripts in case it helps:

dsl@1[opt]$ vim crontab
1 #* * * * * * echo Cron timestamp `date` >> /tmp/crontest
2 #
3 #
4 # Check Photo folder every 5 min
5 /5 * * * * * /home/dsl/frame/checkdir.sh
6 #45 22 * * 1-7 * /home/dsl/frame/turn_off_screen.sh
7 #59 5 * * 1-7 * /home/dsl/frame/turn_on_screen.sh

dsl@1[frame]$ vim checkdir.sh
1 #/bin/bash
2 #monitor directory
3
4 mv /home/dsl/frame/photos.lst /home/dsl/frame/photos.last
5 ls -R /home/dsl/frame/photos > /home/dsl/frame/photos.lst
6 cmp --quiet /home/dsl/frame/photos.lst /home/dsl/frame/photos.last
7 exitcode=$?
8
9 if [ $exitcode -ne 0 ] ; then
10 echo .New Files... Reloading Frame.
11 /home/dsl/frame/cron_reload_frame.sh
12 else
13 echo .Yawn....
14 fi
15
16 exit 0


dsl@1[frame]$ vim cron_reload_frame.sh
4 # drware@thewares.net
5 #
6
7 # Change number below to the duration, in seconds
8 # for each photo to be displayed
9 DELAY="300"
10
11 # Set display so that the script will effect
12 # the screen on the frame
13 export DISPLAY=:0.0
14
15 # Stop the currently running Slide show
16 /home/dsl/frame/kill.sh feh
17
18 sleep 10s
19
20
21
22 # Start slide show
23 feh -q -r -z -F -Z -x -D $DELAY /home/dsl/frame/photos/
24
25
26 exit 0


dsl@1[frame]$ vim kill.sh
1 #!/bin/bash
2
3 if [ ! -z "$1" ]; then
4 PROCESS=$1
5
6 PIDS=ps | grep $PROCESS | awk '{print $1}' | pkill $PROCESS
7
8 fi

Any help appreciated! Like I said, I'm pretty happy with DSL and the frame, but I'd love to solve these small issues...
 
Old 05-29-2009, 04:58 PM   #2
htrboy
LQ Newbie
 
Registered: Sep 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Okay - a clue:

Now it looks like when the 'checkdir.sh' script runs and it sees a change in the photo folder, it runs cron_reload_frame.sh like it's supposed to, which then runs kill.sh - that kills feh like its supposed to but then it reports "./cron_reload_frame.sh: line 23: feh nnnnn Terminated feh -q -r -z -F -z -x -D $DELAY /home/dsl/photos/"

where nnnnn is the number of the process terminated.

Does this mean that the way I'm killing feh in the kill.sh script isn't letting feh restart?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help newbie use Linux to make a Digital Picture Frame Daravon Linux - General 16 09-02-2008 12:05 PM
Distro recomendations for old laptop to use as digital picture frame 98z3 Linux - Distributions 7 08-28-2008 09:19 PM
Junk notebook --> digital picture frame help! viewsonix Linux - Newbie 1 07-14-2007 01:15 AM
Digital Picture Frame Startup Scripts - Auto Login gtwilliams Linux - General 4 08-01-2006 04:43 PM
Digital Picture Frame advice needed Heathicus Linux - Software 6 05-18-2006 04:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > DamnSmallLinux

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration