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 Mon 21 Apr 2014, 06:44
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
gtk2desklet 3.1
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 5 [67 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
seaside

Joined: 11 Apr 2007
Posts: 878

PostPosted: Sat 24 Dec 2011, 17:40    Post subject:  

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
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Sun 25 Dec 2011, 14:51    Post subject: Upgraded to version 1.1  

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:
<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.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7547
Location: qld

PostPosted: Sun 25 Dec 2011, 17:55    Post subject:  

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:
(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:
#!/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 Confused
desklet.png
 Description   
 Filesize   53.05 KB
 Viewed   1205 Time(s)

desklet.png


_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
recobayu


Joined: 15 Sep 2010
Posts: 111
Location: indonesia

PostPosted: Wed 28 Dec 2011, 11:14    Post subject: Re: gtkdialog-desklet
Subject description: Easily write desktop apps
 

akash_rawal wrote:

Download gtkdialog-desklet-1.1 (34 KB)

i'm sorry, can someone give me the mirror?
i can't download that link
i think this gtkdialog-desklet very nice
Very Happy

_________________
myblog: http://muktyas.blogspot.com
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Fri 30 Dec 2011, 12:56    Post subject: Upgraded to version 1.2  

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.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Sat 07 Jan 2012, 07:32    Post subject:  

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
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Sun 15 Jan 2012, 13:53    Post subject:  

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?
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Sun 15 Jan 2012, 20:20    Post subject:  

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
desklet1.jpg
 Description   
 Filesize   15.21 KB
 Viewed   853 Time(s)

desklet1.jpg

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

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Mon 16 Jan 2012, 06:40    Post subject:  

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:
desklet_bg.jpg
 Description   
 Filesize   15.5 KB
 Viewed   810 Time(s)

desklet_bg.jpg

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


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Mon 16 Jan 2012, 07:00    Post subject:  

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 Confused
desklet.jpg
 Description   
 Filesize   21.53 KB
 Viewed   816 Time(s)

desklet.jpg

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


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Mon 16 Jan 2012, 07:42    Post subject:  

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 Confused

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.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Wed 18 Jan 2012, 08:10    Post subject:  

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
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Thu 19 Jan 2012, 12:35    Post subject:  

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).
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Thu 19 Jan 2012, 12:50    Post subject:  

Code:

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:

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.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 1218
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Thu 19 Jan 2012, 20:28    Post subject:  

akash_rawal wrote:
Code:

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:

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.


Crying or Very sad 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:
#!/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:
#!/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 Laughing

Regards

Geoffrey
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 5 [67 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1009s ][ Queries: 13 (0.0060s) ][ GZIP on ]