Page 1 of 1

Desktop Refresher 1.0.0

Posted: Sat 23 Aug 2014, 01:26
by RSH
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

Posted: Sat 23 Aug 2014, 01:37
by RSH
Here are the .pot file and the Icon used.

Both are fake .gz files.

Put the Icon into /usr/share/pixmaps.

Posted: Sat 23 Aug 2014, 05:36
by charlie6
Hi RSH,
here is the french translation 8) !
also with fake gz extension

but...

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

Mit freundlichen Grüßen :)
Cjarlie

Posted: Sat 23 Aug 2014, 11:42
by vicmz
¡Muy Bueno! :D

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

Posted: Sat 23 Aug 2014, 12:07
by RSH
Hi.

Thanks for all the translations. Will try to create a NLS package later.
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

Posted: Sat 23 Aug 2014, 13:23
by zigbert
RSH
In your investigation, have you learned how to refresh pup_event (drive icons on desktop) without restarting X?
I am interested :)


Thanks
Sigmund

Posted: Sat 23 Aug 2014, 14:48
by RSH
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

Posted: Sat 23 Aug 2014, 15:27
by zigbert
That's great. I'll be watching :)

Posted: Sun 24 Aug 2014, 01:47
by RSH
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. :cry:

Posted: Thu 29 Jan 2015, 00:22
by bobc
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?

Posted: Fri 30 Jan 2015, 18:13
by LazY Puppy
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: Select all

//#############################################################################
// 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
//#############################################################################

Posted: Fri 30 Jan 2015, 19:22
by bobc
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.

:)

Posted: Tue 15 Mar 2016, 22:16
by LazY Puppy
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: Select all

# 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 &