OK
Pages: 1 2 3
Rating:
8.81
Thread Listing » AWN Applets
[Applet] Digital Clock with Date
#12750 by ryancr (1.0000) posted on 6:52pm Sunday, October 07th, 2007
Hi all,
[Q]



I just wanted a basic clock with the date for AWN, so I made one. I thought I would share it with who ever else wants it.
[Q]






Settings:
..Choose 12 or 24 hour clock
..Set colors
..Set font
..Time beside Date (good for smaller docks)
[Q]



Features
..Click icon launches calendar
....Double click date launches Evolution
..Copy Time
..Copy Date
..Adjust Date & Time
[Q]



*Edited at 5:19pm, 10/22/07
Score: -0.00 points
Any particular reason?
#12754 by Onilton (0.9977) posted on 7:07pm Sunday, October 07th, 2007
Any screenshots? D
[Q]

Score: 0 points
Any particular reason?
#12755 by searayman (1.0000) posted on 7:24pm Sunday, October 07th, 2007
nifty, but mine gets cut off:
[Q]



[Q]
Score: 0 points
Any particular reason?
#12756 by isaac_j87 (1.0000) posted on 7:29pm Sunday, October 07th, 2007
searayman said:
nifty, but mine gets cut off:
[Q]



What rev. of AWN are you running?
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12757 by ryancr (1.0000) posted on 7:33pm Sunday, October 07th, 2007
I assume its my fault, if the bar is set at say 48, the icons are all a fixed width are they not? You can't have some wide applet if you wanted?
[Q]

Score: 0 points
Any particular reason?
#12758 by isaac_j87 (1.0000) posted on 7:35pm Sunday, October 07th, 2007
Mhr3 made a rev. that applet window width has to 20% bigger than it's icon.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12759 by ryancr (1.0000) posted on 7:35pm Sunday, October 07th, 2007
Oh and here is a fixed version. The font is just a bit smaller.
[Q]




Score: 0 points
Any particular reason?
#12760 by ryancr (1.0000) posted on 7:36pm Sunday, October 07th, 2007
isaac_j87 said:
Mhr3 made a rev. that applet window width has to 20% bigger than it's icon.
[Q]



Oh, interesting is that so 'squish' will work?
[Q]

Score: 0 points
Any particular reason?
#12761 by searayman (1.0000) posted on 7:47pm Sunday, October 07th, 2007
ryancr said:
Oh and here is a fixed version. The font is just a bit smaller.
[Q]



still gets cut off a little on the time, just the last digit by a bit
[Q]
Score: 0 points
Any particular reason?
#12762 by isaac_j87 (1.0000) posted on 7:54pm Sunday, October 07th, 2007
ryancr said:
Oh, interesting is that so 'squish' will work?
[Q]



Yeah, think so...But don't quote me...
[Q]



I went into the code and played around a bit...pretty good stuff have a look:
[Q]



It's nice and simple and I like that...can't really think of anything to add??
[Q]



I went into the code and took out the tmp icon ("gtk-apply"). Didn't think it was necessary to have that show up before the clock...is it there for a reason?
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12763 by ryancr (1.0000) posted on 8:00pm Sunday, October 07th, 2007
isaac_j87 said:
It's nice and simple and I like that...can't really think of anything to add??
[Q]



Well I was thinking of things like change text color, font face, 12 or 24 hour clock, maybe a calender in the popup dialog.
[Q]



isaac_j87 said:
I went into the code and took out the tmp icon ("gtk-apply"). Didn't think it was necessary to have that show up before the clock...is it there for a reason?
[Q]



Umm, yeah, cuz I forgot to take it out ;)
[Q]

Score: 0 points
Any particular reason?
#12764 by ryancr (1.0000) posted on 8:02pm Sunday, October 07th, 2007
searayman said:
still gets cut off a little on the time, just the last digit by a bit
[Q]



Use the link on the first post, I'll just update that one from now on.
[Q]



I changed it just a little bit again, trying to keep the font as big as possible.
[Q]

Score: 0 points
Any particular reason?
#12765 by isaac_j87 (1.0000) posted on 8:03pm Sunday, October 07th, 2007
ryancr said:
Well I was thinking of things like change text color, font face, 12 or 24 hour clock, maybe a calender in the popup dialog.
[Q]



sounds good, can't wait!
[Q]



ryancr said:
Umm, yeah, cuz I forgot to take it out ;)
[Q]



lol...I see...
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12767 by searayman (1.0000) posted on 8:10pm Sunday, October 07th, 2007
still cut off a tiny bit:
[Q]



