pWidgets 2.5.8

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2661 Post by 01micko »

OK, time to make a battery patch.. I think NOP uses the older version of Pwidgets, I will make 2 patches, It wont harm anything to try both.

brb

OK, this is important. If you run NOP I'm sure there is a difference in one line of the config file, normally it looks like this...

Code: Select all

#this is a Pwidgets config file
#the actual building of the graphics is defined in bottom of this file, - after 'TEXT'. 
#Battery monitor

#### PWIDGETS #####
HEIGHT=80
OFFSET_X_LEFT=40
OFFSET_X_RIGHT=40


#### CONKY ####
#COLORS --- 0:headings 1:base-info 2:extra-info 3:markers 5:green 6:red
#Colors are defined in theme-files, - NOT here.
color0 A2914E
color1 666666
color2 bbbbbb
color3 ffab00
color5 499D3A
color6 red

background yes
own_window yes
own_window_type roxdesktop
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_colour hotpink
double_buffer yes
total_run_times 0
update_interval 10
minimum_size 140 5
draw_shades yes
draw_outline no
draw_borders no
stippled_borders 2
border_margin 4
border_width 1
default_color white
default_shade_color 333333
default_outline_color red
no_buffers yes
uppercase no
use_spacer none
#font fixed
use_xft yes
xftfont monofonto:size=16

TEXT
${color2}${font Pdingobats:bold:size=20}4${font DejaVu:bold:size=13}${if_existing /sys/class/power_supply/BAT0}$alignc${color0}Battery$endif${if_existing /sys/class/power_supply/BAT1}$alignc${color0}Battery$endif${if_existing /sys/class/power_supply/BAT2}$alignc${color0}Battery$endif
${font}${color1}${if_existing /sys/class/power_supply/BAT0}${battery BAT0}$endif${if_existing /sys/class/power_supply/BAT1}${battery BAT1}$endif${if_existing /sys/class/power_supply/BAT2}${battery BAT2}$endif
${if_empty ${execi 10 /usr/local/pwidgets/widgets/scripts/Battery}}${color5}${else}${color6}${endif}${if_existing /sys/class/power_supply/BAT0}${battery_bar 10 BAT0}$endif${if_existing /sys/class/power_supply/BAT1}${battery_bar 10 BAT1}$endif${if_existing /sys/class/power_supply/BAT2}${battery_bar 10 BAT2}$endif
You will notice at line 23 "own_window_type roxdesktop". I think it is different in NOP, perhaps replace "roxdesktop" with "desktop" or "override". You can check with other configs, in NOP I think that they are in /root/.pwidgets/configs (Newer pwidgets the configs are at /usr/local/pwidgets/widgets/configs)

Here's the patches, I think use "battery-patch-old" for NOP

Please report success or failure! (or else how do we know if it works for others :wink: )

HTH

Cheers
Attachments
battery-patch-old.pet
please use for older Pwidgets before 2.2
(1.03 KiB) Downloaded 382 times
battery-patch-new.pet
please use for the latest Pwidgets
(1.05 KiB) Downloaded 368 times
Puppy Linux Blog - contact me for access
yerc1
Posts: 118
Joined: Sat 10 Jan 2009, 02:40

Battery widget not coming up?

#2662 Post by yerc1 »

hi micko
thanks for your quick reply.
as NOP 431 uses pwidgets 2.5, i first tried "battery-patch-new" with no success.
i removed the pet and installed "battery-patch-old" which then showed the widget with only a lighting icon (please see screenshot attached) - no text/ battery level indicator.
i appreciate your further help...
Attachments
Screenshot.png
lighting icon is the battery widget, so i believe.
(34.65 KiB) Downloaded 1223 times
yerc1
Posts: 118
Joined: Sat 10 Jan 2009, 02:40

#2663 Post by yerc1 »

hi micko,
in addition to my post above.
As you suggested, I modified line 23 of the config file as "own_window_type roxdesktop #desktop, override".
This is exactly what the line looks like from the calendar config file.
Many thanks
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2664 Post by 01micko »

yerc1

What this tells me is that at least conky is working for the widget, that is good :)

