gtk2desklet 3.1

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#46 Post by Argolance »

Hello,
Example:
#!/bin/sh

export test="
<window>
<button image-position=\"2\" can-focus=\"no\" relief=\"2\">
<input file>/usr/local/lib/X11/pixmaps/home48.png</input>
<label>Filer</label>
<action>rox &</action>
</button>
</window>
"
gtkdialog --program=test --gtk-module=gtk2desklet --center
Console:
(gtkdialog:1301): Gtk-CRITICAL **: IA__gtk_widget_set_default_colormap: assertion `GDK_IS_COLORMAP (colormap)' failed
Please, what's wrong in this test script?

EDIT
While testing (Racy 5.3), I noticed:
  • - my wm is jwm and the script above finally works only after restarting jwm!
    - when translucency effects activated (kcompmgr), taskbar disappears and system freezes => restart X
Cordialement.
Last edited by Argolance on Mon 23 Apr 2012, 13:27, edited 1 time in total.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#47 Post by vovchik »

Dear Argolance,

Your script works with ICEWM except that it is always on top....

With kind regards,
vovchik

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

#48 Post by Geoffrey »

Argolance,

The script works fine after I changed rox to Thunar in Saluki xfce with true transparency, no errors when run from the terminal.

I'm sure this is what it should look like.

Geoffrey
Attachments
Screenshot-2.png
(28.83 KiB) Downloaded 1258 times
Screenshot.png
(24.51 KiB) Downloaded 1193 times

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#49 Post by Argolance »

Hello,
Thank you for testing/replying...
This is exactly what I was expecting for!
But my final script (build on the test script model above) has necessarily to work with jwm and x/kcompmgr... :cry:
This unfortunately seems not to be possible?

Cordialement.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#50 Post by akash_rawal »

Upgraded to version 3.1

Changelog:
  • Window searching code replaced by a crazy hack in GObject class structure.
  • Fixed broken compatibility with jwm

brokenman
Posts: 25
Joined: Thu 20 Oct 2011, 23:00

#51 Post by brokenman »

Is it possible to get the transparency even during the mouseover?

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#52 Post by akash_rawal »

brokenman wrote:Is it possible to get the transparency even during the mouseover?
It's possible, but you have to do extra hardwork of writing gtkrc files and use them using DESKLET_GTKRC_FILES environment variable.
DESKLET_GTKRC_FILES
  • This variable can contain extra GTK resource files (many people call these
    theme files) without affecting any subprocesses. File names are separated
    by a pipe character '|'.
The trick is to use transparent images as widget background.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#53 Post by Argolance »

Hello,
Great!
- my wm is jwm and the script above finally works only after restarting jwm!
- when translucency effects activated (kcompmgr), taskbar disappears and system freezes => restart X
Now, this works without restarting jwm and system doesn't freeze anymore: scripts windows are just not displayed at all till translucency/shadow effects are deactivated.

I well understand that window full transparency cannot be "married" with translucency and shadow effects but perhaps this could be by-passed this way:
Create a little script called "gtk2desklet" and rename the original into gtkdesklet_ for example. gtk2desklet looks if x/kcompmgr is currently running or not, then calls gtkdesklet_ or not according to the result?

Don't know if this could work and be useful?

Cordialement.
Last edited by Argolance on Sun 22 Jul 2012, 10:59, edited 1 time in total.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#54 Post by Argolance »

Hello,
I well understand that window full transparency cannot be "married" with translucency and shadow effects but perhaps this could be by-passed this way:
Create a little script called "gtk2desklet" and rename the original into gtkdesklet_ for example. gtk2desklet looks if x/kcompmgr is currently running or not, then calls gtkdesklet_ or not according to the result?
I guess I didn't well understand :oops: ... Things are much more complex: gtk2desklet works even when x/kcompmgr is running but scripts window disappear as soon as a new window (application or rox filer window) is opened... on the same virtual desk... This doesn't happen if script is launched on an other empty one.
I was wondering if gtk2desklet could not get extra options (gtk2desklet -option) that could let user choose if script is visible or not inside the taskbar, if it is displayed at the top or bottom level of the screen and on all virtual desktops or not. So, your application could perhaps be used for something else than "desklets" too? I think for example of splash windows for applications, progress bars and so on...

Cordialement.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#55 Post by akash_rawal »

Maybe it will work with xcompmgr if you force use of pseudotransparency with xcompmgr by exporting variable DISABLE_RGBA_TRANS something like this:

Code: Select all

export DISABLE_RGBA_TRANS="1"
gtkdialog --program=test --gtk-module=gtk2desklet --center
With jwm you should ensure that rox-filer options > compatibility > Override window manager control of pinboard and panel is enabled.

brokenman
Posts: 25
Joined: Thu 20 Oct 2011, 23:00

#56 Post by brokenman »

Thanks. Looks like i was on the right track with a gtkrc file ... however i wasn't aware of the gtk2desklet variable. Will plug away at it.

brokenman
Posts: 25
Joined: Thu 20 Oct 2011, 23:00

#57 Post by brokenman »

Ok maybe i'm missing something or my mother dropped me on my head when i was little.

I managed to get gtk2desklet to use a gtkrc file by exporting the environment variable DESKLET_GTKRC_FILES. The following is the only combination of launching the app that worked and used the gtkrc file.

gtkdialog -p MAIN_SCREEN -c --gtk-module=gtk2desklet

Using gtkdialog-desklet -p MAINSCREEN --gtkrc-file=./gtkrc launched the app without error but did not honour the gtkrc file.

The problem is it won't use an image for the button background in the NORMAL or PRELIGHT state. It doesn't matter if the bg_pixmap file is transparent or not. Here is my gtkrc file.

Code: Select all

pixmap_path "/mnt/sda7/sandpit/gtkapps"
style "rescue_button" = "fedora-wider"
{
	#bg[NORMAL]   =  shade (1.02,@bg_color)
 	#bg[ACTIVE]   =  shade (0.85,@bg_color)
	#bg[PRELIGHT] ="./transparent.png"
	bg[PRELIGHT] =  mix(1.90, shade (1.35,@bg_color), @selected_bg_color)
	#bg_pixmap[NORMAL] = "bg.png"
}
widget_class "*GtkButton*" style "rescue_button"
The PRELIGHT shading line works fine. The bg_pixmap does not. Anyone have any ideas why this won't work?

EDIT: I should note that bg_pixmap[PRELIGHT] = "bg.png" also does not work for me.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#58 Post by akash_rawal »

You can use pixmap engine.
Attachments
trans-buttons.tar.gz
An example
(1.29 KiB) Downloaded 780 times

brokenman
Posts: 25
Joined: Thu 20 Oct 2011, 23:00

#59 Post by brokenman »

Thanks. This works for me.

User avatar
recobayu
Posts: 387
Joined: Wed 15 Sep 2010, 22:48
Location: indonesia

#60 Post by recobayu »

Hi Akash, thank you for your gtk2desklet. I make a start metro like wdz8 and I use your gtk2desklet.
You can see the screenshot at here:
http://dl.dropboxusercontent.com/s/g38l ... kstart.png
and the script is in here:
http://murga-linux.com/puppy/viewtopic. ... 062#721062
I want to ask a question.
1. Can gtk2desklet do the transparent in vbox when i use scrollable="true"? how?
2. Can gtk2desklet do the blur transparent? so it's like unity in ubuntu.
Thank you.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#61 Post by akash_rawal »

recobayu wrote: 1. Can gtk2desklet do the transparent in vbox when i use scrollable="true"? how?
When you set scrollable=true, gtk creates a new X window for the contents of the vbox. This foils the transparency and I cannot think of any workaround.
recobayu wrote: 2. Can gtk2desklet do the blur transparent? so it's like unity in ubuntu.
I'm too lazy to do that :oops: , and even if I enable it, it isn't going to work with real transparency.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#62 Post by mikeb »

Well inspired by your drive icons for puppies 5+ I then find this little beauty so I played with my version of pmount and came up with a drive icons widget.... does the usual...yellow for 'locked' drives, play media buttons, hide empty optical, eject and no script polling....mut provides a binary backend so cpu usage is erm like nothing registered. (the original had 10% spikes every 2 seconds...)
Made for 4.12 to have one 4k script instead of ..well you know. Yet to try but should be ok for even older gtk2desklet permitting as its not using udev (bleeding stubborn that was)

so erm thanks for useful stuff.... :)

mike

a piccie..ignore the frame text..I only added the drive names to have something there :D
Attachments
icons.png
(66.26 KiB) Downloaded 948 times

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#63 Post by mikeb »

Ah.... a reread found those transparent buttons .... oh yes :)

A couple of questions.....
yad works but stays on top of other windows... not sure if you are familiar with it but I have the sources to play with.

I was testing on older pups ... they set the background using xsetroot so I added the _XSETROOT_ID variable to your source which detected the background pixmap but then gdk complains its only 1 bit depth and displays a highly skewed transparancy.
If I add Esetroot and imlib2 and set wallpaper with that all works correctly but its a bit of overkill and not so portable.

Oh and in transbuttons.rc...how do I change the button text colour...nothing I do seems to work...one has gtk mental blindness syndrome

regards

Mike

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#64 Post by mikeb »

Ok in gtk 1 rox puppies it seems the wallpaper is stored as is...a binary copy of the jpg or whatever.... that is then displayed as wallpaper via gtk....performed by puppybackgroundsetter....xsetroot is similar. Such data is meaningless to such as gtk2desklet even if the needed variable giving the location of the image is set.. I found the wallpaper setter extracted from WindowMaker does the job nicely keeping the wallpaper and apps using gtk2desklet happy.
mike

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#65 Post by mikeb »

Ah ha...thats better...now translucent backgrounds for the text on the now dummy buttons.....
Attachments
icons2.png
(36.91 KiB) Downloaded 876 times

Post Reply