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 Fri 28 Nov 2014, 13:09
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Powerapplet_tray-2.5 with low battery warnings and shutdown
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
pemasu


Joined: 08 Jul 2009
Posts: 5465
Location: Finland

PostPosted: Sat 20 Apr 2013, 11:28    Post subject:  Powerapplet_tray-2.5 with low battery warnings and shutdown
Subject description: when the battery level is critical
 

Powerapplet_tray-2.5 with extra functions.

I decided to test if I could add to the existing C source code Xdialog and alarm sound warning when Battery is discharging at 10 % level and shutdown when battery level is 5 %.

I think that my small additions were succesful without C coding knowledge.

So...at 10 % discharging level you should get Xdialog warning of low battery and also short alarm sound. Those will repeat about once a minute. At 5 % discharging level the wmpoweroff will be executed and computer will shutdown.....with saving and with normal shutdown process.

I needed alternative to the vattery-acpitool because it has not been reliable for me after several suspends to the ram and waking up. The Vattery tray app has been there but the certain battery level operations has not been performed.
I decided to test something else....
powerapplet_tray-2.5-with-extras.pet
Description 
pet

 Download 
Filename  powerapplet_tray-2.5-with-extras.pet 
Filesize  5.08 KB 
Downloaded  224 Time(s) 
powerapplet_tray-2.5-extras-source.tar.gz
Description 
gz

 Download 
Filename  powerapplet_tray-2.5-extras-source.tar.gz 
Filesize  8.71 KB 
Downloaded  190 Time(s) 
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1847
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 21 Nov 2014, 18:31    Post subject:  

Bonjour,
Trying to compile Powerapplet_tray-2.5 using source files (including "compile" file) given above, I get these messages in console Shocked Crying or Very sad :
Code:
/tmp/cczVuJ6I.o: In function `Update':
powerapplet_tray.c:(.text+0x4a4): undefined reference to `gtk_status_icon_get_blinking'
powerapplet_tray.c:(.text+0x4be): undefined reference to `gtk_status_icon_set_blinking'
powerapplet_tray.c:(.text+0x4ed): undefined reference to `gtk_status_icon_set_from_pixbuf'
powerapplet_tray.c:(.text+0x513): undefined reference to `gtk_status_icon_set_from_pixbuf'
powerapplet_tray.c:(.text+0x539): undefined reference to `gtk_status_icon_set_from_pixbuf'
powerapplet_tray.c:(.text+0x55f): undefined reference to `gtk_status_icon_set_from_pixbuf'
powerapplet_tray.c:(.text+0x585): undefined reference to `gtk_status_icon_set_from_pixbuf'
/tmp/cczVuJ6I.o:powerapplet_tray.c:(.text+0x5a1): more undefined references to `gtk_status_icon_set_from_pixbuf' follow
/tmp/cczVuJ6I.o: In function `Update':
powerapplet_tray.c:(.text+0x691): undefined reference to `gtk_status_icon_set_blinking'
powerapplet_tray.c:(.text+0x7d6): undefined reference to `gtk_status_icon_set_tooltip'
/tmp/cczVuJ6I.o: In function `create_tray_icon':
powerapplet_tray.c:(.text+0x839): undefined reference to `gtk_status_icon_new'
powerapplet_tray.c:(.text+0x858): undefined reference to `g_type_check_instance_cast'
powerapplet_tray.c:(.text+0x884): undefined reference to `g_signal_connect_data'
powerapplet_tray.c:(.text+0x89e): undefined reference to `g_type_check_instance_cast'
powerapplet_tray.c:(.text+0x8ca): undefined reference to `g_signal_connect_data'
powerapplet_tray.c:(.text+0x8d6): undefined reference to `gdk_pixbuf_new_from_xpm_data'
powerapplet_tray.c:(.text+0x8e7): undefined reference to `gdk_pixbuf_new_from_xpm_data'
powerapplet_tray.c:(.text+0x8f8): undefined reference to `gdk_pixbuf_new_from_xpm_data'
powerapplet_tray.c:(.text+0x909): undefined reference to `gdk_pixbuf_new_from_xpm_data'
powerapplet_tray.c:(.text+0x91a): undefined reference to `gdk_pixbuf_new_from_xpm_data'
/tmp/cczVuJ6I.o:powerapplet_tray.c:(.text+0x92b): more undefined references to `gdk_pixbuf_new_from_xpm_data' follow
/tmp/cczVuJ6I.o: In function `create_tray_icon':
powerapplet_tray.c:(.text+0x9be): undefined reference to `gtk_status_icon_set_from_pixbuf'
powerapplet_tray.c:(.text+0x9d3): undefined reference to `gtk_status_icon_set_tooltip'
powerapplet_tray.c:(.text+0x9e8): undefined reference to `gtk_status_icon_set_visible'
/tmp/cczVuJ6I.o: In function `main':
powerapplet_tray.c:(.text+0xc76): undefined reference to `gtk_init'
powerapplet_tray.c:(.text+0xc9c): undefined reference to `gtk_timeout_add'
powerapplet_tray.c:(.text+0xcad): undefined reference to `gtk_main'
collect2: ld returned 1 exit status
strip: 'powerapplet_tray': No such file
Script completed hit RETURN to close window.


What's wrong?
Thanks.
Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1847
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 21 Nov 2014, 19:18    Post subject:  

Bonsoir,
I finally found what's wrong!
The "compile" file must be modified this way:
Code:
gcc -Wl,--no-as-needed `pkg-config --cflags --libs gtk+-2.0` powerapplet_tray.c -o powerapplet_tray
instead of:
Code:
gcc `pkg-config --cflags --libs gtk+-2.0` powerapplet_tray.c -o powerapplet_tray

Cordialement.

_________________

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