Author |
Message |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: 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
Description |
|

Download |
Filename |
refresh_my_desktop.gz |
Filesize |
7.68 KB |
Downloaded |
405 Time(s) |
_________________ LazY Puppy
RSH's DNA
SARA B.
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: 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.
Description |
|

Download |
Filename |
refresh_my_desktop.pot.gz |
Filesize |
732 Bytes |
Downloaded |
338 Time(s) |
Description |
|
Filesize |
3.01 KB |
Viewed |
906 Time(s) |

|
Description |
|

Download |
Filename |
restore.png.gz |
Filesize |
3.01 KB |
Downloaded |
410 Time(s) |
_________________ LazY Puppy
RSH's DNA
SARA B.
|
Back to top
|
|
 |
charlie6

Joined: 30 Jun 2008 Posts: 1211 Location: Saint-Gérard / Walloon part of Belgium
|
Posted: Sat 23 Aug 2014, 01:36 Post subject:
|
|
Hi RSH,
here is the french translation !
also with fake gz extension
but...
what does Desktop refresh means ... ("wirklich") effectively ?
Mit freundlichen Grüßen
Cjarlie
Description |
|

Download |
Filename |
refresh_my_desktop-fr.pot.gz |
Filesize |
753 Bytes |
Downloaded |
301 Time(s) |
|
Back to top
|
|
 |
vicmz

Joined: 15 Jan 2012 Posts: 1268
|
Posted: Sat 23 Aug 2014, 07:42 Post subject:
|
|
¡Muy Bueno!
Here is the Spanish translation. (It's an actual zip)
Description |
|

Download |
Filename |
refresh_my_desktop_spanish.zip |
Filesize |
627 Bytes |
Downloaded |
336 Time(s) |
_________________ Puppy Linux en español
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: 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
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6572 Location: Valåmoen, Norway
|
Posted: 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
Thanks
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: 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
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
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6572 Location: Valåmoen, Norway
|
Posted: Sat 23 Aug 2014, 11:27 Post subject:
|
|
That's great. I'll be watching
_________________ Stardust resources
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 2420 Location: Germany
|
Posted: Sat 23 Aug 2014, 21:47 Post subject:
|
|
zigbert wrote: | That's great. I'll be watching  |
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.
_________________ LazY Puppy
RSH's DNA
SARA B.
|
Back to top
|
|
 |
bobc
Joined: 14 May 2014 Posts: 86
|
Posted: 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
|
|
 |
LazY Puppy

Joined: 21 Nov 2014 Posts: 2007 Location: Germany
|
Posted: 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
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0)
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! 
|
Back to top
|
|
 |
bobc
Joined: 14 May 2014 Posts: 86
|
Posted: 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.
|
Back to top
|
|
 |
LazY Puppy

Joined: 21 Nov 2014 Posts: 2007 Location: Germany
|
Posted: Tue 15 Mar 2016, 18:16 Post subject:
|
|
zigbert wrote: | RSH
In your investigation, have you learned how to refresh pup_event (drive icons on desktop) without restarting X?
I am interested
Thanks
Sigmund |
The code below will refresh the drive icons without the need to restart X (collected from 'eventmanager').
Code: | # Update Drive Icons
echo "ICONWIPE" > /var/local/pup_event_icon_change_flag
PID=`grep '/bin/ash.*/sbin/pup_event_frontend_d' <<< $(ps -eo pid,command) | awk '{print $1}'`
kill -9 $PID
echo 'ICONWIPE' > /tmp/pup_event_icon_change_flag
/sbin/clean_desk_icons
rox -p "$HOME/Choices/ROX-Filer/PuppyPin"
kill $(pidof pup_event_frontend_d)
pup_event_frontend_d & |
_________________ RSH
"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0)
No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! 
|
Back to top
|
|
 |
|