Page 1 of 4

Posted: Sat 24 Dec 2011, 21:40
by seaside
akash_rawal,

Very nice update and thanks especially for the examples section.

I tried an upgrade to Gtk2.16 on pup431 to see if the
type-hint="7" would work then, but it failed there as well.

Since a similar window behaviour can be made by using the <window decorated="false"> tag, is there a way to change
gtkdialog-desklet to allow a window tag?

Thanks again and the operation seems much faster now.

Regards,
s

Upgraded to version 1.1

Posted: Sun 25 Dec 2011, 18:51
by akash_rawal
Upgraded to version 1.1
Changelog:
  • Added a few workarounds for older puppies (still not perfect)
  • Added ability to stretch given background image
  • Added ability to restart gtkdialog
  • Added facility to refresh GTK theme and transparency
  • added optimisation workaround for apps that resize very often
  • Transparency is now enabled for XFCE (Please test)
___________________________________________
seaside wrote: I tried an upgrade to Gtk2.16 on pup431 to see if the
type-hint="7" would work then, but it failed there as well.

Since a similar window behaviour can be made by using the <window decorated="false"> tag, is there a way to change
gtkdialog-desklet to allow a window tag?
Now I am using:

Code: Select all

<window type-hint="7" decorated="false" skip-taskbar-hint="true" skip-pager-hint="true">
Still this is not working to my expectations. Apps appear only on one desktop, raise over other windows when clicked and can be dragged by [Alt] + Drag.

I am purposefully not allowing <window> tag as this can interfere with transparency if gtkdialog is restarted, if user provides option window_position=2 to bring the app under mouse. An alternative is given in the help file as well as in examples.

Anyways Lucid Puppy 511 that I use uses GTK 2.20.

Posted: Sun 25 Dec 2011, 21:55
by 01micko
Hi akash_rawal

I updated to your gtkdialog-desklet-1.1 but I have a problem with wallpaper-server apparent in v-1.0 too. This occurs in Lupu-528-004 and Slacko-5.3.1.(more info down the page and in screen shot)

I updated my ram desklet to detect if free -m can be used and if not default to just free. This overcomes your little issue of earlier and makes the desklet backward compatible. I also added screen positioning capability, but I did not write a "help" for it as it's designed to be called from a script. The default position is "R" wich is 280px from right of screen Passed params include "L" for 30px from left, any integer within your screen height which is the Y axis, or X(any integer inside your screen width) for custom X axis placement. It's very simple code from a simple coder!

The problem is that transparency is lost if the X dimension exceeds approxiamately three quarters of screen width. I tried on different resolutions (different machines) and the ratio is different on 1024x768 it is exactly 0.7451171875 every time (763px) and on 1280x1024 it is exactly 0.79609375 (1019px). I don't know if these measurements will be of any help in debugging.

There is also an error message:

Code: Select all

(wallpaper-server:11193): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_subpixbuf: assertion `src_x >= 0 && src_x  + width <= src_pixbuf=>width' failed
(see screeny)

Any ideas?

Thanks

New ramGTK code:

Code: Select all

#!/bin/sh
#named "ramGTK"
#set -x
WIDGETNAME=`basename $0`

#geometry is a passed parram
X=R
Y=100
while [ $# != 0 ];do
I=1
	while [ $I -lt `echo $# | wc -c` ]; do
		case $1 in
			L)	X=L ;;
			R)  X=R ;;
			[0-9]*[0-9]) Y=$1 ;;
			X*[0-9]) X=`echo $1|tr -d 'X'` ;;
		esac
		shift
		I=$(($I+1))
	done
done

#screensize
SCREEN=`xwininfo -root | grep ' \-geometry ' | tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d '+' | tr 'x' ' '`
HEIGHT=`echo -n "$SCREEN" | cut -f 2 -d ' '`
WIDTH=`echo -n "$SCREEN" | cut -f 1 -d ' '`

case $X in
L) XDIM=30 ;;
R) XDIM=$(( $WIDTH - 220 )) ;;
*) XDIM=$X ;;
esac
YDIM=$Y

echo "$XDIM $YDIM"

#hack for older "free"
free -m >/dev/null 2>&1
[ $? = 0 ] && export FREE="free -m" U=M || export FREE="free" U=K

#calc free ram
export TOTRAM=`$FREE|grep -w Mem|awk '{print $2}'`
freeramfunc(){
while [ 1 ]; do 
USEDRAM=`$FREE|grep -w Mem|awk '{print $3}'`
FREERAM=`$FREE|grep -w Mem|awk '{print $4}'`
echo $(( $USEDRAM * 100 / $TOTRAM ))
echo "RAM $FREERAM $U"
sleep 1 
continue
done
}

export -f freeramfunc

