Animated Gif wallpaper

A home for all kinds of Puppy related projects
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Animated Gif wallpaper

#1 Post by greengeek »

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).

EDIT : some great ideas in the responses here. Thank you
Please also see the following thread for other methods: http://www.murga-linux.com/puppy/viewtopic.php?t=113495
and this post: http://murga-linux.com/puppy/viewtopic. ... 184#954184
.
Last edited by greengeek on Sun 27 May 2018, 18:31, edited 2 times in total.

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#2 Post by puppyluvr »

:D 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: Select all

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

The conky.rc file sets the size like this:

Code: Select all

 TEXT
   ${image image1.jpg -n -p 0,0 -s 200x150}
8)
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...

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#3 Post by SFR »

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: Select all

#!/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!
Last edited by SFR on Tue 17 May 2016, 18:06, edited 2 times in total.
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#4 Post by puppyluvr »

:D 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...

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#5 Post by puppyluvr »

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

Copy the following into a script:

Code: Select all

 #!/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.

:D

#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...

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#6 Post by puppyluvr »

:D Hello,
If you dont need icons, try this:
(CHANGE THE 1440X900 TO YOUR RESOLUTION)

Code: Select all

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: Select all

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...

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#7 Post by puppyluvr »

:D 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...

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#8 Post by SFR »

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: Select all

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: Select all

#!/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!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#9 Post by puppyluvr »

:D 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.....
8)
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...

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#10 Post by Geoffrey »

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?
Last edited by Geoffrey on Mon 18 Dec 2017, 05:45, edited 1 time in total.
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#11 Post by greengeek »

.
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...
Attachments
SFR_2.gif
(88.1 KiB) Downloaded 2185 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#12 Post by greengeek »

puppyluvr wrote:: Here is an example:
https://youtu.be/nIjm2yJGALc
Hi PL - nice demonstration. Are you running compiz??

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#13 Post by greengeek »

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.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#14 Post by SFR »

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: Select all

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: Select all

compton --vsync drm
And pqiv with these:

Code: Select all

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: Select all

echo '<window type-hint="7"><pixmap><input file>/path/to/anim.gif</input></pixmap></window>' | gtkdialog -s --gtk-module=gtk2desklet -G +600+400
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#15 Post by greengeek »

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: Select all

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.
Attachments
framed.jpg
(21.39 KiB) Downloaded 1663 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#16 Post by greengeek »

puppyluvr wrote: As for the wallpaper request I found it is possible.
Using xwinwrap from here:
http://tech.shantanugoel.com/resources/ ... inwrap.zip.
I havent had any success with this yet. Anyone else getting this going ok yet? Will keep trying.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#17 Post by goingnuts »

I got xwinwrap working - sort of. Below script runs OK but I need to give focus to ROX background for the image to turn up (click on the background)...Thats a ROX-thing - running without ROX shows image immediately on the root-background

Code: Select all

#!/bin/sh
# Uses xwinwrap to display given animated .gif in the center of the screen
#original from https://sathisharthars.wordpress.com/tag/xwinwrap/
if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 image.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 -I $1 | grep logical | cut -d " " -f5)
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

exit

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#18 Post by puppyluvr »

:D Helli,
Its amazing what a single question can produce here!!!
8)
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...

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

#19 Post by ETP »

Even later to the party :) I stumbled accross this site this morning and took a fancy to the rotating globe:

http://eventregistry.org/

Incorrectly assuming at first that it was an animated gif I googled "Puppy Linux animated desktop" which
brought me to this thread. Upon returning to the above site it transpired that it uses I think, a series
of png files. A different approach was therefore needed which for the record I am including here.

That involved capturing a 47 second 30fps mkv video using SSR and then using mpv to play a looped video of the recording.
The wallpaper was set to match the background of the video.
mpv has about 470 cli commands including --geometry so it is possible to play such a video anywhere on screen and
to resize it. CPU usage is only 1%.

As I wanted it center screen I however called another script to do that.

A one minute 1080p unlisted YT video of the result follows together with copies of the scripts:

https://youtu.be/7FThgscLkTI

Code: Select all

#!/bin/sh
#
# This is mpv_test_globe.sh      ETP 10th July 2017.
#
#sleep 20 # Uncomment & adjust period as required if this script is placed in /root/Startup
#
/usr/bin/mpv --no-border --loop /root/Downloads/globe.mkv &
#
# Extra script called to ensure any window is always centered on screen. ETP JUly 2017
#
sleep 1.5
bash /root/noob/center_active_window.sh

Code: Select all

#!/bin/sh
# This is /root/noob/center_active_window.sh  ETP 2nd May 2017.
# Call it from the end of any other launch script using the bash command to center app window on any screen.
# Bash is used in order to allow command substitution. Add a sleep of 2 or 3 seconds to allow app such as
# vlc to launch before calling it. (See example in /root/noob/BBC_News_Live_720p
#
#
IFS='x' read screenWidth screenHeight < <(xdpyinfo | grep dimensions | grep -o '[0-9x]*' | head -n1)

width=$(xdotool getactivewindow getwindowgeometry --sh | head -4 | tail -1 | sed 's/[^0-9]*//')
height=$(xdotool getactivewindow getwindowgeometry --sh | head -5 | tail -1 | sed 's/[^0-9]*//')

newPosX=$((screenWidth/2-width/2))
newPosY=$((screenHeight/2-height/2))

xdotool getactivewindow windowmove "$newPosX" "$newPosY"
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#20 Post by rufwoof »

Thanks for sharing that ETP.

I had to add a inf (for infinite loops) parameter to the loop option. I used openshot to create a 3D title (rotate), but that had a grey background. I edited the rotate.py script as per this posting hoping for a transparent background, but it was black.

I've also been playing around with Mike's type desktop theming/layout. What with that animation and gkrellm presenting system monitoring updates ... quite a busy desktop

Fun stuff to whileaway some humid time in front of the ac. Thanks.
Attachments
s.jpg
(40.38 KiB) Downloaded 890 times

Post Reply