Desktop Widgets

Moderator: Forum moderators

Post Reply
User avatar
Geoffrey
Posts: 32
Joined: Wed Jul 15, 2020 10:46 am
Location: Bucca, Queensland, Australia
Has thanked: 2 times
Been thanked: 13 times

Desktop Widgets

Post by Geoffrey »

I compiled get2desklet64-3.1 in Bionic64, Gtk2desklet is used to create desktop widgets.
gtk2desklet64-3.1.pet
(9.83 KiB) Downloaded 119 times

Get source here https://www.dropbox.com/sh/k1hn0un11p39 ... tk2desklet

Animwall Desktop Widget overlays the desktop
animwall_desktop_widget-1.01.pet
(1.69 KiB) Downloaded 92 times

Image

Image

Download the sample gif to try it out

Code: Select all

#!/bin/bash
# Animwall a gtkdialog-desklet animated gif background widget.
# use with small file size animated gif's is recommended.
# Suitable as a wallpaper if a none active desktop is acceptable,
# as no icons or rightclick menus are accessible. 
# To use select an animated gif file of appropriate dimensions
# and file size, select "Start", this will resize the gif to 
# desktop dimensions and create a script /root/Startup/anim_wall
# and runs the script, widget runs at startup.
# Selecting "Stop" kills the process and removes anim_wall from /root/Startup
# Geoffrey 22/07/2020
ps   >  /tmp/anim_wall.run
	if grep -c 'program=ANIM_WALL_GUI' /tmp/anim_wall.run; then 
	rm -f /tmp/anim_wall.run
	exit 0
	fi
	rm -f /tmp/anim_wall.run
mkdir -p /root/.config/animwall	

STOP_ANIMWALL(){
kill `ps | grep program=ANIMWALL | grep -v grep | awk '{print $1}'`
exit 0  	
}
export -f  STOP_ANIMWALL

START_ANIMWALL(){
echo "#!/bin/sh
ps   >  /tmp/animwall.run
	if grep -c '"'program=ANIMWALL'"' /tmp/animwall.run; then 
	rm -f /tmp/animwall.run
	exit 0
	fi
	rm -f /tmp/animwall.run
export ANIMWALL='<window margin="'"0"'" decorated="'"false"'" skip-taskbar-hint="'"true"'">
<pixmap><input file>/root/.config/animwall/anim.gif</input></pixmap>
</window>'  
gtkdialog-desklet --center --program=ANIMWALL " > /root/Startup/anim_wall
chmod a+x /root/Startup/anim_wall
exit 0  	
}
export -f  START_ANIMWALL

export RES=`xdpyinfo | grep dimensions | awk '{print $2}'`
CREATE(){
	gifsicle -i --resize $RES < $GIF > /root/.config/animwall/anim.gif
	gifsicle -i --resize-height 256 < $GIF > /root/.config/animwall/preview.gif
exit 0  	
}
export -f  	CREATE

export ANIM_WALL_GUI='	
<window title="Animwall Desktop Widget" image-name="/usr/share/pixmaps/preferences-desktop-wallpaper.png" resizable="false" decorated="true">
  <vbox spacing="0">
    <pixmap>
    <variable>IMAGE</variable>
    <input file>/root/.config/animwall/preview.gif</input>
    </pixmap>
    <hbox><text xalign="1" use-markup="true" width-chars="16"><label>Animated Gif</label></text>
	<entry fs-action="newfile" 
					fs-filters="*.gif"
					fs-title="Select an animated gif">
					<variable>GIF</variable>
	</entry>
	<button relief="2" tooltip-text="Select an animated gif" use-underline="true">
	<input file stock="gtk-open"></input>
	<action type="refresh">IMAGE</action>
	<action>fileselect:GIF</action>
	<action>CREATE</action>
    <action type="refresh">IMAGE</action>
    </button>
 	</hbox>
	<hbox space-fill="true" expand="true" homogeneous="true">
	<button use-underline="true">
		<label>'"▶ _Start"'</label>
		<action>STOP_ANIMWALL</action>
		<action>START_ANIMWALL</action>
		<action>/root/Startup/anim_wall &</action>
	</button>
	<button use-underline="true">
		<label>'"■ _Stop"'</label>
		<action>STOP_ANIMWALL</action>
		<action>rm -f /root/Startup/anim_wall</action>
	</button>
	<button use-underline="true">
		<label>✖ _Quit</label>
	</button>
	</hbox>
  </vbox> 
</window>'
gtkdialog --center --program=ANIM_WALL_GUI
exit 0
User avatar
mikewalsh
Moderator
Posts: 6038
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 738 times
Been thanked: 1904 times

Re: Desktop Widgets

Post by mikewalsh »

Hiya, Geoff.

I've been doing summat similar for a while now. Fred came up with a small utility - originally for his Debian Dogs - that would let you put an animated GIF onto the desktop. It, too, uses gtk2-desklet, I think from the Debian repos.

This is my Xenialpup64. Look closely, and see if you can spot the GIFs....


Image


Bottom left corner, there's my wee puppy, endlessly romping across the desktop:-


Image


Up in the main launcher area, there's a small, spinning globe:-


Image


I wanted a simple way to launch all the different portable-browsers that I've built, rather than digging around in the Menu. Following a conflab with Fred - my bash skills are still not so hot! :oops: - he modified the GIF script I use for my wee Puppy so that clicking on the GIF would permit assigning a function to it. The 'globe', when clicked, brings up a YAD-powered 'selector' Menu, just for browsers; like so:-


Image


Neat, huh?

-----------------------------------------------------

I'm of the same opinion as Fred.....that visual demonstrations of things simplify comprehension. You don't always want a full-blown video (though we now have that option); sometimes a simple short GIF is perfectly adequate to get your point across. To this end, Fred 'modified' TakeAShot, and built TakeAGif.....which allows you to create short GIF sequences directly at the click of a button. The above images were all created with it.

And folks call Puppy boring.....and scathingly refer to it as a 'toy' distro, not suitable for 'real' work. If only they knew.... :roll: I can do 'serious' work with Puppy whenever I need to (after all, this new forum is, I believe, Puppy-powered!).....but I just love "playing" with her..!!


Mike. ;)
Post Reply

Return to “Desktop”