AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

uptime - titlebar version

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Serenity



Joined: 08 Nov 2004
Posts: 1272

PostPosted: Sun Feb 20, 2005 8:09 pm    Post subject: uptime - titlebar version Reply with quote

For anyone who leaves their computer on for more than a few days. Smile In a similar fashion to pixelget and titlebarclock, this displays the uptime in the titlebar and updates hourly. This doesn't display uptime as days/hours but as days to one decimal place.

Screenshot (also with pixelget and titlebarclock running):


Changelog:
Script size shortened by using gosub (thanks corrupt)

Code:
; uptime - titlebar version

; displays system uptime as days to one decimal place

#singleinstance force
menu, tray, tip, uptime titlebar
Gosub, Refresh

Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui, Color, CCCCCC
Gui, Font, cFF0000 s6 wbold, terminal
Gui, Add, Text, vD x50 y0, %uptimeD% days uptime
Gui, Show, NoActivate x100 y5, uptime ; screen position here
WinSet, TransColor, CCCCCC 255, uptime
SetTimer, Refresh, 3600000 ; update hourly
return

Refresh:
SetFormat, float, 0.1
uptime := A_TickCount ;
uptimeD := (uptime/1000/60/60/24) ; get days
uptimeD += 0.0 ; display as decimal
GuiControl, , D, %uptimeD% days uptime
return

_________________
"Anything worth doing is worth doing slowly." - Mae West


Last edited by Serenity on Tue Feb 22, 2005 10:43 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Sun Feb 20, 2005 11:42 pm    Post subject: Reply with quote

Looks like you've run out of room. Laughing What'll the next one be? A stand-alone toolbar to put it all in?
Back to top
View user's profile Send private message
Serenity



Joined: 08 Nov 2004
Posts: 1272

PostPosted: Sun Feb 20, 2005 11:58 pm    Post subject: Reply with quote

Thats true! But really, what else would I want to know? Apps like Samurize offer all kinds of resource/activity monitoring but after a while it seems for its own sake rather than for function which doesn't interest me.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Mon Feb 21, 2005 12:04 am    Post subject: Reply with quote

That is very, very true. Those kind of apps don't actually serve a purpose, really. I used sysmetrix for a while, then I realized that. Obviously, things like measuring pixels on a screen or finding the color of a particular background can be useful at times, but why would you need them while checking your e-mail or playing Warcraft?

Anyway, ya. I have a nice, simplistic desktop that I'm satisfied with, and most of the information I need I already know or can glance at an icon for. When I need to tinker, I get on my Linux and try to figure a little more of it out. Very Happy
Back to top
View user's profile Send private message
Serenity



Joined: 08 Nov 2004
Posts: 1272

PostPosted: Mon Feb 21, 2005 12:21 am    Post subject: Reply with quote

I'm much more of a multitasker, lots of things open at once. I actually need the uptime thingy to remind me to reboot. *laughs* Better that then how it was on Windows 98. Smile
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
savage



Joined: 02 Jul 2004
Posts: 207

PostPosted: Mon Feb 21, 2005 8:15 pm    Post subject: Reply with quote

Mozilla WATERYAK!?!? Shocked Whattahell is that?

Neato titlebar tingies btw, I'll have to play with these for a while Smile.
Back to top
View user's profile Send private message AIM Address
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Mon Feb 21, 2005 8:43 pm    Post subject: Reply with quote

The WaterYak is most likely one of the names generated by an extension which I forget the name of. It generates a random name to display in the titlebar every time you start SpaceSquirrel up. Some of the names it generates for SuperHamster are pretty darn funny, too.
Back to top
View user's profile Send private message
savage



Joined: 02 Jul 2004
Posts: 207

PostPosted: Mon Feb 21, 2005 9:51 pm    Post subject: Reply with quote

Lol, I see. I can just imagine the logo for wateryak, this big hairy yak, dripping wet and shivering, with big puppy eyes.
Back to top
View user's profile Send private message AIM Address
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Mon Feb 21, 2005 10:02 pm    Post subject: Reply with quote

Back to top
View user's profile Send private message
Serenity



Joined: 08 Nov 2004
Posts: 1272

PostPosted: Tue Feb 22, 2005 10:48 pm    Post subject: Reply with quote

Updated script with gosub routine, making script shorter.

savage wrote:
Mozilla WATERYAK!?!? Shocked Whattahell is that?


I'm running two extensions - Titlebar Tweaks (use this to just show program name) along with Firesomething to get the Wateryak.

Quote:
Neato titlebar tingies btw, I'll have to play with these for a while Smile.


Thanks!
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
Dippy46



Joined: 06 Jul 2004
Posts: 171
Location: Manchester, England.

PostPosted: Fri Feb 25, 2005 3:35 am    Post subject: Reply with quote

@Serenity
Sorry couln't resist this one. Laughing

Code:

loop
{
var=%a_now%
ontime := A_TickCount/1000
EnvAdd, var, -%ontime% ,seconds
FormatTime, BootUp, %var%, ddd dd MMM yyyy @ hh:mm tt
tooltip, Machine Active Since: `n %bootup%
sleep 10
}


_________________
Simple ideas lie within reach, only of complex minds
Back to top
View user's profile Send private message
Invalid User



Joined: 14 Feb 2005
Posts: 440
Location: Texas, Usa

PostPosted: Fri Feb 25, 2005 5:55 am    Post subject: Reply with quote

Quote:
I actually need the uptime thingy to remind me to reboot

I havnt rebooted in weeks, is that a really bad thing?
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Fri Feb 25, 2005 5:15 pm    Post subject: Reply with quote

If you're running Windows, most experts recommend rebooting every night. This is because Windows eventually accumulates extra resources and slows down over time. Sometimes it's not as noticable with power users, since they know how to take care of their system better, but the problem's still there.

In contrast, Linux has almost no problems like that. Some Linux servers running a minimum of tasks have been known to have uptimes of several years; other, more casual users say they have no problems leaving the system running for weeks or even months at a time. Personally, I still reboot it every couple of days just out of habit, but it's still an interesting thing to know about *nix.

P.S. Yes, I do know there are situations in which you should reboot, I'm merely saying that in casual use it's not as necessary as in Windows.
Back to top
View user's profile Send private message
Serenity



Joined: 08 Nov 2004
Posts: 1272

PostPosted: Sat Feb 26, 2005 2:50 am    Post subject: Reply with quote

Dippy, thanks. Smile

Invalid User wrote:
Quote:
I actually need the uptime thingy to remind me to reboot

I havnt rebooted in weeks, is that a really bad thing?


It depends on the OS and how you use your computer I suppose. I'm running 2k, and I have lots of programs open at once- it really starts to grind after say 10 days uptime. On Windows 98 I'd reboot at least 3 times a day with the same resources. Memory management on 2k and XP has improved alot. By comparison, in Linux processes tend to crash rather than the shell and many weeks uptime is not uncommon on a desktop machine. Windows for some reason just gets slower at performing all round the longer I leave it on.
_________________
"Anything worth doing is worth doing slowly." - Mae West
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 2952
Location: Minnesota

PostPosted: Sat Feb 26, 2005 3:34 am    Post subject: Reply with quote

Quote:
Windows for some reason just gets slower at performing all round the longer I leave it on.


This is one of the main problems with Windows and Microsoft acts like it isn't even an issue. Of course, the cause of it is widely known; Windows is poorly designed. Period. Confused
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group