[Q]
Score: 0 points
Any particular reason?
#12768 by isaac_j87 (1.0000) posted on 8:11pm Sunday, October 07th, 2007
Hmmm..that's weird...it just disappeared off my dock.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12769 by ryancr (1.0000) posted on 8:12pm Sunday, October 07th, 2007
isaac_j87 said:
Hmmm..that's weird...it just disappeared off my dock.
[Q]



That happened to me once, but I missed the error, waiting for it to happen again.
[Q]

Score: 0 points
Any particular reason?
#12770 by ryancr (1.0000) posted on 8:17pm Sunday, October 07th, 2007
searayman said:
still cut off a tiny bit:
[Q]



Updated, fourth time lucky? ;)
[Q]



I'm going to have to come up with a better resizing algorithm, especially if I am going to allow the changing of font face.
[Q]



*Edited at 8:18pm, 10/07/07
Score: 0 points
Any particular reason?
#12771 by isaac_j87 (1.0000) posted on 8:17pm Sunday, October 07th, 2007
ryancr said:
That happened to me once, but I missed the error, waiting for it to happen again.
[Q]



I made a couple changes. I'm going to see if it happens again as well. If it doesn't i'll post the code.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12772 by ryancr (1.0000) posted on 8:18pm Sunday, October 07th, 2007

isaac_j87 said:
I made a couple changes. I'm going to see if it happens again as well. If it doesn't i'll post the code.
[Q]



Great thanks.
[Q]

Score: 0 points
Any particular reason?
#12773 by searayman (1.0000) posted on 8:19pm Sunday, October 07th, 2007
ryancr said:
Updated, fourth time lucky? ;)
[Q]



nope still cut off....
[Q]
Score: 0 points
Any particular reason?
#12774 by ryancr (1.0000) posted on 8:21pm Sunday, October 07th, 2007
searayman said:
nope still cut off....
[Q]



Hmm, what is the size of your bar?
[Q]

Score: 0 points
Any particular reason?
#12775 by mosburger (1.0000) posted on 8:22pm Sunday, October 07th, 2007
I'm curious about your disappearing clock... I've been working on spiffing up the python analog clock, and I was going to make a digital one (you beat me to it!). The problem w/ the PyClock is that it's consuming large amounts of memory 'cuz it's calling set_icon instead of set_temp_icon. But if I use set_temp_icon, it works fine, then goes away after some period of time. I assume that something is getting garbage collected that is still in use?
[Q]



Anyway - I'm *really* curious if it's the same issue. If you figure it out, I might be able to fix PyClock! :)
[Q]
Score: 0 points
Any particular reason?
#12776 by searayman (1.0000) posted on 8:22pm Sunday, October 07th, 2007
ryancr said:
Hmm, what is the size of your bar?
[Q]



default i haven't changed it.
[Q]
Score: 0 points
Any particular reason?
#12777 by ryancr (1.0000) posted on 8:23pm Sunday, October 07th, 2007
mosburger said:
Anyway - I'm *really* curious if it's the same issue. If you figure it out, I might be able to fix PyClock! :)
[Q]



Well I am using set_temp_icon..
[Q]

Score: 0 points
Any particular reason?
#12778 by searayman (1.0000) posted on 8:23pm Sunday, October 07th, 2007
bar height in awn-manger says 48
[Q]
Score: 0 points
Any particular reason?
#12780 by ryancr (1.0000) posted on 8:25pm Sunday, October 07th, 2007
It just disappeared:
[Q]



/home/ryan/.config/awn/applets/digitalClock/digitalClock.py:176: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed
return loader.get_pixbuf()
/home/ryan/.config/awn/applets/digitalClock/digitalClock.py:176: Warning: g_object_unref: assertion `object->ref_count > 0' failed
return loader.get_pixbuf()
/home/ryan/.config/awn/applets/digitalClock/digitalClock.py:176: Warning: g_object_ref: assertion `G_IS_OBJECT (object)' failed
return loader.get_pixbuf()
[Q]




it looks like its coming for that little method I borrowed from the weather applet, in turn that borrowed from the bling switcher
[Q]

Score: 0 points
Any particular reason?
#12781 by isaac_j87 (1.0000) posted on 8:28pm Sunday, October 07th, 2007
ryancr said:

it looks like its coming for that little method I borrowed from the weather applet, in turn that borrowed from the bling switcher
[Q]



I think it's a problem that still plagues the blingswitcher...I haven't had it disappear on me yet, but I read other people still experiencing the problem.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12783 by ryancr (1.0000) posted on 8:33pm Sunday, October 07th, 2007
isaac_j87 said:
I think it's a problem that still plagues the blingswitcher...I haven't had it disappear on me yet, but I read other people still experiencing the problem.
[Q]



