OESF Portables Forum
Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: prrthd on December 31, 2006, 04:07:41 pm
-
I have been searching around the forums to an answer to this question but with no luck. In pdaxrom how do you change the time format to be 12 hour vs 24 hour?
Thanks,
Jay
-
Bump ^
I curious about this also. I really don't like the "military" time that is on the taskbar.
Isn't there an applet to replace the taskbar clock??
Thank you,
Jon
-
Hear! Hear!.... I concur....
-
ok guys, I'm just modifying the clock applet to display 3:45p instead of 15:45 for you.
Just let me know (as I am from Germany, so unsure):
What is midnight (0:00)? Is it 12:00a or 12:00p?
(Same question for noon).
EDIT: Or do you prefer not to habe a and p displayed at all?
Thanks
daniel
-
Please let me know how you like this one.
I could not upload the binary with its original name, so I appended .txt as an extension. Please remove that extension and chmod +x the file if necessary.
Just start the binary from a console to test it, and if it pleases you, replace /usr/bin/mb_applet_clock with this new one.
[ You are not allowed to view attachments ]
daniel
-
Can't seem to get to Greenwich site at the minute but google cache produced the following text:
A.M. and P.M.
What is Noon and Midnight?
A.M. and P.M. start immediately after Midnight and Noon (Midday) respectively.
This means that 00:00 A.M. or 00:00 P.M. (or 12:00 A.M. and 12:00 P.M.) have no meaning.
Every day starts precisely at midnight and A.M. starts immediately after that point in time e.g. 00:00:01 A.M. (see also leap seconds)
To avoid confusion timetables, when scheduling around midnight, prefer to use either 23:59 or 00:01 to avoid confusion as to which day is being referred to.
The US officiial NIST site (http://tf.nist.gov/general/misc.htm) says something similar..... so if you code the strict definition .... I guess it will only be a problem on a very dark day, or underground given most of us will have daylight at 12:00 noon. Worst case you would have to wait 1 second to know .......
Hope this helps?
-
Thanks... Well, I just realized there is an "automatic" AM/PM suffix using the strftime function, so I've used that one for the above binary and leave responsibility for correctness of AM/PM to the people who developed these time functions
Will play a bit more with the clock applet and see if I can modify it to be a general one, configurable via command line switches.
daniel
-
Okay guys, so here it goes:
The new fully configurable clock applet
Here are the command line options:
-c color
Give a color name or hex RGB value; hex RGB values must be given within quotes, e.g.
red
white
"#9E9E33"
(default is black)
-f font
Give a font name. If font name contains more than one word, use quotes.
(default is "Sans Bold")
-m
(don't use military time)
-D
display date (it's a capital D, don't use the lower-case d)
Displays weekday and day of the month behind the time
-p padding
Padding value in pixels: The amount of pixels around the time display
The higher the value, the smaller the font.
Min = 0, Max = 20. (you can go higher, but it does not make sense)
(default: 0)
-w
This chooses the default parameters for the weeXpc distribution:
Arial, Yellow, Padding=6, Display the date.
For example, try the following commands:
./mb-applet-clock -m -f "Arial" -c blue -p 4
./mb-applet-clock -m -f "Times italic" -c white -D
And this is the binary (remove .txt extension and make it executable): [ You are not allowed to view attachments ]
Have fun and please report problems.
daniel
-
It seems to work, but as soon as you exit the console, or use ctrl+c in the console, the clock closes.
I'll see if it survives a restart.
It doesn't autoload, I'm going back to the original file.
EDIT:
Using the taskbar > "add", places this clock on the taskbar, just like the original one.
But how do you access the commandline options?
If you launch it using the commandline, it closes as soon as you exit the console.
-
It seems to work, but as soon as you exit the console, or use ctrl+c in the console, the clock closes.
I'll see if it survives a restart.
It doesn't autoload, I'm going back to the original file.
EDIT:
Using the taskbar > "add", places this clock on the taskbar, just like the original one.
But how do you access the commandline options?
If you launch it using the commandline, it closes as soon as you exit the console.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=153040\"][{POST_SNAPBACK}][/a][/div]
Oh yes, I should have mentioned that.
Just insert the command for it into the file ~/.matchbox/mbdock.session
There should be an mb-applet-clock somewhere, if the clock is active.
Just append the desired options to this command.
If you cannot find the command, then add it.
All this must be done outside X, because when X is terminated, the mbdock.session file is written using the current panel status.
You can test on the command line in order to find the options. but you are right: As soon as you close the commadn line / terminate the process, the clock vanishes again.
It has to be loaded permanently, e.g. by mbdock.session.
daniel
-
That doesn't work either.
If you remove the clock from the panel by using the click-hold method, then edit the above file, the clock doesn't come back. When you add it back, nothing is changed.
If you edit the file or replace it with your edited file while the clock is active, still nothing changes.
I'm talking about the mbdock.session file.
This won't survive a reboot either.
We need something more intuitive and permanent...
-
Restarting X made the changes go into effect.
I'll have to copy all this down for later, if I ever need to change the clock again.
BTW, thank you daniel3000 for working on this.
I think I'm not the only one who prefers a configurable clock.
-
We need something more intuitive and permanent...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=153047\"][{POST_SNAPBACK}][/a][/div]
It is important that you edit the mbdock.session file when X is not running, because X reads it at startup and writes it on shutdown, so modificatoins which you did while X is running are overwritten.
There may be a more intuitive way:
Once you found your prefered command line options, add them to the file /usr/share/applications/mb-applet-clock.desktop to the Exec line.
However, I am not sure if this will work, i.e. if these optoins will also be written automatically into the mbdock.session file on X shutdown.
However, if this works, you can remove and restart the clock applet as many times as you want without losing the options.
There is no more intuitive way to use command line options on applets, as far as I know.
If you need a GUI-based solution, one would have to rewrite the applet entirely, making it use a config file and a configuration menu, so it can be started without command line options.
If it turns out that using the .desktop file the options are not preserved either, it is still possible to write a wrapper script with the command line options, and et the .desktop file start that wrapper script instead of the actual binary.
I have a completely different solution:
I have created a copy of the mbdock.session file, configured that file to fit my needs, and added a command to the ~/.xinitrc script which always overwrites the mbdock.session file with my fixed copy.
That way, I can use whatever command line options I want,
I can edit that copy of the file always, even when under X,
BUT I lose the feature that I can permanently add and remove applets to / from the panel. I can add / remove tham for the running session, but as soon as I restart X, the configuration from the mbdock.session copy is restored.
Initially, I chose that method because some or all applets occasionally vanished (which is fixed now, I think). I had to re-start them manually, then restart X, to have them in the mbdock.session file again.
So I created that fixed configuration with my prefered applets and let xinitrc always use that one instead of the one saved on last X exit.
You see, there are a lot of options.
You just have to choose the one which has the most advantages and least disadvantages for you.
daniel
-
I posted again before your last reply.
Since I don't have a graphical text editor that can browse hidden files/directories, this is what I did.
I copied mbdock.session file to my hard drive, then opened it in leafpad and edited it.
I then copied it back to it's original directory.
I did this while the clock was active.
Then I exited X, and restarted X. The clock (with my settings) is visible now.
-
Thank you