Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 19 Aug 2017, 13:05
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Desktop-Slideshow
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 1967
Location: In The Way

PostPosted: Mon 18 Apr 2016, 15:04    Post subject:  Desktop-Slideshow
Subject description: wallpaper changer
 

I was using Nathan's Wallpaper changer on a recent slacko and noticed that it didn't handle file names with spaces very well (not at all!). I then checked my app previously called ChangeOn (I wrote this before ever I heard of Nathan's Wallpaper changer), which had the same problem. I fixed it!!

Recently I read on github that Nathan's Wallpaper changer slideshow function must be stopped prior to shutting down or the puppyppin would become corrupt ... this isn't an issue with (ChangeOn) re-named to Desktop-Slideshow.

Desktop-Slideshow also remembers pic selections across reboots. wallpapers/pics can be added anytime, or removed or deleted from system. Intervals for change can be less than 1 second to infinity (might add a random time function in there and random selection too (why not?))!
Desktop-Slideshow.pet
Description 
pet

 Download 
Filename  Desktop-Slideshow.pet 
Filesize  2.73 KB 
Downloaded  101 Time(s) 
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 1967
Location: In The Way

PostPosted: Sun 19 Mar 2017, 07:10    Post subject:  

Here is an update to DesktopSlidesow (changeon and changeongui)

Now there is a checkbox to select 'Scale' image or 'Stretch' image, Scale is default. CLI 'changeon Centre' also allows 'Centre'.

Another checkbox shows path and name of image using conky, at top_middle of display.

Time interval now has drop down selector set at defaul 2 seconds and rnging from 0.1 to 900 seconds. User typed input also possible.

Code:
#!/bin/sh
#desktopslideshow aka changeon changeongui by stemsee copyright (c) 2015 Marcos Contant
#

slpfn () {
   unset $slp
   slpm=$(yad --geometry=380x30+0+0 --title "Interval Show Mode" --item-separator="," --form --field="Interval:CBE" "2,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100,200,300,400,500,600,700,800,900" --field="Default Scaled\nCheck to Stretch:CHK" --field="Show names:CHK")
   slp=`echo $slpm | cut -f1 -d'|'`
   m1=`echo $slpm | cut -f2 -d'|'`
   sn=`echo $slpm | cut -f3 -d'|'`
case $m1 in
TRUE) mode=Stretch;;
FALSE) mode=Scale;;
esac
}

addwpfn () {
cd /usr/share/backgrounds
wp=`yad --title "Select Wallpapers" --geometry=400x500+10+10 --file-selection --multiple --add-preview | tr ' ' '#' | tr '|' '\n'`
ret=$?
[[ $ret -eq 1 ]] && exit 1
}

case $1 in
Stretch|stretch) mode=Stretch;;
Scale|scale) mode=Scale;;
Centre|centre) mode=Centre;;
*) mode=Scale;;
esac

changefn () {
for file in $wp
do
file=`echo $file | tr '#' ' '`
nice --19 rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
 <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
  <SetBackdrop>
   <Filename>$file</Filename>
   <Style>$mode</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>
EOF
#wid=`xdotool getwindowid`
#export wid
#[[ /etc/hotbar/restart_bar ]] && restart_bar
fnm=`echo "$file" | rev | cut -f1 -d'\' | rev`
[[ "$sn" = TRUE ]] && conky2 -x 10 -y 10 -t "$fnm" -f sans:size=14 -a top_middle &
conkpid=$!
sleep "$slp"
kill $conkpid
done
changefn
}

if [ "$1" = step ]; then
   wp=`cat $HOME/.wp`
for file in $wp
do
file=`echo $file | tr '#' ' '`
nice --19 rox --RPC<< EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
 <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
  <SetBackdrop>
   <Filename>$file</Filename>
   <Style>Scale</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF
fnm=`echo "$file" | rev | cut -f1 -d'\' | rev`
[[ "$sn" = TRUE ]] && conky2 -x 10 -y 10 -t "$fnm" -f sans:size=14 -a top_middle &
conkpid=$!
sleep "$slp"
kill $conkpid
read dummy
if [[ "$dummy" = d ]]; then
   linenum=`cat $HOME/.wp | grep -n "$file"`
   linenum=`echo $linenum | cut -f1 -d ':'`
for f in $linenum
do
   sed -i "$linenum"d $HOME/.wp
done
fi
done
exit
fi
if [ "$1" = reset ]; then
   rm -f $HOME/.wp
   rm -f $HOME/.sleep
fi
if [ "$1" = stop ]; then
   killall changeon
fi
if [ "$1" = add ]; then
   addwpfn
   echo "$wp" >> $HOME/.wp
   exit
fi
if [ "$1" = edit ]; then
   geany $HOME/.wp
fi

if [ ! -f $HOME/.wp ]; then
   addwpfn
   echo "$wp" > $HOME/.wp
else
   wp=`cat $HOME/.wp`
fi
killall slpfn
slpfn
if [ -z "$slp" ]; then
   slp=20
fi
changefn
if [[ "$1" = vbar ]]; then
[[ /etc/hotbar/restart_bar ]] && restart_bar
fi


gui
Code:
#!/bin/bash
#

RET=$(export Changeongui='
<window title="  Desktop Slideshow">
<vbox>
<hbox>
    <button>
      <label>Start Slide Show</label>
      <action>changeon stop</action>
      <action>killall conky2</action>
      <action>changeon &</action>
      <action>exit 0</action>
      </button>
   <button>
      <label>Add Slide</label>
      <action>changeon add</action>
      <action>exit 0</action>
    </button>
      <button>
      <label>Stop Slide Show</label>
      <action>changeon stop</action>
      <action>killall conky2</action>
      <action>exit 0</action>
    </button>
 </hbox>
     <button>
      <label>Select Slides</label>
      <action>changeon stop</action>
      <action>changeon reset &</action>
      <action>exit 0</action>
    </button>
     <button>
    <label>Edit Slide list</label>
    <action>changeon edit &</action>
          <action>exit 0</action>
    </button>
    <button>
    <label>Preview Slides (Enter)|(d) permanent delete</label>
    <action>changeon stop</action>
    <action>urxvt -e changeon step</action>
    </button>
    <button>
    <label>Rename Background Images</label>
    <action>rox /usr/share/backgrounds/</action>
    </button>
  </vbox>
 </window>
 '

gtkdialog --program=Changeongui)


eval $RET

echo -e "\n$RET\n"

[ "$EXIT" != OK ]&& exit   

exit
xscreenshot-20170319T140406.png
 Description   
 Filesize   41.31 KB
 Viewed   100 Time(s)

xscreenshot-20170319T140406.png

Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0587s ][ Queries: 15 (0.0081s) ][ GZIP on ]