mirror of https://github.com/davatorium/rofi.git
[Help] Print out the parsed config/theme files.
This commit is contained in:
parent
2614fe4425
commit
f0500a5a0e
|
@ -454,4 +454,17 @@ RofiDistance rofi_theme_property_copy_distance(RofiDistance const distance);
|
||||||
*/
|
*/
|
||||||
int rofi_theme_rasi_validate(const char *filename);
|
int rofi_theme_rasi_validate(const char *filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Free memory.
|
||||||
|
*/
|
||||||
|
void rofi_theme_free_parsed_files(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param is_term Indicate if printed to terminal.
|
||||||
|
*
|
||||||
|
* Print the list of parsed config files.
|
||||||
|
*/
|
||||||
|
void rofi_theme_print_parsed_files(int is_term);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -269,7 +269,7 @@ static void print_list_of_modi(int is_term) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf(" * %s%s%s%s\n", active ? "+" : "",
|
printf(" • %s%s%s%s\n", active ? "+" : "",
|
||||||
is_term ? (active ? color_green : color_red) : "",
|
is_term ? (active ? color_green : color_red) : "",
|
||||||
available_modi[i]->name, is_term ? color_reset : "");
|
available_modi[i]->name, is_term ? color_reset : "");
|
||||||
}
|
}
|
||||||
|
@ -328,31 +328,31 @@ static void help(G_GNUC_UNUSED int argc, char **argv) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Compile time options:\n");
|
printf("Compile time options:\n");
|
||||||
#ifdef WINDOW_MODE
|
#ifdef WINDOW_MODE
|
||||||
printf("\t* window %senabled%s\n", is_term ? color_green : "",
|
printf("\t• window %senabled%s\n", is_term ? color_green : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#else
|
#else
|
||||||
printf("\t* window %sdisabled%s\n", is_term ? color_red : "",
|
printf("\t• window %sdisabled%s\n", is_term ? color_red : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_DRUN
|
#ifdef ENABLE_DRUN
|
||||||
printf("\t* drun %senabled%s\n", is_term ? color_green : "",
|
printf("\t• drun %senabled%s\n", is_term ? color_green : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#else
|
#else
|
||||||
printf("\t* drun %sdisabled%s\n", is_term ? color_red : "",
|
printf("\t• drun %sdisabled%s\n", is_term ? color_red : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_GCOV
|
#ifdef ENABLE_GCOV
|
||||||
printf("\t* gcov %senabled%s\n", is_term ? color_green : "",
|
printf("\t• gcov %senabled%s\n", is_term ? color_green : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#else
|
#else
|
||||||
printf("\t* gcov %sdisabled%s\n", is_term ? color_red : "",
|
printf("\t• gcov %sdisabled%s\n", is_term ? color_red : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_ASAN
|
#ifdef ENABLE_ASAN
|
||||||
printf("\t* asan %senabled%s\n", is_term ? color_green : "",
|
printf("\t• asan %senabled%s\n", is_term ? color_green : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#else
|
#else
|
||||||
printf("\t* asan %sdisabled%s\n", is_term ? color_red : "",
|
printf("\t• asan %sdisabled%s\n", is_term ? color_red : "",
|
||||||
is_term ? color_reset : "");
|
is_term ? color_reset : "");
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -380,6 +380,7 @@ static void help(G_GNUC_UNUSED int argc, char **argv) {
|
||||||
printf(" Configuration file: %sDisabled%s\n",
|
printf(" Configuration file: %sDisabled%s\n",
|
||||||
is_term ? color_bold : "", is_term ? color_reset : "");
|
is_term ? color_bold : "", is_term ? color_reset : "");
|
||||||
}
|
}
|
||||||
|
rofi_theme_print_parsed_files(is_term);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void help_print_disabled_mode(const char *mode) {
|
static void help_print_disabled_mode(const char *mode) {
|
||||||
|
@ -478,6 +479,7 @@ static void cleanup(void) {
|
||||||
rofi_collect_modi_destroy();
|
rofi_collect_modi_destroy();
|
||||||
rofi_icon_fetcher_destroy();
|
rofi_icon_fetcher_destroy();
|
||||||
|
|
||||||
|
rofi_theme_free_parsed_files();
|
||||||
if (rofi_configuration) {
|
if (rofi_configuration) {
|
||||||
rofi_theme_free(rofi_configuration);
|
rofi_theme_free(rofi_configuration);
|
||||||
rofi_configuration = NULL;
|
rofi_configuration = NULL;
|
||||||
|
|
|
@ -46,6 +46,25 @@
|
||||||
#include "widgets/textbox.h"
|
#include "widgets/textbox.h"
|
||||||
#include <gio/gio.h>
|
#include <gio/gio.h>
|
||||||
|
|
||||||
|
GList *parsed_config_files = NULL;
|
||||||
|
|
||||||
|
void rofi_theme_free_parsed_files(void) {
|
||||||
|
g_list_free_full(parsed_config_files, g_free);
|
||||||
|
parsed_config_files = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rofi_theme_print_parsed_files(gboolean is_term) {
|
||||||
|
printf("\nParsed files:\n");
|
||||||
|
for (GList *iter = g_list_first(parsed_config_files); iter != NULL;
|
||||||
|
iter = g_list_next(iter)) {
|
||||||
|
printf("\t\u2022 %s%s%s\n",
|
||||||
|
is_term ? color_bold : "", (const char *)(iter->data),
|
||||||
|
is_term ? color_reset : "");
|
||||||
|
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
void yyerror(YYLTYPE *yylloc, const char *, const char *);
|
void yyerror(YYLTYPE *yylloc, const char *, const char *);
|
||||||
static gboolean distance_compare(RofiDistance d, RofiDistance e) {
|
static gboolean distance_compare(RofiDistance d, RofiDistance e) {
|
||||||
// TODO UPDATE
|
// TODO UPDATE
|
||||||
|
@ -1361,7 +1380,7 @@ char *rofi_theme_parse_prepare_file(const char *file, const char *parent_file) {
|
||||||
g_free(basedir);
|
g_free(basedir);
|
||||||
}
|
}
|
||||||
GFile *gf = g_file_new_for_path(filename);
|
GFile *gf = g_file_new_for_path(filename);
|
||||||
g_free(filename);
|
parsed_config_files = g_list_append(parsed_config_files, filename);
|
||||||
filename = g_file_get_path(gf);
|
filename = g_file_get_path(gf);
|
||||||
g_object_unref(gf);
|
g_object_unref(gf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue