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 20 Oct 2014, 09:37
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
xystray-trayicons
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Thu 01 Dec 2005, 15:14    Post subject:  xystray-trayicons  



Very small Trayicon - list.

You can configure size and position by editing
/usr/local/xystray-trayicons/run-xystray

Code:
// ------------------
// --- User-Setup ---
// ------------------

NumberOfIcons = 10
PositionX = screenwidth()/2 - (NumberOfIcons*22)/2
PositionY = 0


Install the Dotpup, and run the program from the menue.
It is better, to add
sleep 3 && /usr/local/xystray-trayicons/run-xystray&
to your .xinitrc, as it just can display Programs started from new, but not programs already running. So it should run before all others.

It works fine with Icewm and Oroborus.
With JWM, you must click in the trayicon-window, to make the Title disappear. In jwm, the Window-Borders still remain.

Download (10 kb):
http://dotpups.de/dotpups/Desktop-Tools/xystray-trayicons.pup

Homepage:
http://stlman.fm.interia.pl/xystray/

Mark

Last edited by MU on Thu 13 May 2010, 21:02; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
steelman
Guest


PostPosted: Tue 31 Jan 2006, 19:59    Post subject: New homepage.  

Greetings.

I have moved xystray to a new address. Check it at:
http://stlman.fm.interia.pl/xystray/
Back to top
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 31 Jan 2006, 20:09    Post subject:  

steelman, thanks for the info, and this nice small programm Very Happy
Back to top
View user's profile Send private message Visit poster's website 
SimplyFlower


Joined: 03 Mar 2006
Posts: 49
Location: Oregon, United States

PostPosted: Sun 12 Mar 2006, 09:05    Post subject: Question regarding xystray  

What is the tray suppose to do? I downloaded and installed the dotpup. Added the line to .xinitrc file. It starts when I bootup, but there aren't any icons in it. I've started programs like Thunderbird, Mozilla, Beaver, Mtpaint, etc. No icons ever show up in the tray. Is there something I'm doing wrong or am I not understanding the function?
_________________
-- SimplyFlower
Puppy Linux 2.15CE Final, Frugal w/pup_save.2fs file; Dell w/ Intel Celeron 1.1 GHZ, 512 MB RAM
Care2
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 12 Mar 2006, 10:29    Post subject:  

Tryicons are mostly supported by KDE and Gnome -programs (but not only).

If you have KDE, try klipper.
This is a tool to manage the KDE-clipboard.
With the trayicon, you can access the clipboard.

Thunderbird needs an extension, but I did not try it myself yet: http://moztraybiff.mozdev.org/

If you google for "linux trayicon", you should find more programssupporting trayicons.

Mark
Back to top
View user's profile Send private message Visit poster's website 
SimplyFlower


Joined: 03 Mar 2006
Posts: 49
Location: Oregon, United States

PostPosted: Sun 12 Mar 2006, 13:10    Post subject: Thank you  

Mark, Thank you. I installed the extension for Thunderbird and it works. I was looking for something to visually notify me of new emails since I can't hear the mail notification sound with Thunderbird. This works great for me. Once again, Thanks. Very Happy
_________________
-- SimplyFlower
Puppy Linux 2.15CE Final, Frugal w/pup_save.2fs file; Dell w/ Intel Celeron 1.1 GHZ, 512 MB RAM
Care2
Back to top
View user's profile Send private message 
lior2b


Joined: 04 Feb 2006
Posts: 97
Location: The Holy Land

PostPosted: Wed 15 Mar 2006, 08:28    Post subject:  

See also:
Add a notification area to JWM http://www.murga.org/~puppy/viewtopic.php?p=42164

_________________
Lior Tubi
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sat 15 Jul 2006, 11:42    Post subject:  

I modified Liors freememapplet for JWM, so that it does not run in a window (what it technically is in the JWM-taskbar, though it looks like a tray-icon), but as a tray-icon compatible with the freedesktop.org-specifications.
So you can use it in other windowmanagers than JWM, if they support trayicons, or by using xystray.

Source is included, and a menu-entry to start the trayicon:
http://dotpups.de/dotpups/Desktop-Tools/Freememapplet-1.2-trayicon-MU.pup

Like this it looks in Icewm using xystray, beside the "klipper" trayicon from KDE:



Compilation-instructions for interested developpers are included.
I took eggtrayicon from the current Gaim-release (1.5.0).
Mark
Back to top
View user's profile Send private message Visit poster's website 
lior2b


Joined: 04 Feb 2006
Posts: 97
Location: The Holy Land

PostPosted: Sun 16 Jul 2006, 16:35    Post subject:  

Thanks MU! I didn't know eggtrayicon, I'll look into it!
_________________
Lior Tubi
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 16 Jul 2006, 17:55    Post subject:  

Eggtryicon provides a function, that you can use instead of gtk_window_new.

Code:

//   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   window = egg_tray_icon_new("freemem");


That's almost all, quite simple.
It just works with Gtk2, fortunately your code worked immedeatly, just the Gdk-font did not.
I used instead a new option, to alter font-settings via a HTML-like syntax:
Code:
        snprintf(freeMemStringFormatted, sizeof(freeMemStringFormatted), "<span font_desc='7.5'>%s</span>", freeMemString);
        gtk_label_set_markup (GTK_LABEL (label), freeMemStringFormatted);


