Better formatting
This commit is contained in:
parent
b923bf76dd
commit
e217587b9c
@ -55,7 +55,7 @@ void gdrawbar(struct Graph graph, int x, int barheight)
|
|||||||
{
|
{
|
||||||
wattron(graph.win, COLOR_PAIR(COLORS_GRAPH));
|
wattron(graph.win, COLOR_PAIR(COLORS_GRAPH));
|
||||||
for (int i = 0; i < graph.height && i < barheight; ++i)
|
for (int i = 0; i < graph.height && i < barheight; ++i)
|
||||||
mvwprintw(graph.win, graph.row + graph.height - 1 - i, graph.col + x, "█");
|
mvwprintw(graph.win, graph.row + graph.height - 1 - i, graph.col + x, "|");
|
||||||
wattroff(graph.win, COLOR_PAIR(COLORS_GRAPH));
|
wattroff(graph.win, COLOR_PAIR(COLORS_GRAPH));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,9 +103,9 @@ void* company_refresh(void* arg)
|
|||||||
char* tagline = div->children->content;
|
char* tagline = div->children->content;
|
||||||
// clear line
|
// clear line
|
||||||
for (int i = START_COL; i < width - 1; ++i)
|
for (int i = START_COL; i < width - 1; ++i)
|
||||||
mvwprintw(window, START_ROW+8, i, " ");
|
mvwprintw(window, START_ROW+5, i, " ");
|
||||||
// print the funny reference
|
// print the funny reference
|
||||||
mvwprintw(window, START_ROW+8, START_COL, "%s", tagline);
|
mvwprintw(window, START_ROW+5, START_COL, "%s", tagline);
|
||||||
// say the funny reference
|
// say the funny reference
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
sprintf(buf, "espeak \"%s\" >/dev/null 2>&1", tagline);
|
sprintf(buf, "espeak \"%s\" >/dev/null 2>&1", tagline);
|
||||||
@ -113,13 +113,14 @@ void* company_refresh(void* arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct tm lastmeeting;
|
struct tm lastmeeting = {0};
|
||||||
mvwprintw(window, START_ROW+1, START_COL, "Last meeting:");
|
mvwprintw(window, START_ROW+1, START_COL, "Last meeting:");
|
||||||
wattron(window, WA_BOLD);
|
wattron(window, WA_BOLD);
|
||||||
if (parse_meet_time(meet_data.memory, &lastmeeting))
|
bool result = parse_meet_time(meet_data.memory, &lastmeeting);
|
||||||
{
|
|
||||||
double diff_min = difftime(time(NULL), timegm(&lastmeeting)) / 60.0;
|
double diff_min = difftime(time(NULL), timegm(&lastmeeting)) / 60.0;
|
||||||
double diff_hr = diff_min / 60.0;
|
double diff_hr = diff_min / 60.0;
|
||||||
|
if (result && diff_hr < 1000)
|
||||||
|
{
|
||||||
mvwprintw(window, START_ROW+1, START_COL+13, " %.0fh %.0fm ago", diff_hr, diff_min);
|
mvwprintw(window, START_ROW+1, START_COL+13, " %.0fh %.0fm ago", diff_hr, diff_min);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user