Skip to content

Instantly share code, notes, and snippets.

@DanielBoerlage
Last active August 29, 2015 14:15
Show Gist options
  • Save DanielBoerlage/2f621db0897ac8ab2b07 to your computer and use it in GitHub Desktop.
Save DanielBoerlage/2f621db0897ac8ab2b07 to your computer and use it in GitHub Desktop.
wip
// {DB} 2015
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
#define RESET "\033[0m"
#define WHITE "\033[1;37m"
#define GREEN "\033[0;32m"
#define YELLOW "\033[0;33m"
#define RED "\033[0;31m"
#define DIV "│"
//#define DIV "┃"
int main(int argc, char* argv) {
const char* _C[] = {"_", "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"};
int battery_level = 7;
printf(DIV);
if(battery_level >= 5)
printf(GREEN);
else if(battery_level >= 3)
printf(YELLOW);
else
printf(RED);
printf(_C[battery_level]);
printf(RESET);
printf(DIV);
time_t t = time(NULL);
struct tm lt = *localtime(&t);
struct tm utc = *gmtime(&t);
printf(" UTC %02d:%02d:%02d ", utc.tm_hour, utc.tm_min, utc.tm_sec);
printf(DIV);
printf(WHITE);
printf(" %d-%02d-%02d %02d:%02d", lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday, lt.tm_hour, lt.tm_min);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment