Menu

#4 Show/hide seconds in the clock plugin

open
nobody
None
5
2008-03-21
2008-03-21
Anonymous
No

After getting myself a G15 v2 keyboard yesterday, I got a bit tired of the clock not showing seconds in digital mode, and the fact that one of the L-buttons was unused, making it perfect for such a setting, so I decided to look a bit at the code.

About two and a half hours later, this patch was done. It uses the L5 button to toggle showing seconds (default is to show them), and it applies both to digital and analog mode. I also decided to make some changes to digital mode: I moved the AM/PM indicator to the top (It looked and fitted better together with the seconds), and changed %H to %k for 24 hour mode (so hours with one digit don't get an added zero) to make 12 and 24 hour mode more similar.

It applies cleanly to g15daemon 1.9.5.3, so feel free to try it and/or include it in later versions :)

Discussion

  • Nobody/Anonymous

    Clock seconds patch

     
  • Nobody/Anonymous

    Logged In: NO

    Whoops, I thought my name would end up on that report, but it didn't, since my account is pending (and apparently, I can't confirm it, just reported that error).
    Anyway, my name (for the sake of credits etc.) is Jocke "firetech" Andersson, and you can contact me at jocke AT barbanet DOT com, if you really need to ;)

     
  • Nobody/Anonymous

    Logged In: NO

    Oh, found a small bug. Since I can't attach a new patch in a comment I'll just say this in plaintext:
    After applying the patch, change line 169 in plugins/g15_plugin_clock.c from:

    if(buf[0]==49)

    to:

    if(buf[0]==49 || (buf[0]==' ' && buf[1]==49))

    An updated patch is also available at http://firetech.nu/files/g15daemon-1.9.5.3-clock_seconds.patch

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.