gtk2desklet 3.1

Under development: PCMCIA, wireless, etc.
Message
Author
akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#41 Post by akash_rawal »

akash_rawal wrote: Strangely I couldn't get the correct font color even in the gtkdialog mode, or else I was about to suggest using a custom gtkrc file for gtkdialog-desklet too.
Well I failed to notice :oops: the font color was set to black, and so I thought that.

Code: Select all

#line 43:
COLOR=000000
I changed this to FFFFFF and now it works like your screenshot. Exactly the same way :!:
Attachments
weatherCOM.gz
Modified weatherCOM code (.gz extension is fake, remove it)
(14.52 KiB) Downloaded 801 times
weathercom.jpg
(11.98 KiB) Downloaded 1726 times

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#42 Post by jpeps »

On a similar note, for apps that use a terminal window there's Eterm in transparent mode. I use that for cpu-usage.

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

#43 Post by vovchik »

Dear puppians,

I think gtkdialog-desklets is a great thing that we should be exploring more actively. During my explorations, Newton's Third Law of Motion came to mind:
To every action there is always an equal and opposite reaction.
So I wrote a snippet to kill them, too:):

Code: Select all

#!/bin/bash

tasks=$(ps | grep " -f /tmp/gtkdialog-desklets" | grep -v grep)
for i in "$tasks"; do
	task_no=$(echo "$i" | cut -c -5)
	kill $task_no
done
I am certain that technosaurus can render all of this tersely, without external calls to anything except, perhaps, "ps", so let's wait for his contribution...

With kind regards,
vovchik

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

#44 Post by akash_rawal »

Upgraded to version 3.0

Changelog:
  • Package renamed to gtk2desklet
  • Now works with many GTK2 programs, not just gtkdialog.
  • The module now has wrapper-free operation. The gtkdialog-desklet script is now just a deprecated wrapper. Make the program load module directly instead (see first post)
  • No temporary directories used anymore
  • GTK theme refreshing is now handled using signals (just send SIGUSR1 signal to the program, something like kill -s USR1 <process-id>)

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

#45 Post by vovchik »

Dear akash_rawal,

I love it. And we should try to get more of us interested in using this little gem. All I can say is "hats off"!. Brilliant.

Thanks and kind regards,
vovchik

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.

Post Reply