Now we must find out why the battery in your laptop is not found.

Please check in /sys/class/power_supply to see if BAT0, BAT1, or BAT2 is there, or anything else for that matter.

A question... Do you get the little battery indicator in the task bar showing a percentage of battery left?

Cheers
Puppy Linux Blog - contact me for access
yerc1
Posts: 118
Joined: Sat 10 Jan 2009, 02:40

#2665 Post by yerc1 »

01micko wrote:yerc1

Now we must find out why the battery in your laptop is not found.

Please check in /sys/class/power_supply to see if BAT0, BAT1, or BAT2 is there, or anything else for that matter.

A question... Do you get the little battery indicator in the task bar showing a percentage of battery left?

Cheers
micko,
there's nothing in /sys/class/power_supply.
adding the battery monitor on to the panel also shows only "0%" status and "Charging from AC" tooltip even when not charging.
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#2666 Post by 01micko »

I see... and I saw your post in NOP thread.. booting acpi=off... that would possibly explain the situation.

Perhaps the newer kernel is not suited to your hardware.

I just tried my patch on my eee pc (no save file on a fresh install of zigbert's Stardust puplet) and while the battery showed up anyway, it still showed up with the patch.

Now I do understand that in Pwidgets 2.5 the patch is necessary. I run one of Gray's puplet's (modded by jemimah) BoxPuppeee on my eee and it has Pwidgets-2.5. The battery didn't show up until I fixed the code. I think this is due to the newer conky, and the syntax in the original battery config is a little incorrect. While it would work with BAT0 I have serious doubts that it would work at all on BAT1 and BAT2.

I think we found the cause. :wink: Perhaps running a puplet with an older kernel will allow you to have acpi on.

Cheers
Puppy Linux Blog - contact me for access
yerc1
Posts: 118
Joined: Sat 10 Jan 2009, 02:40

#2667 Post by yerc1 »

micko
two restarts later and the battery widget came up on its own.
thank you for your help. :D
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2668 Post by Sylvander »

Total monthly upload/download: is there a PET?

Might a widget provide this capability?
User avatar
joel
Posts: 185
Joined: Thu 26 Feb 2009, 16:39
Location: Buffalo, NY & Nottingham, England

Pwigets weather issue

#2669 Post by joel »

HI! I posted before about this issue and wanted to check back as I have made some progress.

I am at university and use a name, password, and proxy to acess the net. I had trouble with getting weather, weatherx, moon-phase, or anyother widget which used the internet to retrive data. I was unsure of how to input those proxy settings into it. I recently was able to get wget, and Google Earth to both acess the net by adding "export http_proxy=http://username:password@proxy.proxy.ac.uk" to /etc/profile.local. I first tried putting it into /etc/rc.d/rc.local but that didnt boot on start up so no programs would work. The trouble is now I still am unable to get pwidgets (or alsa via stream tuner) to acess the web. is there anything I may be missing? I even tried to put that code into the 0_show_widgets file in/root/Startup/ to not avail.

Any idea?
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2670 Post by Sylvander »

I notice the weather widget is fetching every 10 seconds.

Can this be configured to fetch say every 30 minutes?
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#2671 Post by tasmod »

Yes, open the Weather config in /usr/local/pwidgets/widgets/configs

and alter the execi 10 calls after TEXT to execi 1800
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#2672 Post by tasmod »

As an alternative here's a weather widget from some time ago.


Cloud is just a name, as I didn't want to clash with weather widget.

This does update every two minutes due to the more detailed readout.

To use it you need to alter the Cloud config file where the line begins "URL=" this is currently set to my location as UKXX1885.

You need to check on this site

http://weather.yahoo.com/

for your location and read the location code in the address bar when you have located your weather.
Attachments
Cloud-0.2.pet
For other than Stardust
(1.78 KiB) Downloaded 499 times
Cloud-0.1.pet
Stardust Puppy only
(1.81 KiB) Downloaded 348 times
cloud.jpg
(8.32 KiB) Downloaded 919 times
Last edited by tasmod on Fri 15 Jan 2010, 14:54, edited 3 times in total.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2673 Post by zigbert »

The reason why weather is set to an unnatural high update frequency, is because it sometimes fails to connect at first try. Waiting 30 mins for next update is in this case an eternity :)
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#2674 Post by tasmod »

Strangely Zigbert I've never had a problem with start of weather. I did at one point get some strange errors which I put down to maintenance works on the site causing parsing errors.

I like the readout from Cloud, as for me there was all the info I was interested in. It can be set to Centigrade but then it changes wind mph as i'm not used to kph.

Micko was making me a set of font symbols to put alongside the wind direction to give an arrow readout.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2675 Post by Sylvander »

1. "open the Weather config in /usr/local/pwidgets/widgets/configs
and alter the execi 10 calls after TEXT to execi 1800
"
(a) There is no folder /usr/local/pwidgets/widgets/configs

(b) There is however a file = /root/.pwidgets/configs/Weather
Prior to seeing the above instructions...
I had a go following instructions I found in a recent webpage on the topic.
I altered the following setting within this file:
update_interval 10
To...
update_interval 60 [Guessed at this one, no instructions given]
And that SEEMED to do the trick.

(c) Within the file in (b) above, beginning on line 55 there is the following:

Code: Select all

TEXT
${color3}${font pdingobats:size=40}${execi 10 . /root/.pwidgets/scripts/WeatherIcon "EUR|UK|UK631|Edinburgh" }${color0}${font}  ${execi 10  /root/.pwidgets/scripts/Weather city}${font DejaVu :style=bold:size=6}
   
${font}${color1}${execi 10  /root/.pwidgets/scripts/Weather text}
Are these 3 values [execi 10] what I aught to have altered?
And should I restore the original value in (b) above? [update_interval 10]
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2676 Post by Sylvander »

Is it possible to get the weather widget to either display a 5-day forecast, or else to give a 1-day forecast, but be able to click on it to quickly easily get a 5-day forecast?
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#2677 Post by tasmod »

Sorry, I'm using Zigberts Stardust release hence the file location reference. Pwidgets has been moved there.

In 431 etc it's in .pwidgets as you rightly point out.

I've always considered it to be update interval at 1 means that it will 'look' at the text script every second and run the execi at 10 second count.

I must admit I've never considered it further.

-----

In the weather download xml from which the info is parsed, is a two day forecast only, that appears to be all available on rss.

I'll look further into it and post back.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#2678 Post by tasmod »

OK, both RSS feeds, Accuweather (Weather widget) and Yahoo Weather (Cloud widget) only give 'today' and 'to-morrow' forecasts.

This is the bit that is the second day forecast in Weather:-

Code: Select all

				<title>1/15/2010 Forecast</title>

				

					<link>http://www.accuweather.com/world-forecast-details.asp?loccode=EUR%7CUK%7CUK183%7CEpworth&fday=2</link> 

					<guid isPermaLink="false">http://www.accuweather.com/world-forecast-details.asp?loccode=EUR%7CUK%7CUK183%7CEpworth&fday=2</guid>
			

				<description>High: 42 F Low: 39 F Mostly cloudy, showers around <img src="http://vortex.accuweather.com/phoenix2/images/common/icons/12_31x31.gif" ></description>

				<pubDate>Thu, 14 Jan 2010 20:09:42 GMT</pubDate>
and this is Cloud 2nd day forecast info :-

Code: Select all

<BR /><b>Forecast:</b><BR />
Thu - Showers Early. High: 35 Low: 33<br />
Fri - Showers. High: 40 Low: 37<br />
<br />
that's the cutdown for day 2 and this is todays info:-

Code: Select all

<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="34"   direction="0"   speed="0" />
<yweather:atmosphere humidity="100"  visibility="2.49"  pressure="29.85"  rising="0" />
<yweather:astronomy sunrise="8:13 am"   sunset="4:13 pm"/>
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2679 Post by jpeps »

Great... this will feed my windsurfing addiction; all works stops beyond 15 MPH
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2680 Post by Sylvander »

What is execi ?

What happens when it is run?
Post Reply