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 22 Sep 2014, 04:15
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 Posts_count  
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

Edited_times_total
Back to top
View user's profile Send_private_message Visit_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_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_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_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_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_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_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_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_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_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0940s ][ Queries: 11 (0.0110s) ][ GZIP on ]