#gui
export ramwidget="<hbox>
  <progressbar width-request=\"140\" height-request=\"14\" tooltip-text=\"showing free RAM of total $TOTRAM $U\">
   <input>freeramfunc</input>
  </progressbar>
 </hbox>"
eval $(gtkdialog-desklet -p ramwidget --geometry=+${XDIM}+${YDIM})

This code is not great as even doing ctrl-c it still runs :?

Re: gtkdialog-desklet

Posted: Wed 28 Dec 2011, 15:14
by recobayu
i'm sorry, can someone give me the mirror?
i can't download that link
i think this gtkdialog-desklet very nice
:D

Upgraded to version 1.2

Posted: Fri 30 Dec 2011, 16:56
by akash_rawal
Upgraded to version 1.2
Changelog:
  • Now using X11 library to determine wallpaper, transparency is supported for many DEs.
  • Fixed communication problems by simply removing wallpaper-server
    (wallpaper-server existed for performance reasons, but now wallpaper can be fetched from X server without performance issues.)
  • Fixed window geometry when desklet is near bottom-right corner or partially offscreen. (Thanks 01micko)
  • Fixed the problem that gtkdialog-desklet was not exiting by Ctrl+c
__________________________________________________
01micko wrote: The problem is that transparency is lost if the X dimension exceeds approxiamately three quarters of screen width.
I traced the problem to xwininfo which gives negative values for geometry when a window is close to bottom right corner.

Now I am using my own program create-bg which uses X11 to fetch background image portion for a given window. How to use that is given in gtkdialog-desklet help file, in Hidden features section.

Posted: Sat 07 Jan 2012, 11:32
by Geoffrey
I tried this with the new Saluki XFCE version, the examples only capture top left of screen, not where the gtkdialog-desklet version 1.2 appears.

Edit: I tried version 1.1 that seems to work ok.

If I click mouse anywhere on the desktop the desklet vanishes.

Geoffrey

Posted: Sun 15 Jan 2012, 17:53
by akash_rawal
Upgraded to version 2.0

Changelog:
  • Fixed window types for xfwm (Thanks Geoffrey)
  • Now entire transparency work is done inside GTK module, improving performance slightly
  • Added facility to specify gtkdialog executable (commandline option -g, --gtkdialog=command)
  • Fixed a small bug in option processing
_____________________________________________________
Geoffrey wrote: I tried this with the new Saluki XFCE version, the examples only capture top left of screen, not where the gtkdialog-desklet version 1.2 appears.
Sorry, couldn't get your problem .. could you please clarify it?

Posted: Mon 16 Jan 2012, 00:20
by Geoffrey
akash_rawal wrote:Upgraded to version 2.0

Changelog:
  • Fixed window types for xfwm (Thanks Geoffrey)
  • Now entire transparency work is done inside GTK module, improving performance slightly
  • Added facility to specify gtkdialog executable (commandline option -g, --gtkdialog=command)
  • Fixed a small bug in option processing
_____________________________________________________
Geoffrey wrote: I tried this with the new Saluki XFCE version, the examples only capture top left of screen, not where the gtkdialog-desklet version 1.2 appears.
Sorry, couldn't get your problem .. could you please clarify it?
akash_rawal,

Version 2.0 is working ok with xfwm, including option -g, but it doesn't show option -b the fancy background.

Geoffrey

Posted: Mon 16 Jan 2012, 10:40
by akash_rawal
Geoffrey wrote: Version 2.0 is working ok with xfwm, including option -g, but it doesn't show option -b the fancy background.
Well, I don't observe such problem. Does it show error messages in terminal?

The example should run like this:

Posted: Mon 16 Jan 2012, 11:00
by Geoffrey
akash_rawal wrote:
Geoffrey wrote: Version 2.0 is working ok with xfwm, including option -g, but it doesn't show option -b the fancy background.
Well, I don't observe such problem. Does it show error messages in terminal?

The example should run like this:
if I click on the script and run it, it shows as my previous picture shows, but if I run it from the terminal it shows it as a transparency and not the background image, strange :?

Posted: Mon 16 Jan 2012, 11:42
by Geoffrey
akash_rawal,

I tried copying desklet_background.png to /root, then I don't get the error but the image still doesn't show, I've tried running it from the xfce terminal as well as rxvt with the same result, is there anything else I should check, I am running in Saluki with GTK version 2.24.8

while I'm here command in terminal to get gtk version is pkg-config --modversion gtk+-2.0

I just tried from a fresh usb install of Saluki, still don't work :?

Geoffrey

edit: I just noticed that yours is transparent, mine will not show as transparent for inactive windows and what version of XFCE are you using, Saluki is running version 4.8, could that be the difference, I can't think of what else to tell you, that about covers it all.

Posted: Wed 18 Jan 2012, 12:10
by Geoffrey
Well you can disregard all the info I posted, I have installed the latest release of Saluki 007, I think this has a different revision of XFCE.