Well I am using as I don't know how to make a icon just from a cairo resource that has no actual icon to start from.
[Q]



Score: 0 points
Any particular reason?
#12786 by isaac_j87 (1.0000) posted on 8:53pm Sunday, October 07th, 2007
ryancr said:
Well I am using as I don't know how to make a icon just from a cairo resource that has no actual icon to start from.
[Q]



You and me both. I've tried everything and I can't find any documentation on it either.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12787 by isaac_j87 (1.0000) posted on 9:00pm Sunday, October 07th, 2007
I FIGURED IT OUT!!
[Q]



Tell me if I did this right...the clock is showing up...
[Q]






This should be making a new icon from a cairo resource...correct me if I'm wrong.
[Q]



Watch out...I messed with the text positions and sizes and the fonts...it's giving me this wierd error also...but the clock still works and shows up.
[Q]

--
-Isaac

*Edited at 9:06pm, 10/07/07
Score: 0 points
Any particular reason?
#12789 by isaac_j87 (1.0000) posted on 9:17pm Sunday, October 07th, 2007
ryancr said:
So far so good.
[Q]



Unfortunately, as soon as you posted my clock disappeared...was there something else you needed to do?
[Q]

--
-Isaac

*Edited at 9:18pm, 10/07/07
Score: 0 points
Any particular reason?
#12790 by ryancr (1.0000) posted on 9:18pm Sunday, October 07th, 2007
hehe, damn, I tried to delete my post, yeah as soon as I posted I noticed it disappeared to.
[Q]

Score: 0 points
Any particular reason?
#12791 by isaac_j87 (1.0000) posted on 9:19pm Sunday, October 07th, 2007
ryancr said:
hehe, damn, I tried to delete my post, yeah as soon as I posted I noticed it disappeared to.
[Q]



Yeah, but it is what you wanted to do right?
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12792 by ryancr (1.0000) posted on 9:20pm Sunday, October 07th, 2007
yeah its is, so now I should be able to do away with the other method from the blingswitcher. Ill let you know how it goes.
[Q]

Score: 0 points
Any particular reason?
#12793 by ryancr (1.0000) posted on 9:27pm Sunday, October 07th, 2007
Ok I updated the link in the first post to an updated version. Hopefully it is fixed.
[Q]

Score: 0 points
Any particular reason?
#12794 by moonbeam (1.0000) posted on 9:38pm Sunday, October 07th, 2007
( no avatar )
ryancr said:
Well I am using as I don't know how to make a icon just from a cairo resource that has no actual icon to start from.
[Q]



There's a C function that will convert a cairo image surface to a pixbuf - that's what I'm using in Awn System Monitor. But it hasn't been merged into awn core yet. And there probably is some form of gdk_pixbuf_get_from_drawable() that will work - but you will lose all alpha info
[Q]



So unless you want to convert it into python I think the only way is the surface -> png -> pixbuf method. Which is ugly. But I think Neil does plan on merging it in so it should be available in python some time soon.
[Q]




--
http://moon-shiny.blogspot.com/

*Edited at 9:44pm, 10/07/07
Score: 0 points
Any particular reason?
#12795 by ryancr (1.0000) posted on 9:42pm Sunday, October 07th, 2007
moonbeam said:
There's a C function that will convert a cairo image surface to a pixbuf - that's what I'm using in Awn System Monitor. But it hasn't been merged into awn core yet. So unless you want to convert it into python I think the only way is the surface -> png -> pixbuf method. Which is ugly. But I think Neil does plan on merging it in so it should be available in python some time soon.
[Q]



Good to know, thanks.
[Q]



Yeah its a bit ugly, but it works ;)
[Q]

Score: 0 points
Any particular reason?
#12796 by moonbeam (1.0000) posted on 9:47pm Sunday, October 07th, 2007
( no avatar )
ryancr said:
Yeah its a bit ugly, but it works ;)
[Q]



Yeah. but if you're doing it every second you will get peculiarities. Trust me, there's a reason I sat down and got that C function working. It is an ok approach for occasional changes to the icon but I was noticing quite a few oddities when I was pushing it through once per second, especially when the system was under load.
[Q]



--
http://moon-shiny.blogspot.com/

*Edited at 9:48pm, 10/07/07
Score: 0 points
Any particular reason?
#12797 by isaac_j87 (1.0000) posted on 9:58pm Sunday, October 07th, 2007
ryancr said:
Yeah its a bit ugly, but it works ;)
[Q]