This sets the labeltext to 7.5 point Smile

There seems to be a bug in my simple patch, after a while the tooltip and the contextmenu start behaving extremely slow, so maybe something else has to be changed.

Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 17 Jul 2006, 13:52    Post subject:  

there currently IS a bug in my patch.

The interval -delay is ignored, it updates every second, producing permanent processor-usage of 3% on my system.
This seems to be critical on slower machines, reported here:
http://www.murga.org/~puppy/viewtopic.php?t=9404&start=16

The interval works correct, if I don't use
gtk_widget_show(GTK_WIDGET(window));

But that is nonsense, as this makes the applet invisible.
I tried to build it the same way as gaim does in docklett.c, still no success Sad

Code:
int main(int argc, char **argv) {

//MU
 static EggTrayIcon *window = NULL;

//   GtkWidget *window;

//MU   GtkWidget  *hbox;
//MU   GdkFont *font;
   int i;
   unsigned int interval = INTERVAL;

   gtk_init(&argc, &argv);

   for(i = 1; i < argc; ++i) {
      if((!strcmp(argv[i], "-u") || !strcmp(argv[i], "--update")) && (i < argc-1)) {
         interval = (unsigned int)strtoul(argv[++i], NULL, 10);
      } else {
         if(!(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version") || !strcmp(argv[i], "-h") || !strcmp(argv[i], "--help"))) {
            printf("%s: bad option or missing argument `%s`\n\n", argv[0], argv[i]);
         }

         printf("%s v%s by Lior Tubi <lior2b@gmail.com>\n" \
         "options:\n" \
         "  -u <seconds>, --upadte <seconds>: Set update interval (default %d)\n" \
         "  -h, --help, -v, --version:        Display this help text and exit\n" \
         , APPNAME, APPVERSION, INTERVAL);
         return 0;
      }
   }

//MU
//   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   window = egg_tray_icon_new("freemem");

   gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(AppQuit), NULL);
   gtk_window_set_title(GTK_WINDOW(window), APPNAME);
   gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);

   tips = gtk_tooltips_new();

   gdk_color_parse(COLOR_NORMAL, &colorNormal);
   gdk_color_parse(COLOR_LOW, &colorLow);
   gdk_color_parse(COLOR_LOW_FLASH1, &colorLowFlash1);
   gdk_color_parse(COLOR_LOW_FLASH2, &colorLowFlash2);

   label = gtk_label_new("");
   style = gtk_style_copy(gtk_widget_get_style(label));
   style->fg[GTK_STATE_NORMAL] = style->white;
//MU
/*
   if((font = gdk_font_load(FONT))) {
      style->font = font;
   }
*/


   gtk_widget_set_style(label, style);

   //hbox = gtk_hbox_new(FALSE, 0);
   //gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 2);

   eventbox = gtk_event_box_new();
gtk_container_add(GTK_CONTAINER(eventbox), label);

/*
   gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event", GTK_SIGNAL_FUNC(ShowMenu), NULL);
   gtk_signal_connect_after(GTK_OBJECT(eventbox), "expose_event", GTK_SIGNAL_FUNC(ExposeUpdate), NULL);
*/
   g_signal_connect(G_OBJECT(eventbox), "button_press_event", G_CALLBACK(ShowMenu), NULL);
   g_signal_connect_after(G_OBJECT(eventbox), "expose_event", G_CALLBACK(ExposeUpdate), NULL);
   //style = gtk_style_copy(gtk_widget_get_style(eventbox));

   //gtk_container_add(GTK_CONTAINER(eventbox), hbox);
   gtk_container_add(GTK_CONTAINER(window), eventbox);


    flashTimeout = 0;
    status = NORMAL;
    interval *= 1000;
gtk_widget_show(label);
gtk_widget_show(eventbox);
//gtk_widget_show(window);

//egg_tray_icon_realize (window);
gtk_widget_show(GTK_WIDGET(window));

//   if(!gtk_check_version(2,4,0))
//      g_object_set(G_OBJECT(eventbox), "visible-window", FALSE, NULL);

printf("%i\n" , interval);

g_object_set(G_OBJECT(eventbox), "visible-window", TRUE, NULL);
g_object_ref(G_OBJECT(window));
   // gtk_timeout_add(interval, Update, NULL);
g_timeout_add(interval, Update, NULL);

//MU   gtk_widget_show_all(window);

gtk_widget_realize(GTK_WIDGET(window));
//gtk_widget_show_all(GTK_WIDGET(window));
   Update(NULL);

   gtk_main();

   return 0;
}


Add a
Code:

gboolean Update(gpointer ptr) {

printf("test\n" );


to see the difference.

Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 17 Jul 2006, 15:00    Post subject:  

ok, simply comment this to solve the bug:

Code:
//   g_signal_connect_after(G_OBJECT(eventbox), "expose_event", G_CALLBACK(ExposeUpdate), NULL);


Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 17 Jul 2006, 17:09    Post subject:  

updated the bugfixed freemem dotpup.
It includes the sources and 2 versions.
freememapplet-trayicon works fine in xystray,
freememapplet-trayicon2 works fine in the Icewm-tray.

Mark
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.0871s ][ Queries: 11 (0.0056s) ][ GZIP on ]