The command for gtk version doesn't work either, anyway the desklet_background.png now shows but there is no transparency, on any of the widgets,
if you can get it working for this version I think it should be safe in the sense that this should be the final build of XFWM for Saluki,
I hope this hasn't caused you any hair tearing moments, thank you for the time you have spent on getting this working, it is a nice feature to have.

regards

Geoffrey

Posted: Thu 19 Jan 2012, 16:35
by akash_rawal
Upgraded to version 2.1

Changelog:
  • Now wallpaper change is handled almost instantly via GdkEvent.
  • Fixed crashes after changing wallpaper when using xfdesktop as pinboard/desktop (Not an actual fix, only the X error is trapped and printed to terminal)
  • Automatically refresh transparency when gtkdialog window is resized (again handled via GdkEvent).

Posted: Thu 19 Jan 2012, 16:50
by akash_rawal

Code: Select all

WARNING: Couldn't load background image "desklet_background.png"
This warning means that gtkdialog-desklet couldn't find desklet_background.png in current working directory, not a big problem.

The solution is to correct present working directory:

Code: Select all

cd /usr/share/doc/gtkdialog-desklet/examples
./2_advanced_options 
or mentioning full path to the image.

I use XFCE 4.6.2 along with compiz as WM and rox to manage desktop, but that shouldn't matter.

Posted: Fri 20 Jan 2012, 00:28
by Geoffrey
akash_rawal wrote:

Code: Select all

WARNING: Couldn't load background image "desklet_background.png"
This warning means that gtkdialog-desklet couldn't find desklet_background.png in current working directory, not a big problem.

The solution is to correct present working directory:

Code: Select all

cd /usr/share/doc/gtkdialog-desklet/examples
./2_advanced_options 
or mentioning full path to the image.

I use XFCE 4.6.2 along with compiz as WM and rox to manage desktop, but that shouldn't matter.
:cry: Sad to say no joy, I guess this is the error message sent to the terminal "Warning: x_get_root_pixmap_by_property failed",

still the same result, no transparency, but the fancy picture shows ok, oh and now when I add -g command, the command is run but the desklet never appears

Ive tried a few different things to see if I can get it to function the way it should, I can get the desklet to run with no transparency then the command to run

but not with the -g, I'm wondering in what way, when it was working correctly, the -g differs from the examples below, the result is the same.

Code: Select all

#!/bin/sh
#!/bin/bash
		
export desklet="
<vbox> 
	<text><label>The first example app</label></text> 
	<text><label>Hello World!</label></text> 
	<button ok></button>
</vbox>
"

gtkdialog-desklet -p desklet && command
or

Code: Select all

#!/bin/sh
#!/bin/bash
		
export desklet="
<vbox> 
	<text><label>The first example app</label></text> 
	<text><label>Hello World!</label></text> 
	<button ok></button>
</vbox>
"

gtkdialog-desklet -p desklet
command
Surely this is driving you nuts :lol:

Regards

Geoffrey

Posted: Sat 21 Jan 2012, 17:21
by akash_rawal
Upgraded to version 2.2

Changelog:
  • Fixed frequent crashes with progressbars (Still not so good, it still crashes occasionally)
  • Now using real transparency if compositing manager is used.

Posted: Sat 21 Jan 2012, 17:34
by akash_rawal
Geoffrey wrote: still the same result, no transparency, but the fancy picture shows ok, oh and now when I add -g command, the command is run but the desklet never appears
-g option is meant to select gtkdialog executable.

e.g. if you have both gtkdialog4 and gtkdialog3, gtkdialog-desklet selects gtkdialog4. To make it use gtkdialog3 instead, you can pass option -g gtkdialog3

Transparency is not yet supported with background image. I will add support for alpha channel in background image someday, but I have no plans to do it soon.

Posted: Sun 22 Jan 2012, 09:46
by akash_rawal
Upgraded to version 2.3

Changelog:
  • Completely fixed crashing issues with progressbars (The problem was that gtkdialog was multithreaded. This led to frequent race conditions with gtkdialog-desklet)

Posted: Sun 22 Jan 2012, 13:54
by vovchik
Dear akash_rawal,

Compiles in and works really nicely in Lucid. Very clever programming, I must say. Thanks. I think we should have a section on the forum devoted to gtkdialog-desklets. I can't wait to write some myself. I can see conky being replaced by such a desklet, and heaps of other nice desktop apps.

With kind regards,
vovchik

Posted: Sun 22 Jan 2012, 17:21
by sc0ttman
akash_rawal wrote:Upgraded to version 2.3
Seems to work fine - on Akita (pup420/wary51x mongrel), using a special gtkdialog4 from techno, built without glade deps, if that matters...
Will be great to see what widgets come out of this! :)
Good work akash_rawal.