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 Sat 28 Feb 2015, 03:03
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Desktop Refresher 1.0.0
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Fri 22 Aug 2014, 21:26    Post subject:  Desktop Refresher 1.0.0
Subject description: Small System Tray Application to refresh the ROX Desktop
 

Hi.

This is a small application sitting in the system tray, which refreshes the desktop immediately when clicking it. It is made for the use of the ROX desktop and to refresh the PWidgets as well as the WBar.

It is this my first application ever published written in C (thanks to some help by 01micko).

The attached .gz is a fake .gz file. Just remove the fake .gz and make it executable, if necessary.

After this put it into /usr/bin and put a symbolic link to it into $HOME/Startup - and click it.

That's just all.

RSH
refresh_my_desktop.gz
Description 
gz

 Download 
Filename  refresh_my_desktop.gz 
Filesize  7.68 KB 
Downloaded  109 Time(s) 

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Fri 22 Aug 2014, 21:37    Post subject:  

Here are the .pot file and the Icon used.

Both are fake .gz files.

Put the Icon into /usr/share/pixmaps.
refresh_my_desktop.pot.gz
Description 
gz

 Download 
Filename  refresh_my_desktop.pot.gz 
Filesize  732 Bytes 
Downloaded  78 Time(s) 
restore.png
 Description   
 Filesize   3.01 KB
 Viewed   573 Time(s)

restore.png

restore.png.gz
Description 
gz

 Download 
Filename  restore.png.gz 
Filesize  3.01 KB 
Downloaded  73 Time(s) 

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
charlie6


Joined: 30 Jun 2008
Posts: 1055
Location: South of Belgium

PostPosted: Sat 23 Aug 2014, 01:36    Post subject:  

Hi RSH,
here is the french translation Cool !
also with fake gz extension

but...

what does Desktop refresh means ... ("wirklich") effectively ?

Mit freundlichen Grüßen Smile
Cjarlie
refresh_my_desktop-fr.pot.gz
Description 
gz

 Download 
Filename  refresh_my_desktop-fr.pot.gz 
Filesize  753 Bytes 
Downloaded  69 Time(s) 
Back to top
View user's profile Send private message 
vicmz

Joined: 15 Jan 2012
Posts: 1181

PostPosted: Sat 23 Aug 2014, 07:42    Post subject:  

¡Muy Bueno! Very Happy

