-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zane Schaffer
committed
Dec 24, 2022
1 parent
800f49a
commit 950cced
Showing
11 changed files
with
184 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#include "curses.h" | ||
#include "wax.h" | ||
|
||
void setupColors() { | ||
start_color(); | ||
assume_default_colors(config->fg, config->bg); | ||
// main fg + bg | ||
init_pair(1, config->fg, config->bg); | ||
|
||
// main highlight | ||
init_pair(2, config->hl, config->bg); | ||
|
||
// reverse highlight | ||
init_pair(3, config->bg, config->hl); | ||
|
||
init_pair(0, COLOR_BLACK, COLOR_WHITE); | ||
init_pair(1, COLOR_CYAN, COLOR_BLACK); | ||
init_pair(2, COLOR_BLACK, COLOR_CYAN); | ||
init_pair(3, COLOR_WHITE, COLOR_BLACK); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "ncurses.h" | ||
#include "wax.h" | ||
|
||
#include <wordexp.h> | ||
|
||
int parse_config(char *buf) { | ||
|
||
char dummy[256]; | ||
char unformatted_dir[256]; | ||
int temp_color; | ||
if (sscanf(buf, " %s", dummy) == EOF) | ||
return 0; // blank line | ||
if (sscanf(buf, " %[#]", dummy) == 1) | ||
return 0; // comment | ||
if (sscanf(buf, " music_dir = %s", unformatted_dir) == 1) { | ||
wordexp_t exp_result; | ||
wordexp(unformatted_dir, &exp_result, 0); | ||
strcpy(config->music_dir, exp_result.we_wordv[0]); | ||
wordfree(&exp_result); | ||
return 0; | ||
} | ||
if (sscanf(buf, " bg = %d", &temp_color) != 0) { | ||
if (temp_color >= 0 && temp_color <= 15) { | ||
config->bg = temp_color; | ||
} | ||
} | ||
if (sscanf(buf, " fg = %d", &temp_color) != 0) { | ||
if (temp_color >= 0 && temp_color <= 15) { | ||
config->fg = temp_color; | ||
} | ||
} | ||
if (sscanf(buf, " hl = %d", &temp_color) != 0) { | ||
if (temp_color >= 0 && temp_color <= 15) { | ||
config->hl = temp_color; | ||
} | ||
} | ||
|
||
return 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.