Yeah it's working fine over here.
[Q]

--
-Isaac
Score: 0 points
Any particular reason?
#12798 by ryancr (1.0000) posted on 9:59pm Sunday, October 07th, 2007
moonbeam said:
Yeah. but if you're doing it every second you will get peculiarities. Trust me, there's a reason I sat down and got that C function working. It is an ok approach for occasional changes to the icon but I was noticing quite a few oddities when I was pushing it through once per second, especially when the system was under load.
[Q]



ok, well hopefully Niel gets that python method working.
[Q]



Out of curiosity what do you mean by "oddities"
[Q]

Score: 0 points
Any particular reason?
#12800 by isaac_j87 (1.0000) posted on 10:05pm Sunday, October 07th, 2007
Ryan,
[Q]



I have a weird problem...it just turn 12:00 over here for me and the clock looks like this now...
[Q]



[Q]

--
-Isaac

*Edited at 10:06pm, 10/07/07
Score: 0 points
Any particular reason?
#12801 by moonbeam (1.0000) posted on 10:10pm Sunday, October 07th, 2007
( no avatar )

-stuttering of the icon when effects were being applied
-more frequent loss of reflection.
-instances where icon would disappear and/or be replaced by visual garbage for a moment.
-and more crashes when the system was under load.
[Q]



-I was actually seeing of these issues more when the system was under heavier load.
[Q]



-I'm not sure how much might have peculiarities in my code, inherent problems with the method being used, problems with system libraries and problems with awn-effects when under load. I have a suspicion that awn-effects has(or had) an issue with changing of icons when under heavy load... specifically I think there were/are issues when the pixbuf is changed then changed again before the previous pixbuf was rendered - and there's were/are certain ways of doing things that seem more prone to causing an issue. I haven't checked if I can still see these issues in the 0.2 release - they only appeared to be effecting awn system monitor and I just coded around them.
[Q]


Score: 0 points
Any particular reason?
#12802 by ryancr (1.0000) posted on 10:10pm Sunday, October 07th, 2007
oops fixed, link updated.
[Q]



You may find the time cut off a bit, I am just working on some auto scaling fonts.
[Q]



Score: 0 points
Any particular reason?
#12803 by ryancr (1.0000) posted on 10:12pm Sunday, October 07th, 2007
moonbeam said:
-I'm not sure how much might have peculiarities in my code, inherent problems with the method being used, problems with system libraries and problems with awn-effects when under load. I have a suspicion that awn-effects has(or had) an issue with changing of icons when under heavy load... specifically I think there were/are issues when the pixbuf is changed then changed again before the previous pixbuf was rendered - and there's were/are certain ways of doing things that seem more prone to causing an issue. I haven't checked if I can still see these issues in the 0.2 release - they only appeared to be effecting awn system monitor and I just coded around them.
[Q]



Thanks for the insight, I will keep an eye out and see if I notice any problems on my applet, though as you say it would be nice to do it the correct way.
[Q]

Score: 0 points
Any particular reason?
#12804 by isaac_j87 (1.0000) posted on 10:21pm Sunday, October 07th, 2007
ryancr said:
oops fixed, link updated.
[Q]



I'm still getting the weird "-" (hyphen) before the time.
[Q]

--
-Isaac

*Edited at 10:21pm, 10/07/07
Score: 0 points
Any particular reason?
#12805 by ryancr (1.0000) posted on 10:30pm Sunday, October 07th, 2007
isaac_j87 said:
I'm still getting the weird "-" (hyphen) before the time.
[Q]



Yep one more oops, fixed and updated.
[Q]

Score: 0 points
Any particular reason?
#12807 by ryancr (1.0000) posted on 10:52pm Sunday, October 07th, 2007
searayman said:
bar height in awn-manger says 48
[Q]



If your around I updated the link on the first post, and it now has the time automatically scaled to fit ( i hope )
[Q]

Score: 0 points
Any particular reason?
#12816 by ryancr (1.0000) posted on 2:08am Monday, October 08th, 2007
Update: ok so I already started adding stuff.
[Q]



You can choose font face, colors are in progress..
[Q]



Note scaling is far from perfect so some font faces will get cut off.
[Q]



Link in first post.
[Q]

Score: 0 points
Any particular reason?
#12821 by mosburger (1.0000) posted on 3:16am Monday, October 08th, 2007
Are you still using set_temp_icon? Have you tried using set_icon to see if the "disappearing applet" problem goes away, at the expense of a horrible memory leak? I still kinda suspect that's the real culprit...
[Q]
Score: 0 points
Any particular reason?
#12824 by mosburger (1.0000) posted on 4:28am Monday, October 08th, 2007
Bummer... doesn't seem to work for me?
[Q]