Here is the Spanish translation. (It's an actual zip)
refresh_my_desktop_spanish.zip
Description 
zip

 Download 
Filename  refresh_my_desktop_spanish.zip 
Filesize  627 Bytes 
Downloaded  64 Time(s) 

_________________
OB Precise 15.01 kernel 3.17.7|Puppy Linux en español
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Sat 23 Aug 2014, 08:07    Post subject:  

Hi.

Thanks for all the translations. Will try to create a NLS package later.

Quote:
what does Desktop refresh means ... ("wirklich") effectively ?

I came to this since I'm using the PWidgets in almost all of my LazY Puppy Systems. Sometimes after booting into X desktop, some of the widgets aren't properly shown on the desktop. It's quite in-comfortable to restart X then or to call the PWidgets GUI to restart the PWidgets so that all widgets are shown on the desktop.

To refresh the widgets easily was my main purpose and since I'm using also the WBar in almost all of my LazY Puppy Systems, I included to refresh the WBar as well.

So Desktop Refresh means (in German): Arbeitsfläche auffrischen.

Is this a bad DE to EN translation?
Should I rename it?

RSH

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5966
Location: Valåmoen, Norway

PostPosted: Sat 23 Aug 2014, 09:23    Post subject:  

RSH
In your investigation, have you learned how to refresh pup_event (drive icons on desktop) without restarting X?
I am interested Smile


Thanks
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Sat 23 Aug 2014, 10:48    Post subject:  

Hi, zigbert.

zigbert wrote:
RSH
In your investigation, have you learned how to refresh pup_event (drive icons on desktop) without restarting X?
I am interested Smile


Thanks
Sigmund

Yes, partially.

Currently this is just a dirty hack and the default puppy icons on the desktop (like write, text, connect etc.) are getting lost. That's why I didn't include this option into the binary.

I need to examine the code of VarioMenu and build a function to save these icons. VarioMenu already has all the functions to add and/or remove parts to/from PuppyPin. Just need to modify some of them for this special purpose.

Though, the drive icons aren't present when refreshing the desktop starts and one can see them re-draw and re-aline at the desktop refresh.

I will come up with this, when completely solved and successfully tested in all my LazY Puppy Systems.

RSH

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
zigbert


Joined: 29 Mar 2006
Posts: 5966
Location: Valåmoen, Norway

PostPosted: Sat 23 Aug 2014, 11:27    Post subject:  

That's great. I'll be watching Smile
_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Sat 23 Aug 2014, 21:47    Post subject:  

zigbert wrote:
That's great. I'll be watching Smile

I have solved now to keep the default Icons (like write, draw, connect etc.), but the drive icons do randomly disappear from the desktop. So this needs further investigations. Crying or Very sad

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
bobc

Joined: 14 May 2014
Posts: 77

PostPosted: Wed 28 Jan 2015, 20:22    Post subject:  

My icons didn't completely disappear, but the picture shown normally for that desktop entry wasn't there, and they looked like script files.

Is this the same problem?

I fixed it by restoring an older copy of one of the files called globicons which appears to be part of rox.

Are you also publishing the source for your C program?
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 281
Location: Germany

PostPosted: Fri 30 Jan 2015, 14:13    Post subject:  

bobc wrote:
My icons didn't completely disappear, but the picture shown normally for that desktop entry wasn't there, and they looked like script files.

Is this the same problem?

I fixed it by restoring an older copy of one of the files called globicons which appears to be part of rox.

Are you also publishing the source for your C program?


Which Puppy are you using?

Here is the Code:
Code:
//#############################################################################
// System Tray Refresh Desktop Function
// 2014-08-14 RSH for LazY Puppy
//#############################################################################
// to compile: gcc -o example example.c `pkg-config --libs --cflags gtk+-2.0`
//#############################################################################

// Include Files
#include <string.h>
#include <libintl.h>
#include <locale.h>
//#include <stdio.h>
//#include <stdlib.h>
//#include <unistd.h>
//#include <sys/types.h>
//#include <sys/stat.h>
//#include <fcntl.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
//#include <gdk/gdkkeysyms.h>
//#include <glib/gstdio.h>
//#include <dirent.h>
//#include <errno.h>
#define _(STRING)    gettext(STRING)
//#define _(text)    gettext(text)

// Icons
GdkPixbuf *a_pixbuf;
GtkStatusIcon *tray_icon;

// Error Check on File Open
GError *gerror = NULL;

//#############################################################################
// Click Functions called from Menu
//#############################################################################

// Run /usr/local/bin/refresh_desktop
void  view_popup_menu_run_refreshdesktop (GtkWidget *menuitem, gpointer user_data)
{
    // system("/usr/local/bin/refresh_desktop &"); // Now disabled
    // Code from /usr/local/bin/refresh_desktop now executed directly here
    system("rox -p=$HOME/Choices/ROX-Filer/PuppyPin");
    system("sleep .2");
    system("bash export UPDATE_SIDEBAR=true");
    system("fixwidgets -wallpaper_setter");
    system("sleep .2");
    system("bash export WBSTARTUP1=$HOME/Startup/wstart");
    system("bash export WBSTARTUP2=$HOME/Startup/wbar");
    system("killall wbar 2&> /dev/null");
    system("sleep .2");
    system("[ -e $WBSTARTUP1 ] && exec $HOME/Startup/wstart 2> /dev/null");
    system("[ -e $WBSTARTUP2 ] && exec $HOME/Startup/wbar 2> /dev/null");
}

//#############################################################################
// System Tray Icon
//#############################################################################

// Create Tray Icon
static GtkStatusIcon *create_tray_icon()
{
   tray_icon = gtk_status_icon_new();
   g_signal_connect(G_OBJECT(tray_icon), "activate", G_CALLBACK(view_popup_menu_run_refreshdesktop), NULL);
    g_signal_connect(G_OBJECT(tray_icon), "popup-menu", G_CALLBACK(view_popup_menu_run_refreshdesktop), NULL);
   a_pixbuf=gdk_pixbuf_new_from_file("/usr/share/pixmaps/restore.png",&gerror);
   gtk_status_icon_set_from_pixbuf(tray_icon,a_pixbuf);
   gtk_status_icon_set_tooltip(tray_icon, _("Refresh the Desktop"));
   gtk_status_icon_set_visible(tray_icon, TRUE);
   return tray_icon;
}

//#############################################################################
// Main Program Functions
//#############################################################################

// Main Program
int main(int argc, char **argv)
{
   gtk_init(&argc, &argv);

   setlocale( LC_ALL, "" );
   bindtextdomain( "refresh_my_desktop", "/usr/share/locale" );
   textdomain( "refresh_my_desktop" );

   tray_icon = create_tray_icon();
   //create_tray_icon();
   gtk_main();
   return 0;
}

//#############################################################################
// End of System Tray Refresh Desktop Function
//#############################################################################

_________________
RSH
No Smart-Phones, no FaceBook, no Twitter etc...
but: LazY Puppy!
Copyright is NOT Copyleft: good people are aware of this and respect both of them!
Back to top
View user's profile Send private message 
bobc

Joined: 14 May 2014
Posts: 77

PostPosted: Fri 30 Jan 2015, 15:22    Post subject:  

I'm running Slacko 5.7.0 but am tweaking it to my own needs and tastes.

I have resolved the problem I had at the time by restoring a copy of globicons I had created as a byproduct of saving a copy of the pins layout after I moved things around to make space for my conky display.

I do have drive icons that don't show up sometimes and will try your program then. I need to investigate the code to hopefully understand it better. I'm not a c programmer, but am trying to adapt to linux.

Thanks for posting the code for me.

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