I think that many of the users here have found themselves staying up too late and wishing the next day that they had something that would tell them when to go to sleep or when to do something. So I am proposing that a All in one Clock be made. So you could put in your own reminders, set a specific date, time, or week for your computer to Turn off, standby, hibernate or restart. Then you could even have your computer do certain tasks at certain times, such as locking down for your lunch break, playing your favorite song, or just running another program, etc. I would be writing this program in autohotkey, and would implement it later to a more advanced language, such as c++, but i am just learning c++. I would really like to make this a community project where everyone can throw ideas at it and add new features to it, and help improve it so in the end we would have an application that could be taken anywhere, and would be relatively small, from the 1mb to 3mb in size or less, and would be great to give to friends or family that could find it useful. If you are interested to partake in this project, please post a comment as no real skills are necessary, but if you wish to help develop then you need some skills in autohotkey. If you are at all interested in this, then please post here if you want to help make this idea happen.
You are here
All in one Clock [Development] +User feedback needed
I think its a very good idea. But I guess the idea is so good that there are already other programs doing that...
give examples then
I just think there must me lots of small programs like that.
Maybe there is a market for a new one...
and it's called the Task Scheduler.
but that's not portable
Here's the problem with many of those programs: You have to remember and make the effort to start the clock. If this clock program can be easily programmed to auto-run with PAM as soon as the USB drive is inserted, then you might have something uniquely useful.
Thats an idea that could possibly be done. I could always add a autorun function for usb, and an autorun for computers.
I use the mod patch add-on that is out there it has a handy feature. if you right click on the app icon it gives you the opp to autorun the program on starting the patch.
Most of, if not all, the features in the mod patch are going to be implemented in the next release of PA whenever that comes out.
actually, I would like something portable that would synchronize computer clocks via the Internet.
I don't know if this could be written in autohotkey
I think delphi or C++ would be better suited
;------------------------------------------------------------------------------- ; 13:52 13-4-2007, by Bold, parts from autohotkey forum. ; ; Shows clock, batterypower, mem load and cpu load on top of screen ; Derived from: ; Snippets and scripts from the AutoHotkey forum. ; Thanks to Majkinetor for his getTextWidth function. ; The script is not flawless, no warranties. ; The progressbars disappear (the text stays) on mouseover so they don't get in the way if you want to click something below it. ; The text overlay is in a separate gui on top of the progressbar, not sure if this is the best way to get a progressbar with text overlay. ; You can set thresholds for low battery, high mem load and high cpu. When these thresholds are reached the colors change. ; ; Problems: ; - The date time seems to lose the time sometimes and only shows the date ; - I'm not sure how to always keep the windows on top, even if an other ; - sometimes there is an annoying flicker in the guis. ; #SingleInstance Force #NoTrayIcon #NoEnv applicationname := SubStr(A_ScriptName, 1, StrLen(A_ScriptName) - 4) Gosub, INIREAD windowTitle := "ClockInfo" regionMargin := 10 progressBarPos := regionMargin - 1 ; I tried to make as much as possible configurable in the ini file, so we need some calculations. clockFontStyle = s%fontsize% bold infoFontStyle = s%infoFontSize% bold FormatTime, clockText ,, %timeFormat% clockWidth := GetTextSize(clockText, clockFontStyle "," clockFont )+10 battText1 = xx battText2 := "100%" battWidth := GetTextSize(battText1, infoFontStyle "," Webdings )+10 battWidth += GetTextSize(battText2, infoFontStyle "," infoFont )+10 memText := memLabel . "100%" memWidth := GetTextSize(memText, infoFontStyle "," infoFont )+10 cpuText := cpuLabel . "100.00%" cpuWidth := GetTextSize(cpuText, infoFontStyle "," infoFont )+10 maxWidth := Max(battWidth, Max(memWidth, cpuWidth)) ; Use the widest width for all battWidth := maxWidth cpuWidth := maxWidth memWidth := maxWidth battProgressWidth := battWidth + 1 memProgressWidth := memWidth + 1 cpuProgressWidth := cpuWidth + 1 height := fontSize + (fontsize * 0.7) infoHeight := infoFontSize + (fontsize * 0.7) txtY := 0 txtX := 15 posFromRight = 120 battInfo := GetPowerStatus(acLineStatus) VarSetCapacity( IdleTicks, 2*4 ) VarSetCapacity( memstatus, 100 ) OnExit, ExitSub Gosub, CALCULATEPOSITIONS Gosub, CREATECLOCKWINDOW SetTimer, UPDATECLOCK, 250 SetTimer, UPDATEBATTERY, 2000 SetTimer, UPDATECPU, 1500 SetTimer, WATCHCURSOR, 115 SetTimer, KEEPONTOP, 1000 getDistance(mX, mY, x, y, w, h) { ; pointer is in object If (mX > x) and (mX y) and (mY (x + w)) xDistance := mX - (x + w) ; pointer is above object If (mY (y + h)) yDistance := mY - (y + h) } distance := max(xDistance, yDistance) * 3 return distance } CALCULATEPOSITIONS: savedScreenWidth := A_ScreenWidth savedScreenHeight := A_ScreenHeight width := clockWidth + battWidth + memWidth + cpuWidth + margin * 3 xPos := savedScreenWidth - width - posFromRight yPos := 3 battPos := xPos + clockWidth + margin memPos := battPos + battWidth + margin cpuPos := memPos + memWidth + margin Return WATCHCURSOR: CoordMode, Mouse MouseGetPos, mouseX, mouseY clockTransparency := min(getDistance(mouseX, mouseY, xPos + regionMargin, yPos, regionMargin + clockWidth, height), transparency) battTransparency := min(getDistance(mouseX, mouseY, battPos + regionMargin, yPos, regionMargin + battWidth, height), transparency) memTransparency := min(getDistance(mouseX, mouseY, memPos + regionMargin, yPos, regionMargin + memWidth, height), transparency) cpuTransparency := min(getDistance(mouseX, mouseY, cpuPos + regionMargin, yPos, regionMargin + cpuWidth, height), transparency) WinSet, Transparent, %clockTransparency%, %windowTitle% WinSet, Transparent, %battTransparency%, BattBarGui WinSet, Transparent, %memTransparency%, MemBarGui WinSet, Transparent, %cpuTransparency%, CpuBarGui Return CREATECLOCKWINDOW: ; 1: Windows for the clock text Gui, 1:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 1:Color, %clockBGColor% Gui, 1:Font, c%clockFontColor% %clockFontStyle%, %clockFont% Gui, 1:Add,Text,vDate y%txtY% x%txtX%, %clockText% Gui, 1:Show,NoActivate x%xPos% y%yPos% ,%windowTitle% WinSet, Region, %regionMargin%-0 W%clockWidth% H%height% R5-5, %windowTitle% ; 6: Window for the batt progress bar Gui, 6:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 6:Add, Progress, y0 x%progressBarPos% w%battProgressWidth% h%infoHeight% c%battBarColor% vBattBar Background%battBGColor% Gui, 6:Show,NoActivate x%battPos% y%yPos%, BattBarGui WinSet, Region, %regionMargin%-0 W%battWidth% H%infoHeight% R5-5, BattBarGui ; 2: Window for the batt text Gui, 2:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 2:Color, %battBGColor% Gui, 2:Font, c%battFontColor% %infoFontStyle%, Webdings Gui, 2:Add,Text,vPlugged y-2 x%txtX%, x Gui, 2:Font, c%battFontColor% %infoFontStyle%, %infoFont% Gui, 2:Add,Text,vBatt y%txtY% w%battWidth% x46, %battinfo%`% Gui, 2:Show,NoActivate x%battPos% y%yPos%, Batt WinSet, Region, %regionMargin%-0 W%battWidth% H%infoHeight% R5-5, Batt WinSet, TransColor, %battBGColor% ; 7: Window for the memory progress bar Gui, 7:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 7:Add, Progress, y0 x%progressBarPos% w%memProgressWidth% h%infoHeight% c%memBarColor% vMemBar Background%memBGColor% Gui, 7:Show,NoActivate x%memPos% y%yPos%, MemBarGui WinSet, Region, %regionMargin%-0 W%memWidth% H%infoHeight% R5-5, MemBarGui GuiControl, 7:, MemBar, 50 ; 3: Window for the memory text Gui, 3:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 3:Color, %memBGColor% Gui, 3:Font, c%memFontColor% %infoFontStyle%, %infoFont% Gui, 3:Add,Text,vMem y%txtY% x%txtX%, %memText% Gui, 3:Show,NoActivate x%memPos% y%yPos% ,Mem WinSet, Region, %regionMargin%-0 W%memWidth% H%infoHeight% R5-5, Mem WinSet, TransColor, %memBGColor% ; 5: Window for the cpu progress bar Gui, 5:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 5:Add, Progress, y0 x%progressBarPos% w%cpuProgressWidth% h%infoHeight% c%cpuBarColor% vCpuBar Background%cpuBGColor% Gui, 5:Show,NoActivate x%cpuPos% y%yPos%, CpuBarGui WinSet, Region, %regionMargin%-0 W%cpuWidth% H%infoHeight% R5-5, CpuBarGui ; 4: Window for the cpu text Gui, 4:+LastFound +AlwaysOnTop +ToolWindow -SysMenu -Caption Gui, 4:Color, %cpuBGColor% Gui, 4:Font, c%cpuFontColor% %infoFontStyle%, %infoFont% Gui, 4:Add,Text,vCpu y%txtY% x%txtX%, %cpuText% Gui, 4:Show,NoActivate x%cpuPos% y%yPos% ,Cpu WinSet, Region, %regionMargin%-0 W%cpuWidth% H%height% R5-5, Cpu WinSet, TransColor, %cpuBGColor% Return UPDATECLOCK: if (savedScreenWidth A_ScreenWidth) { ; I switch recolution often on my laptop so thats why I added this. Gosub, CalculatePositions Gui, 1:Hide Gui, 2:Hide Gui, 3:Hide Gui, 4:Hide Gui, 5:Hide Gui, 6:Hide Gui, 7:Hide ; These will be shown again by the KEEPONTOP sub } FormatTime, clockText ,, %timeFormat% GuiControl, 1:,Date, %clockText% Return UPDATEBATTERY: battinfo := GetPowerStatus(acLineStatus) If (acLineStatus > 0) { GuiControl,2:,Plugged, ~ Gui, 2:Font, c%battFontColor% GuiControl, 6: +Background%battBGColor%, BattBar GuiControl, 6: +c%battBarColor%, BattBar } Else { GuiControl,2:,Plugged, x if (battinfo cpuThreshold) { Gui, 4:Font, c%cpuFontColorAlert% GuiControl, 5: +Background%cpuBGColorAlert%, CpuBar GuiControl, 5: +c%cpuBarColorAlert%, CpuBar } Else { Gui, 4:Font, c%cpuFontColor% GuiControl, 5: +Background%cpuBGColor%, CpuBar GuiControl, 5: +c%cpuBarColor%, CpuBar } GuiControl, 4:Font, Cpu ; Put the above font into effect for a control. GuiControl, 4:, Cpu, %cpuLabel%%load%`% GuiControl, 5:, CpuBar, %load% ; --- Calculate memory DllCall("kernel32.dll\GlobalMemoryStatus", "uint",&memstatus) mem := *( &memstatus + 4 ) ; last byte is enough, mem = 0..100 If (mem > memThreshold) { Gui, 3:Font, c%memFontColorAlert% GuiControl, 7: +Background%memBGColorAlert%, MemBar GuiControl, 7: +c%memBarColorAlert%, MemBar } Else { Gui, 3:Font, c%memFontColor% GuiControl, 7: +Background%memBGColor%, MemBar GuiControl, 7: +c%memBarColor%, MemBar } GuiControl, 3:Font, Mem GuiControl, 3:,Mem, %memLabel%%mem%`% GuiControl, 7:, MemBar, %mem% Return GetPowerStatus(ByRef acLineStatus) { VarSetCapacity(powerstatus, 1+1+1+1+4+4) success := DllCall("kernel32.dll\GetSystemPowerStatus", "uint", &powerstatus) acLineStatus:=ReadInteger(&powerstatus,0,1,false) battFlag:=ReadInteger(&powerstatus,1,1,false) battLifePercent:=ReadInteger(&powerstatus,2,1,false) battLifeTime:=ReadInteger(&powerstatus,4,4,false) battFullLifeTime:=ReadInteger(&powerstatus,8,4,false) Return battLifePercent } ReadInteger( p_address, p_offset, p_size, p_hex=true ) { value = 0 old_FormatInteger := a_FormatInteger if ( p_hex ) SetFormat, integer, hex else SetFormat, integer, dec loop, %p_size% value := value+( *( ( p_address+p_offset )+( a_Index-1 ) ) 4 OR result ; ; Parameters: ; pStr - Text to be measured ; pFont - Font description in AHK syntax ; pHeight - Set to true to return height also. False is default. ; ; Returns: ; Text width if pHeight=false. Otherwise, dimension is returned as "width,height" ; ; Example: ; width := GetTextSize("string to be measured", "bold s22, Courier New" ) ; GetTextSize(pStr, pFont="", pHeight=false) { local height, weight, italic, underline, strikeout , nCharSet local hdc := DllCall("GetDC", "Uint", 0) local hFont, hOldFont ;parse font if (pFont != "") { italic := InStr(pFont, "italic") underline := InStr(pFont, "underline") strikeout := InStr(pFont, "strikeout") weight := InStr(pFont, "bold") ? 700 : 0 RegExMatch(pFont, "(?> 32 & 0xFFFFFFFF if (pHeight) nWidth .= "," nHeight return nWidth } KEEPONTOP: Gui, 1:Show, NA x%xPos% y%yPos%, %windowTitle% Gui, 6:Show, NA x%battPos% y%yPos% ,BattBarGui Gui, 2:Show, NA x%battPos% y%yPos%, Batt Gui, 7:Show, NA x%memPos% y%yPos% ,MemBarGui Gui, 3:Show, NA x%memPos% y%yPos% ,Mem Gui, 5:Show, NA x%cpuPos% y%yPos% ,CpuBarGui Gui, 4:Show, NA x%cpuPos% y%yPos% ,Cpu Return ExitSub: ExitApp
If you compile it and run it, it shows a clock, with hour, min, and seconds, then shows computer charge, and computer memory use and this is all written in autohotkey, though I do agree that C++ or delphi would be better, except that I dont have any experience with those.
pizza timer is a good app that could be incorporated into what you are talking about.
also i got an app called Tclock light that is supposed to do most of what you want but i cant get my head around the interface. it is confusing.
Nice... Ill check those out, hopefully by Friday or Saturday I should have some basic code written up to get the basic clock up and running. Then it should be all downhill from there, at least hopefully it will be.
Cool
I finally got around to writing some code for this, here is my basic code for the time display, it will later be edited, like change its position, add color to it, etc. But anyways, I was thinking of adding an option of like a traypopup that would display the time also, what do you think? I am currently designing the window and what it can do, so if you have any suggestions just let me know and I will try my best to add it in.
#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1
FormatTime, CurrentTime, , hh:mm:ss tt
Gui, Add, CheckBox, x326 y150 w60 h30 vTool, Tooltip
Gui, Add, CheckBox, x256 y150 w60 h30 vTray, TrayTip
Gui, Add, DateTime, x245 y93 w125 h25
Gui, Add, DateTime, x245 y60 w125 h25 vAlarmSet, Time
Gui, Add, Button, x370 y65 w36 h45 , Set Alarm
Gui, Add, Text, x6 y150 w160 h20 vTime, Time: %CurrentTime%
Gui, Add, Text, x6 y170 w160 h20 , Date:
Gui, Add, GroupBox, x246 y120 w150 h70 , Time Display Options
Gui, Add, Edit, x16 y20 w250 h20 vMyEdit,
Gui, Add, Button, x266 y20 w100 h20 , Browse
Gui, Add, GroupBox, x6 y0 w380 h60 , Action To Perform
Gui, Add, GroupBox, x6 y60 w210 h70 , Alarm Options
Gui, Show, x394 y209 h196 w408, Time
SetTimer, TimeLoop, 400
SetTimer, OptionLoop, 50
Return
ButtonBrowse:
FileSelectFile, SelectedFile, 1, %A_ScriptDir%, Select File For Alarm Run
If SelectedFile=
Return
Else
GuiControl, Text, MyEdit, %SelectedFile%
Return
TimeLoop:
FormatTime, CurrentTime, , hh:mm:ss tt
GuiControl, , Time, Time: %CurrentTime%
If AlarmSet= %CurrentTime%
Goto, AlarmExec
Return
OptionLoop:
GuiControlGet, Checked,, Tray
If (Checked)=True
{
FormatTime, CurrentTime, , hh:mm:ss tt
TrayTip, Current Time, %CurrentTime%
Return
}
Else
TrayTip
GuiControlGet, Checked,, Tool
If (Checked)=True
{
FormatTime, CurrentTime, , hh:mm:ss tt
ToolTip, %CurrentTime%
Return
}
else
ToolTip
Return
AlarmExec:
Run, %SelectedFile%
Goto, GuiClose
GuiClose:
ExitApp
That is my code so far, this is just the basic code, I will add the updated one later, this is just to let you know that I am still working on this
Edit: Well this includes most of the functions that it will use, I still need to implement the alarm clock itself, lol. But Mostly its complete, for those of you ahk users, please compile this and tell me what you think. I will add more options under AlarmOptions, so if you have a suggestion then let me know, I will inlcude things such as shutdown, restart, standby, hibernate, and even a msg box that will tell you a custom message you tell it to tell you.
By the way. I am quite happy to edit a .ini file for the main settings, But not for things like setting a alarm. If that helps.
Not bad at the moment. Keep up the good work
K, ill see what I can do about this and also the standby/hibernation wakeup, I have had friends actually request this. I am also gonna add a lot of feature requests such as Analogue Clock, Multiple Alarms, Custom Sounds(That would be played through built in ahk player) Custom PopUp displays, and lots more, but I think I just need to get out some of the basic stuff before I get to many features out, this will help ensure the app will run at its best with little to no bugs. I would also appreciate some settings options suggestions.
I think you've got a good idea; there's all sorts of things timers can do for you- from ebay to travellers' alarm clocks.
I'd suggest an additional feature tho- that it could 'wake up' a sleeping or hibernating computer at a time; and then 'do something'.
Dunno if that's even possible from a USB drive without finicky setup.
Foxclocks apparently is a popular Firefox addon, sticking your gizmo into a Mozilla framework might generate usage?
Good Luck!
Stickies could do that. Just set when you want the reoccuring sticky to "wake up" you can use customizable fonts/colors/sounds/etc. I have a portable launcher in the beta forum that I'll be updating in a while.
K, question to users of this, and future users...... Do you think that I should include the ability to resume an alarm, lets say you wanted to have an alarm go off two days from now, but didnt want to leave your computer on, but you would open alarmclock later before the alarm but didnt want to have to set the alarm again, would you want me to add that in so when it starts up it will check for an existing alarm and if it is still in the future then it will set it and the actions you chose?
Edit: Oh yeah what about passing command parameters to an executable? This would allow apps that support this to do whatever you would need once the alarm went off without you having to be there for it to do it. I may incorporate this as I know CCleaner supports this and would be great to have it run when im away as I usually run it about once a week.
Edit2: Ok I have command line support added, it has a set of rules so it will only pop up a user input box if the selected file is an exe, com, or bat file, so any thing else it wont pop up, if you have another or different way of doing this then please let me know.
1 = YES
2 = YES
K... thnx I think since this is probably one of my major features, I will release a test one out right now along side of the regular one out right now, Ill make this a different build so users can try it out and tell me if they would want this feature added or not. So keep an eye out for this in the beta within the next 10-15 min