Traceback (most recent call last):
File "/home/mdesjardins/.config/awn/applets/digitalClock/digitalClock.py", line 257, in
applet = App (awn.uid, awn.orient, awn.height)
File "/home/mdesjardins/.config/awn/applets/digitalClock/digitalClock.py", line 35, in __init__
self.getPrefs()
File "/home/mdesjardins/.config/awn/applets/digitalClock/digitalClock.py", line 56, in getPrefs
self.fontColor = self.parseColors(self.gconf_client.get_string(self.font_color_path))
File "/home/mdesjardins/.config/awn/applets/digitalClock/digitalClock.py", line 108, in parseColors
colors = color.split(',')
AttributeError: 'NoneType' object has no attribute 'split'
[Q]


Score: 0 points
Any particular reason?
#12827 by nicosaturno (0.1826) posted on 4:57am Monday, October 08th, 2007
( no avatar )
same problem here :(...btw great work
[Q]

Score: 0 points
Any particular reason?
#12829 by baldmonkey (0.4036) posted on 5:15am Monday, October 08th, 2007
Should I need anything additional to get this to work, I have just downloaded and installed the version from the first post and all I'm getting on my dock is a white line.
[Q]

Score: 0 points
Any particular reason?
#12830 by baldmonkey (0.4036) posted on 5:22am Monday, October 08th, 2007
Also what about adding a very simple alarm function to it?
[Q]

Score: 0 points
Any particular reason?
#12844 by Hans Wurscht (0.1654) posted on 9:00am Monday, October 08th, 2007
( no avatar )
Won't work with me. :-(
[Q]



When starting Awn with the terminal i get this output:
[Q]



Traceback (most recent call last):
File "/home/franz/.config/awn/applets/digitalClock/digitalClock.py", line 257, in
applet = App (awn.uid, awn.orient, awn.height)
File "/home/franz/.config/awn/applets/digitalClock/digitalClock.py", line 35, in __init__
self.getPrefs()
File "/home/franz/.config/awn/applets/digitalClock/digitalClock.py", line 56, in getPrefs
self.fontColor = self.parseColors(self.gconf_client.get_string(self.font_color_path))
File "/home/franz/.config/awn/applets/digitalClock/digitalClock.py", line 108, in parseColors
[Q]

Score: 0 points
Any particular reason?
#12848 by ryancr (1.0000) posted on 10:12am Monday, October 08th, 2007
oops, fixed, link updated
[Q]

Score: 0 points
Any particular reason?
#12849 by Hans Wurscht (0.1654) posted on 10:16am Monday, October 08th, 2007
( no avatar )
Ok, now it works.
Nice :-)
[Q]

Score: 0 points
Any particular reason?
#12850 by nicosaturno (0.1826) posted on 10:18am Monday, October 08th, 2007
( no avatar )
perfect ^_^ i was waiting for a working clock applet ;D
[Q]

Score: 0 points
Any particular reason?
#12852 by ryancr (1.0000) posted on 10:25am Monday, October 08th, 2007
Hans Wurscht said:
Ok, now it works.
Nice :-)
[Q]



Good stuff.
[Q]



The next step is to get vertical scaling done right when you change the font face.
[Q]

Score: 0 points
Any particular reason?
#12853 by ryancr (1.0000) posted on 10:27am Monday, October 08th, 2007
mosburger said:
Are you still using set_temp_icon? Have you tried using set_icon to see if the "disappearing applet" problem goes away, at the expense of a horrible memory leak? I still kinda suspect that's the real culprit...
[Q]



I am still using set_temp_icon but I am not using that method from BlingSwitcher anymore. I am doing a cs.write_to_png('icon.png') and then making a pixbuf from that.
[Q]



Its a little hackish, but is working much better than before.
[Q]

Score: 0 points
Any particular reason?
#12854 by mosburger (1.0000) posted on 10:31am Monday, October 08th, 2007
ryancr said:
I am still using set_temp_icon but I am not using that method from BlingSwitcher anymore. I am doing a cs.write_to_png('icon.png') and then making a pixbuf from that.
[Q]



Hrm... OK, maybe I'll try that in PyClock. I downloaded the latest digital one... works great.
[Q]
Score: 0 points
Any particular reason?
Pages: 1 2 3
Thread Listing » AWN Applets » [Applet] Digital Clock with Date

Post A Reply:

Powered by Metaforum ©2004-2012
Get your own Free AJAX Forum Messageboard by visiting the offical site.
.