Clock Module Request Thread last updated on 2003-05-07 20:29:28

Posted by member 22915 on 2003-04-08 02:24:54

I'm sorry if something like this has already been suggested, or already exists. I did search, and didn't find anything. If it does exist, and someone could point me in the right direction, it'd be much appreciated

I would like the ability, in some clock module, to have it put up bitmaps based around what day of the week it is.

I saw a similar suggesetion, for bitmapped fonts, but I want something that goes over bitmapped fonts.

My reason for this is that I am a student of Japanese. In the Japanese language, it is possible to represent which day of the week it is with one character. Since I would understand it, it seems only logical to me to save space, and state which day of the week it is in my clock in one character, instead of a possible 8 (Saturday).

I could see other possibilities for this, as well, for people who might want custom bitmaps for each day of the week.

I realize, though, that this is not a highly-demanded feature. And really, if I could tool-wise, and had the skills, I would just write one myself. However, I don't.

My apologies for being rude and possibly asking a redundant or stupid question. I have looked as many possible places as I could find, and there was nothing similar to what I wanted.

(Minor note: the bitmaps would be of the Japanese characters. I'm not asking for UNICODE support here)

Sorry to waste your time,
Axiem

Posted by member 333 on 2003-04-08 03:20:16 link

sounds like a good suggestion to me ;) Too bad I can't really help you with anything in the code-department, but you've at least got my support...

Posted by member 99 on 2003-04-08 05:05:59 link

You might try nornir, which won't give you bitmaps, but might give you the appropriate kanji.

Posted by member 7223 on 2003-04-08 09:29:34 link

Another way is to use rainlendar.
Another way is to compute the day (of the week) from the date.

Posted by member 22915 on 2003-04-08 14:42:55 link

I tried nornir.

After playing with it for an hour or two, I can't get it to display the kanji it's supposed to. I tried various fonts, various settings, with no success. It works in all other ways otherwise, just leaves a "?" instead of putting a kanji on the bar.

Rainlender does allow bitmapping of days of the week. However, it doesn't cycle them. It merely prints a calendar. I just want one little box a la label that provides a bitmap (which happens to be a character)

I know how to compute day of the week from the date. However, that does me no good, since I can't code a module myself (hell, the only language I can really program well in is Ada). Plus, I don't know of any scripting things for litestep that can determine the day of the week and then act based on that (much less that updates without me needing to poke it).

If label had something that could script based on day of the week, that would be awesome. But I doubt that.

Sorry to be so picky and to cause too much trouble. This is what I get for wanting a very specific user interface.

Posted by member 7223 on 2003-04-08 17:03:04 link

I'll think about it...

Posted by member 99 on 2003-04-08 18:46:27 link

There's a formula here, but you need to be able to get the month, day, and year in $vars$ in order to use this.

It looks like nornir fails to work because strftime doesn't seem to work properly across locales. GetTimeFormat/GetDateFormat would work, but substancially change how the module is configured... Does label allow you to specify the font charset? Anyone know?

Posted by member 7223 on 2003-04-08 21:36:07 link

Sorry Axiem, I've made some tests and I have to admit I engage myself too quickly. There's several difficulties with your request (mzscript limitation or bugs):
- no dimensioned vars (could be bypass)
- !VarMod var number (return the modulo) doesn't work (could be bypass)
- no !VarDiv var number (to divide var by number). Could be bypass by multiplying by 1/number. But it returns 0 on some system.

Posted by member 1 on 2003-04-08 22:13:43 link

you could do it with a timer...a ton of IF statements...and a function to Show and Hide shortcuts.

Posted by member 99 on 2003-04-08 23:00:57 link

I'll write up a module to give you day of the week as a number in a bang command and a short script that'll make that do what you want with skinbox.

Posted by member 1 on 2003-04-08 23:06:10 link

to get the day of the week I would ask the user to select from a config dialog and then use something like textedit to store and update daily.

*shortcut "Monday" x y monday.png .none .none #100OH !none

*script bang !DayChange
if day \

Posted by member 1 on 2003-04-08 23:15:13 link

to get the day of the week I would ask the user to select from a config dialog and then use something like textedit to store and update daily.

*shortcut "Monday" x y monday.png .none .none #100OH !none

*script bang !DayChange
if day less_than 7
++day
else
day = 1
endif
*script exec !textreplace "$ConfigDir$\setup.rc" "day*" "day %{day}"
if day = 1
*script exec !Execute [!ShortcutGroupShow 100][!ShortcutGroupHide 700]
...
endif
*script ~bang

I swear I have to do everything around here. :)

Posted by member 7223 on 2003-04-09 01:03:11 link

Humm... a bit tricky, isn't it ?

Posted by member 99 on 2003-04-09 01:43:55 link

Ok, with datebang and skinbox you can now do this. Example.

The only trick is getting it to update at midnight. As written, this will always show the correct day on startup/recycle.

(and it only uses 1 png, 2 windows, and less than 10 lines in step.rc)

Posted by member 7 on 2003-04-09 02:38:16 link

try alarm.dll (http://www.loose-screws.com/comment.php?type=mod&id=2) for the update at midnight.

Posted by member 22915 on 2003-04-09 02:41:47 link

Woo, thanks :) I'll try and get it to work tomorrow, though, not tonight, as it's Late for me.

Is there a module out there that you can configure to run a bang command on a timer of some sort (like, every 20 minutes, it does a !poll_news_sites or every day at 1, it runs !clean_hard_drive or something?)?

That could be used in conjunction with all of this to get something workable, I think.

Though I find it slightly amusing that I have to end up running something like 3 modules to get a little square to show up on my desktop. I'm somewhat surprised (and somewhat not) that it hasn't already been written into an existing clock module.

But, again, thank you very much for your help. I'll post an update soon with how it went

Posted by member 22915 on 2003-04-09 10:54:16 link

Hooray, it works!

Thank y'all so much. It might be a bit of a hack, but it's nifty.

Now I have no good excuses (aside from school) as to why I'm not making my new nifty cool theme that I've been wanting to make.

Posted by member 99 on 2003-04-19 03:01:40 link

I just noticed that mzScript has a %{weekday}, so I didn't have to write datebang after all :P

Posted by member 22915 on 2003-05-07 15:38:01 link

Sorry to drag this back up after so long, but I'm having problems. Using datebang and skinbox, I'm able to get the indicator up, but I can't get the thing to reload. Whatever I try, to run the DOWUpdate thing, I get an "uninitialized variable" error, without telling me what variable is unintisalized. So I still have to recycle every time the day changes, which is wrecking havoc with my vwm.

...how would I go about using mzScript? I never quite understood what it was for, or how to use it? (and, how woul I go about using it in this context?)

Posted by member 99 on 2003-05-07 20:29:28 link

Dunno why that would happen...

Untested, but using mzScript 0.9b12 instead of DateBang:
*script bang !UpdateDOW
*script exec !SkinBoxExec DOWCache !SkinBoxBitmap DOWDisp :^@ik^ 0 %#%{weekday}*$DOWTileHeight$%# $DOWTileWidth$ $DOWTileHeight$
*script ~bang
(that's 3 lines btw)

If that doesn't work, I guess you might have to go with shortcut groups, but that would be a real pain.