mirror of
https://github.com/davatorium/rofi.git
synced 2025-02-10 15:44:41 -05:00
config: Add a setting to disable icons loading
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
f3b4af1da0
commit
8a6bdd827d
5 changed files with 19 additions and 4 deletions
|
@ -44,7 +44,9 @@ Settings config = {
|
||||||
/** Font */
|
/** Font */
|
||||||
.menu_font = "mono 12",
|
.menu_font = "mono 12",
|
||||||
|
|
||||||
/** Row colors */
|
/** Whether to load and show icons */
|
||||||
|
.show_icons = FALSE,
|
||||||
|
|
||||||
/** Terminal to use. (for ssh and open in terminal) */
|
/** Terminal to use. (for ssh and open in terminal) */
|
||||||
.terminal_emulator = "rofi-sensible-terminal",
|
.terminal_emulator = "rofi-sensible-terminal",
|
||||||
.ssh_client = "ssh",
|
.ssh_client = "ssh",
|
||||||
|
|
|
@ -97,6 +97,9 @@ typedef struct
|
||||||
char * color_urgent;
|
char * color_urgent;
|
||||||
char * color_window;
|
char * color_window;
|
||||||
|
|
||||||
|
/** Whether to load and show icons */
|
||||||
|
gboolean show_icons;
|
||||||
|
|
||||||
/** Terminal to use */
|
/** Terminal to use */
|
||||||
char * terminal_emulator;
|
char * terminal_emulator;
|
||||||
/** SSH client to use */
|
/** SSH client to use */
|
||||||
|
|
|
@ -284,7 +284,12 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
||||||
#endif
|
#endif
|
||||||
pd->entry_list[pd->cmd_list_length].exec = g_key_file_get_string ( kf, "Desktop Entry", "Exec", NULL );
|
pd->entry_list[pd->cmd_list_length].exec = g_key_file_get_string ( kf, "Desktop Entry", "Exec", NULL );
|
||||||
|
|
||||||
|
if ( config.show_icons ) {
|
||||||
pd->entry_list[pd->cmd_list_length].icon_name = g_key_file_get_locale_string ( kf, "Desktop Entry", "Icon", NULL, NULL );
|
pd->entry_list[pd->cmd_list_length].icon_name = g_key_file_get_locale_string ( kf, "Desktop Entry", "Icon", NULL, NULL );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
pd->entry_list[pd->cmd_list_length].icon_name = NULL;
|
||||||
|
}
|
||||||
pd->entry_list[pd->cmd_list_length].icon = NULL;
|
pd->entry_list[pd->cmd_list_length].icon = NULL;
|
||||||
|
|
||||||
// Keep keyfile around.
|
// Keep keyfile around.
|
||||||
|
|
|
@ -693,8 +693,10 @@ static gboolean helper_eval_cb ( const GMatchInfo *info, GString *str, gpointer
|
||||||
helper_eval_add_str ( str, d->c->wmdesktopstr, l, d->pd->wmdn_len );
|
helper_eval_add_str ( str, d->c->wmdesktopstr, l, d->pd->wmdn_len );
|
||||||
}
|
}
|
||||||
else if ( match[1] == 'i' ) {
|
else if ( match[1] == 'i' ) {
|
||||||
|
if ( config.show_icons ) {
|
||||||
g_string_append ( str, "<span alpha=\"1\">\uFFFC</span>" );
|
g_string_append ( str, "<span alpha=\"1\">\uFFFC</span>" );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if ( match[1] == 'c' ) {
|
else if ( match[1] == 'c' ) {
|
||||||
helper_eval_add_str ( str, d->c->class, l, d->pd->clf_len );
|
helper_eval_add_str ( str, d->c->class, l, d->pd->clf_len );
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,9 @@ static XrmOption xrmOptions[] = {
|
||||||
{ xrm_Boolean, "fixed-num-lines", { .num = &config.fixed_num_lines }, NULL,
|
{ xrm_Boolean, "fixed-num-lines", { .num = &config.fixed_num_lines }, NULL,
|
||||||
"Always show number of lines", CONFIG_DEFAULT },
|
"Always show number of lines", CONFIG_DEFAULT },
|
||||||
|
|
||||||
|
{ xrm_Boolean, "show-icons", { .snum = &config.show_icons }, NULL,
|
||||||
|
"Whether to load and show icons", CONFIG_DEFAULT },
|
||||||
|
|
||||||
{ xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL,
|
{ xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL,
|
||||||
"Terminal to use", CONFIG_DEFAULT },
|
"Terminal to use", CONFIG_DEFAULT },
|
||||||
{ xrm_String, "ssh-client", { .str = &config.ssh_client }, NULL,
|
{ xrm_String, "ssh-client", { .str = &config.ssh_client }, NULL,
|
||||||
|
|
Loading…
Add table
Reference in a new issue