projects
/
sleepy.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
initial
[sleepy.git]
/
sleepy.c
1
#include <time.h>
2
3
int main(void) {
4
time_t last = 0;
5
while(1) {
6
sleep(30);
7
time_t unixtime = time(NULL);
8
if (unixtime - last < 300) continue;
9
struct tm *t = localtime(&unixtime);
10
if (t->tm_hour >= 5 && t->tm_hour != 23) continue;
11
if (t->tm_min % 15 != 0) continue;
12
system("sstandby");
13
last = unixtime;
14
}
15
}