The time now is Tue 19 Jan 2021, 08:30
All times are UTC - 4 |
Author |
Message |
seaside
Joined: 11 Apr 2007 Posts: 937
|
Posted: Sat 26 Jan 2013, 21:28 Post subject:
|
|
jamesbond wrote: | Patch:
1. Remove default include files path (if this path doesn't exist, execution fails - bad)
2. change popen mode from "r" to "w" - otherwise no output
3. ensure pclose after popen so that we don't get zombie process
4. close pid from g_spawn_async
5 add version numbering so we know which version of sit this is.
6. modify build process so that it is 64-bit compatible (should still work on 32-bit)
7. modify build process so that it tests correctly |
jamesbond,
Thank you for the improvements.
The original sit-master binary compiled by technosaurus runs in Puppy precise 5.4.1 and this one failed after patching.....
Code: | ./build
/usr/bin/ld: /tmp/cckw5xNo.o: undefined reference to symbol 'g_file_monitor_file'
/usr/bin/ld: note: 'g_file_monitor_file' is defined in DSO /usr/lib/libgio-2.0.so.0 so try adding it to the linker command line
/usr/lib/libgio-2.0.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status |
I added the link to -L/usr/lib/libgio-2.0.so.0 on the command line and that didn't make any difference.
I think it would be great to have this generally in Puppy and ideally one version for all, but I don't know enough about compiling.
Regards,
s
(EDIT: I just tried to compile the master-sit original and got the same error, so something must be different in Puppy Precise 5.4.1, even though the binary included works)
|
Back to top
|
|
 |
jamesbond
Joined: 26 Feb 2007 Posts: 3475 Location: The Blue Marble
|
Posted: Sat 02 Feb 2013, 07:45 Post subject:
|
|
I agree.
This is how to fix the compile it recent puppies (tested in my homebrew slackware-based 32-bit puplet). Do it after you apply the patch.
Change line 7 in "build" from
Code: | sit.c -o sit -lgtk-x11-2.0 && strip --strip-all -R .note -R .comment sit | To Code: | sit.c -o sit -lgtk-x11-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 && strip --strip-all -R .note -R .comment sit | Note the addition of -lgio-2.0 -lgobject-2.0 -lglib-2.0.
The easier way to compile without having to remember all this thingamagic is
Code: | sit.c -o sit $(pkg-config --libs gtk+-2.0) && strip --strip-all -R .note -R .comment sit | but technosaurus will disapprove of it (because, although it does make it easier to compile, it causes the compile to pull in unnecessary dependencies and make it slightly larger).
_________________ Fatdog64 forum links: Latest version | Contributed packages | ISO builder
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sat 02 Feb 2013, 10:45 Post subject:
|
|
I think I was adding the -Wl,--as-needed flag too, which tells the linker to look in the deps. Amazingly it builds and runs fine on windows, so I would guess its the hacky canonical patches. I cant' check the puppy build right now since my classes all require windows and/or a full java sdk.
-btw thanks for the patches
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 937
|
Posted: Mon 04 Feb 2013, 13:46 Post subject:
|
|
jamesbond wrote: |
Change line 7 in "build" from
Code: | sit.c -o sit -lgtk-x11-2.0 && strip --strip-all -R .note -R .comment sit | To Code: | sit.c -o sit -lgtk-x11-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 && strip --strip-all -R .note -R .comment sit | Note the addition of -lgio-2.0 -lgobject-2.0 -lglib-2.0.
|
jamesbond,
Thanks. It worked nicely.
In case anyone wants the compiled binary made in Precise 5.4.3, I've attached it here.
Regards,
s
Description |
James patch to technosaurus sit-master
|

Download |
Filename |
sit-james-master-bin.tar |
Filesize |
20 KB |
Downloaded |
816 Time(s) |
|
Back to top
|
|
 |
eadmaster
Joined: 09 Feb 2013 Posts: 46
|
Posted: Sun 14 Apr 2013, 07:32 Post subject:
|
|
is it possible to set the tooltip as a command instead of a fixed string?
So when the mouse is hovering, the cmd is executed and the output is displayed in the tooltip...
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sun 14 Apr 2013, 11:54 Post subject:
|
|
You can set something up in your control script to modify the tooltip file ... either by periodically running said command or running it based on some event.
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
eadmaster
Joined: 09 Feb 2013 Posts: 46
|
Posted: Sun 14 Apr 2013, 12:36 Post subject:
|
|
oh, you're right... i didn't think about it!
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sat 20 Jul 2013, 00:06 Post subject:
|
|
I am reworking sit to also do the desktop ... Tentatively renaming to sdesk
New abilities will be desktop widgets that can be provided by using svg images... Like in pwidgets or gkrellm. Webcam shots, tv tuner captures, slideshows, graphs, text, possibly even desktop icons.
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sun 21 Jul 2013, 15:13 Post subject:
|
|
sdesk is now in a working alpha state with all of the sit parts still intact.
the usage has changed to the following format:
Code: |
-i <include files>
-b <background imagge>
-t <status icon> <tooltip> <left click action> <right click action>
the -t option can be used multiple times,
|
Description |
|

Download |
Filename |
sdesk.tar.gz |
Filesize |
8.79 KB |
Downloaded |
778 Time(s) |
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Mon 18 Aug 2014, 22:40 Post subject:
|
|
Could someone give me some pointers on how/where to wedge gettext in to the tooltip messages? I don't think it can be done internally since there are no strings... it needs to be done in the caller (shell script or whatever invokes the tray app)
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
Bert

Joined: 30 Jun 2006 Posts: 1107
|
Posted: Tue 19 Aug 2014, 07:53 Post subject:
|
|
Hi Techno,
Something like this:
Code: | <pixmap tooltip-text="'$(gettext ' This is a good idea! ')'">
<input file>'$WORKDIR'/icons/lightbulb.png</input>
</pixmap> |
_________________

|
Back to top
|
|
 |
torios

Joined: 05 Dec 2014 Posts: 28
|
Posted: Fri 05 Dec 2014, 19:41 Post subject:
SIT and cmake |
|
Hi I am wondering if anyone here has tried using cmake to compile sit... if so, I could use some pointers... I am trying to make a debian package for sit, as well as a PPA for Ubuntu.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Fri 05 Dec 2014, 20:28 Post subject:
|
|
Here is a Makefile in case the ./build script doesn't work
Code: | # Makefile for sdesk.
#CC = /usr/i386-linux-uclibc/bin/i386-uclibc-gcc
#CC = diet gcc
#CC = musl-gcc
CC ?= gcc
#CFLAGS = -pipe -Os -mtune=i386 -static -s -Wall -I/usr/i386-linux-uclibc/usr/include
#CFLAGS = -pipe -Os -mtune=i386 -static -s -Wall
CFLAGS = -Os -finline-small-functions -ffunction-sections -fdata-sections -fmerge-all-constants \
-fomit-frame-pointer -mno-accumulate-outgoing-args -fno-unwind-tables -fno-asynchronous-unwind-tables
#LDFLAGS = -L/usr/i386-linux-uclibc/lib -lm -Wl,--gc-sections,--sort-common,-s
LDFLAGS = -Wl,--gc-sections,--sort-common,--as-needed,-s -lm `pkg-config gtk+-x11-2.0 --libs`
#see stb_vorbis for various size vs. speed defines
DEFINES = `pkg-config gtk+-x11-2.0 --cflags`
OBJECTS = sdesk.c
BINDIR = /usr/bin
sdesk: $(OBJECTS)
$(CC) $(CFLAGS) $(DEFINES) $(OBJECTS) $(LDFLAGS) -o sdesk
install:
strip --strip-all -R .note -R .comment sdesk
install sdesk $(BINDIR)/sdesk
uninstall:
rm -f $(BINDIR)/sdesk
clean:
rm -f *.o sdesk
depend:
gccmakedep -- $(CFLAGS) -- sdesk.c |
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Sat 06 Dec 2014, 05:52 Post subject:
|
|
some example C code for reading files in /proc/*
This one generates a battery svg and tooltip file.
Code: | #include <stdio.h>
#include <fcntl.h>
void do_bat0(char *svg,char *tt){
char var[64],val[64],model[32]="",oem[32]="",battype[32]="",text[]="Battery";
int dcap=0,cap=0,rcap=1,dv=0,pv=0,warn=0,low=0,present='n',sz=48,percent;
FILE *state = fopen("/proc/acpi/battery/BAT0/state", "r"),
*info = fopen("/proc/acpi/battery/BAT0/info", "r"),
*svgfp = fopen(svg, "w"),
*ttfp = fopen(tt, "w");
while (fscanf(info, "%64[^:] %*s %64[^\n]\n", var, val) != EOF){
if (!strcmp("design capacity",var)) sscanf(val, "%d %*s", &dcap);
if (!strcmp("last full capacity",var)) sscanf(val, "%d %*s", &cap);
if (!strcmp("design voltage",var)) sscanf(val, "%d %*s", &dv);
if (!strcmp("model number",var)) sscanf(val, " %s", &model);
if (!strcmp("OEM info",var)) sscanf(val, " %s", &oem);
if (!strcmp("battery type",var)) sscanf(val, " %s", &battype);
if (!strcmp("design capacity warning",var)) sscanf(val, "%d %*s", &warn);
if (!strcmp("design capacity low",var)) sscanf(val, "%d %*s", &low);
}
fclose(info);
while (fscanf(state, "%64[^:] %*s %64[^\n]\n", var, val) != EOF){
if (!strcmp("present",var)) sscanf(val, "%c%*s", &present);
if (!strcmp("remaining capacity",var)) sscanf(val, "%d %*s", &rcap);
if (!strcmp("present voltage",var)) sscanf(val, "%d %*s", &pv);
}
fclose(state);
percent=(100*cap)/rcap;
fprintf(svgfp, "<svg width=\"%dpx\" height=\"%dpx\" version=\"1.1\" " \
"viewBox=\"0 0 200 200\" preserveAspectRatio=\"none\" " \
"xmlns=\"http://www.w3.org/2000/svg\">\n" \
"<rect x=\"20%%\" width=\"60%%\" height=\"100%%\" fill=\"#111\"/>\n" \
"<rect x=\"20%%\" width=\"60%%\" y=\"%d%%\" height=\"%d%%\" fill=\"#0F0\"/>\n" \
"<text x=\"100\" y=\"100\" fill=\"#FFF\" font-size=\"%d\" " \
"text-anchor=\"middle\" transform=\"rotate(90 100,100)\">%s</text>\n" \
"</svg>", sz, sz, 100-percent, percent, 200/(strlen(text)-1), text);
fclose(svgfp);
fprintf(ttfp, "%20s: %s\n" "%20s: %s\n" "%20s: %s\n" "%20s: %d mWh\n",
"Make", oem, "Model", model, "Type", battype, "Percent remaining", percent );
fclose(ttfp);
}
int main(int argc, char **argv){
do_bat0("batt.svg","batt.tt");
return 0;
}
#if 0 //another example for /proc file with a header
int main(int argc, char **argv){
FILE *fp = fopen("/proc/net/arp", "r");
char ip[99], hw[99], flags[99], mac[99], mask[99], dev[99], dummy[99];
fgets(dummy, 99, fp);
while (fscanf(fp, "%s %s %s %s %s %s\n", ip, hw, flags, mac, mask, dev) != EOF)
if (!strcmp(argv[1],ip))
printf("%s\n",dev);
return 0;
}
#endif
|
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
torios

Joined: 05 Dec 2014 Posts: 28
|
Posted: Sat 06 Dec 2014, 22:35 Post subject:
sdesk Ubuntu |
|
Hi technosaurus, that really helped! Thank you very much I did get the cmake file to configure and generate!!
I also have a preliminary package made...
However, I need to know:
What is this licensed and who do I license it to?
right now (place holder info)
GPL3
technosaurus
If you know all the people that contributed code to this, that would be very helpful!
I will let you know how it goes building the package for Ubuntu, and I am sure I will have questions for you about shell scripting and sdesk....
I don't know C, but only C++ so maybe now is a good time to learn C as well so I can make even lighter programs.
Thanks so much!!
|
Back to top
|
|
 |
|
|
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
|