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 18 Nov 2017, 06:31
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Animated Gif wallpaper
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Author Message
greengeek


Joined: 20 Jul 2010
Posts: 4712
Location: Republic of Novo Zelande

PostPosted: Tue 17 May 2016, 02:31    Post subject:  Animated Gif wallpaper
Subject description: Is it possible???
 

I would like my Puppy to have an animated gif as it's desktop wallpaper. Is this possible? If not can anyone suggest a way it could be attempted?

ps: If it isn't possible to have the whole wallpaper as an animated gif I would probably settle for having a portion of the desktop displaying an animated gif if it could be displayed without borders or title bar - eg: I could have a black desktop with an animated gif in the centre.
(Probably the gif portion would be incapable of supporting icons - but I could live with that if theres no other way).
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Tue 17 May 2016, 08:45    Post subject:  

Very Happy Hello,
I doubt the full wallpaper idea is possible.
However, the other idea is.
Conky can display an image, gif, video in a borderless window wherever you specify.
This locates the image:

Code:
exec conky -c $dir/conky.rc -x 12 -y 720


The conky.rc file sets the size like this:

Code:
 TEXT
   ${image image1.jpg -n -p 0,0 -s 200x150}


Cool

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1640

PostPosted: Tue 17 May 2016, 11:25    Post subject:  

Hey guys

I used to have an animated wallpaper back in the XP days (they removed that feature in 7 or Vista).
I don't know any method to do it using ROX itself, though...

@Puppyluvr: are you sure Conky is able to display _animated_ GIFs?
I tried and failed with v1.7.2 (no lua, only imlib2).
What version (built with what features) do you have?
Btw, I found this thread and it seems it's possible, but quite tricky to accomplish.
Actually, I can do it similarily using Gtkdialog (see below).

@Greengeek: The following method has some limitations and drawbacks:
- can be very resource hungry, especially when GIF has large dimensions and size, many frames and low delay between them
- the delay used by <timer> widget is taken from the first frame and it remains constant, so if it changes somewhere along the way in the original GIF, it won't be taken into account
- as you suspected, no-go for icons in that area
- if GIF has transparent background, you'll be seeing Gtkdialog window's background instead (color depends on current GTK theme, I suppose)
- some GIFs may be displayed with a "noise", because gifsicle is unable to "explode" them to stand-alone, unoptimized frames properly

Anyway, try and see if it's usable with your GIF. I used (mainly) this one for testing.

EDIT: corrected the code a bit - just stumbled across a GIF that contains no info of used delay.

Code:
#!/bin/ash

###############################################################################
# D4AG v0.2 - "Desklet 4 Animated GIFs" by SFR'2016                           #
# GNU GPL v2 applies                                                          #
# Req.: gtkdialog >= 0.8.3, gifsicle                                          #
###############################################################################

# Note: right-click the animation to quit

# =============
# User settings
# =============

GIFPATH=/root/anim.gif
X_POS=100
Y_POS=100
CENTER=true      # if 'true' - overrides X_POS and Y_POS
CUSTOM_DELAY=   # in milliseconds - overrides delay from original GIF

# =============================================================================

WORKDIR="/tmp/D4AG_${USER}_${$}"
mkdir -p "$WORKDIR"
trap 'rm -rf "$WORKDIR"' 0 INT TERM HUP

# -----------------------------------------------------------------------------

[ -f "$GIFPATH" ] || { echo "Can't find the specified GIF file!"; exit 1; }

gifsicle -e -U --no-background "$GIFPATH" -o "${WORKDIR}"/f

RANGE=`ls "${WORKDIR}"/f.* | wc -l`
DELAY=$(gifsicle -I "$GIFPATH" | grep -m1 -o -i -E 'delay.*[0-9]' | cut -f2 -d '.')0
[ "$DELAY" = "0" ] && DELAY=75
[ "$CUSTOM_DELAY" ] && DELAY="${CUSTOM_DELAY}"

# -----------------------------------------------------------------------------

if [ "$CENTER" = "true" ]; then
  WIN_PARAM='window-position="3"'
  GTK_PARAM=''
else
  WIN_PARAM=''
  GTK_PARAM="-G +${X_POS}+${Y_POS}"
fi

# -----------------------------------------------------------------------------

export MAIN='
<window type-hint="7" resizable="false" margin="0" '${WIN_PARAM}'>
  <vbox spacing="0">
    <eventbox>
      <notebook show-border="false" show-tabs="false" tab-base-index="0">
        '$(for i in ${WORKDIR}/f*; do
             echo "<pixmap><input file>$i</input></pixmap>"
           done)'
        <variable>varINDEX</variable>
        <input>echo $(( ($varINDEX+1) % '${RANGE}' ))</input>
      </notebook>
      <timer visible="false" milliseconds="true" interval="'${DELAY}'">
        <action>refresh:varINDEX</action>
      </timer>
      <action signal="button-press-event" condition="command_is_true([ $PTR_BTN -eq 3 ] && echo true)">exit:EXIT</action>
    </eventbox>
  </vbox>
 
</window>'

gtkdialog ${GTK_PARAM} -p MAIN

exit

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.

Last edited by SFR on Tue 17 May 2016, 14:06; edited 2 times in total
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Tue 17 May 2016, 12:44    Post subject:  

Very Happy Hello,
#SFR, you`re right. Conky will display the .gif but not animate it.
The pages linked use exploding the gif into separate images and flipping through them, like my slideshow method in conky.
Thats feasable enough, and easier than they made it. Since conky reacts instantly to configuration changes a simple script to change the "default" image is all thats needed. As the script cycles the image, conky reacts.

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Tue 17 May 2016, 17:26    Post subject:  

Very Happy Hello,
As for the wallpaper request I found it is possible.
Using xwinwrap from here:
http://tech.shantanugoel.com/resources/downloads/shantz-xwinwrap.zip
I installed the included i386.deb on Tahrpup-6.0.5

Copy the following into a script:
Code:
 #!/bin/sh
# Uses xwinwrap to display given animated .gif in the center of the screen

if [ $# -ne 1 ]; then
    echo 1>&2 Usage: $0 test.gif
    exit 1
fi

#get screen resolution
SCRH=`xrandr | awk '/current/ { print $8 }'`
SCRW=`xrandr | awk '/current/ { print $10 }'`
SCRW=${SCRW%\,}

#get gif resolution
IMGHW=`gifsicle --info $1 | awk '/logical/ { print $3 }'`
IMGH=${IMGHW%x*}
IMGW=${IMGHW#*x}

#calculate position
POSH=$((($SCRH/2)-($IMGH/2)))
POSW=$((($SCRW/2)-($IMGW/2)))

xwinwrap -g ${IMGHW}+${POSH}+${POSW} -ov -ni -s -nf -- gifview -w WID $1 -a


Save it to the directory the .gif is in..
Then invoke it like this:
Script yourgifname.gif

It takes it a minute....
Kill it with:
killall xwinwrap

xwinwrap --help gives details about size, location, transparency etc.

Very Happy

#Edit.
Further reading indicates that this can be used to include xscreensaver or a video...

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Tue 17 May 2016, 20:19    Post subject:  

Very Happy Hello,
If you dont need icons, try this:
(CHANGE THE 1440X900 TO YOUR RESOLUTION)
Code:
xwinwrap -g 1440x900+0+0 -ov -nf -fs -- gifview -w WID $1 -a


I`m still playing with this, its cool

#Edit
That tiles the gif, supposed to fullscreen...
So many options....
You can make the gif fullscreen size like this:
Code:
gifsicle -f --resize 1440x900 test.gif -o test2.gif

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Tue 17 May 2016, 21:44    Post subject:  

Very Happy Hello,
Here is an example:
https://youtu.be/nIjm2yJGALc

Stupid youtube.. hold on..

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1640

PostPosted: Wed 18 May 2016, 07:35    Post subject:  

puppyluvr wrote:
xwinwrap

Nice find!
However, it doesn't work for me with ROX Pinboard - the animation takes place underneath.
Does it work for you with ROX Pinboard and visible/clickable icons?

Well, techincally I can drop xwinwrap and use gifview directly like this:
Code:
gifview -a -w ${WIN_ID} /path/to/anim.gif

where ${WIN_ID} is a window id of the ROX pinboard (taken with xwininfo, e.g. 0x40006e), but in this case:
- the animation is tiled and fills the entire screen
- icons are covered by it, HOWEVER they are clickable (if you remember where given icon is Wink )

Alternatively, gifview has also '--new-window' option. If I use it instead of '-w' it works a bit better.
Icons on the occupied area are not accessible, but still it's better and less resource hungry than my previous (Gtkdialog) attempt.
Here's a simple wrapper for it:

Code:
#!/bin/bash

###############################################################################
# Wrapper for gifview to display animated GIF on top of ROX Pinboard          #
# Req.: gifview, gifsicle, xwininfo                                           #
###############################################################################

# Note: right-click the animation to quit

# =============
# User settings
# =============

GIFPATH=/root/anim.gif
X_POS=0
Y_POS=0
CENTER=true      # if 'true' - overrides X_POS and Y_POS

# =============================================================================

[ -f "$GIFPATH" ] || { echo "Can't find the specified GIF file!"; exit 1; }

read MAXX MAXY <<< `xwininfo -root | awk 'NR>=8&&NR<=9 {print $2}'`

IMGDIM="$(gifsicle -I "$GIFPATH" | grep -iE 'logical.*[0-9]+x[0-9]+' | grep -iEo '[0-9]+x[0-9]+')"
WIDTH="$(echo $IMGDIM | cut -f1 -d 'x')"
HEIGHT="$(echo $IMGDIM | cut -f2 -d 'x')"

if [ "$CENTER" = "true" ]; then
  X_POS=$(( (MAXX/2) - (WIDTH/2) ))
  Y_POS=$(( (MAXY/2) - (HEIGHT/2) ))
fi

WIN_ID=$(xwininfo -root -tree | grep ROX-Pinboard | grep -oE '0x[0-9a-f]+ ')

gifview -g +${X_POS}+${Y_POS} -a --new-window ${WIN_ID} "$GIFPATH"

exit

# =============================================================================

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3451
Location: Chickasha Oklahoma

PostPosted: Wed 18 May 2016, 19:42    Post subject:  

Very Happy Hello,
Well, I have been beating this around for a bit..
The icon problem seems unsolvable. Rox writes the pinboard on its own layer. If I send the BG below it, you cant see it. If I put the gif on that layer it covers the icons.

BTW, I found out that xscreensaver modules have a -window-id switch.
You can use xwininfo to get the window id #.

But the same problem applies. Above the Icons or below the window...
Plus the xsceersaver modules are resource heavy..
Still playing with xwinwrap.....
Cool

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
Geoffrey


Joined: 30 May 2010
Posts: 2307
Location: Queensland

PostPosted: Thu 19 May 2016, 01:17    Post subject:  

I had a play with gif's as wallpapers HERE, uses gtk2desklet 3.1 to embed on the desktop, it CPU intensive, I think xwinwrap is more forgiving.

Was wondering is there a way to layer an image below the wallpaper and then just have a transparent image over the top so icons can still be accessed?

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4712
Location: Republic of Novo Zelande

PostPosted: Thu 19 May 2016, 01:19    Post subject:  

.
Sorry to be so late back to the party.
Thanks for these ideas - this is great! So far I have only tested SFRs 2nd script and I'm really pleased with it. Thanks! More testing to follow...
SFR_2.gif
 Description   
 Filesize   88.1 KB
 Viewed   884 Time(s)

SFR_2.gif

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4712
Location: Republic of Novo Zelande

PostPosted: Thu 19 May 2016, 01:30    Post subject:  

puppyluvr wrote:
: Here is an example:
https://youtu.be/nIjm2yJGALc
Hi PL - nice demonstration. Are you running compiz??
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4712
Location: Republic of Novo Zelande

PostPosted: Thu 19 May 2016, 01:33    Post subject:  

Geoffrey wrote:
I had a play with gif's as wallpapers HERE, uses gtk2desklet 3.1 to embed on the desktop, it CPU intensive, I think xwinwrap is more forgiving.
That is seriously cool Geoffrey. Great example.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1640

PostPosted: Thu 19 May 2016, 07:03    Post subject:  

puppyluvr wrote:
The icon problem seems unsolvable.

Yeah, I think the only way is to modify ROX's sources...

Geoffrey wrote:
Was wondering is there a way to layer an image below the wallpaper and then just have a transparent image over the top so icons can still be accessed?

Tried that. ROX Pinboard doesn't seem to support transparency at all...

Btw, I just realized my first script was an extreme overkill - I forgot <pixmap> is able to display animated GIFs.


Yet another approach I found (and it suits me best) is to use:
- pqiv image viewer (but version 1.0 - anything higher doesn't have one needed feature)
- a composite manager, e.g.: compton

Now, we need a GIF animation with transparent background.
If GIF has solid background, transparency can be added using:
Code:
gifsicle -U --disposal=previous --transparent="#000000" -O2 in.gif > out.gif

(here: all black (#000000) pixels will become transparent)

I'm running compton with this param:
Code:
compton --vsync drm

And pqiv with these:
Code:
pqiv -i -cccc /path/to/anim.gif

The quadruple '-c' option gives this:
pqiv man wrote:
pqiv will draw this well-known chessboard background for transparent images per
default. Use this option to deactivate this behaviour.
If you use this option twice (and your wm supports it), it will cause the window to be transparent.
Use it three times to make the window stay in the background and use it for times to also disable
controls. You can make pqiv behave like a desktop widget this way.

Of course still no icons in the occupied area, but at least there's transparency, so it combines nicely with wallpaper underneath.

EDIT:
Geoffrey wrote:
gtk2desklet 3.1

I ditched gtk2desklet when I switched to FD, where Openbox is default WM.
It didn't work well with my other desklet-like utility.
But I tried it again and, so far, it appears to be the best solution.
Just a single line, no composite manager needed:
Code:
echo '<window type-hint="7"><pixmap><input file>/path/to/anim.gif</input></pixmap></window>' | gtkdialog -s --gtk-module=gtk2desklet -G +600+400

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4712
Location: Republic of Novo Zelande

PostPosted: Fri 20 May 2016, 01:38    Post subject:  

SFR wrote:
But I tried it again and, so far, it appears to be the best solution.
Just a single line, no composite manager needed:
Code:
echo '<window type-hint="7"><pixmap><input file>/path/to/anim.gif</input></pixmap></window>' | gtkdialog -s --gtk-module=gtk2desklet -G +600+400
Not quite so successful for me - I get a wide frame around the gif:

(Slacko 5.6 derivative with jwm 895)

EDIT : Works perfectly after installing the gtk2desklet pet referenced above by Geoffrey.
framed.jpg
 Description   
 Filesize   21.39 KB
 Viewed   669 Time(s)

framed.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
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.0680s ][ Queries: 12 (0.0048s) ][ GZIP on ]