diff --git a/include/textbox.h b/include/textbox.h index 3d3b8d09..e1d608e1 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -38,15 +38,15 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, - TB_PASSWORD = 1 << 22, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, + TB_PASSWORD = 1 << 22, } TextboxFlags; typedef enum diff --git a/source/helper.c b/source/helper.c index a6767c0d..b307b951 100644 --- a/source/helper.c +++ b/source/helper.c @@ -616,6 +616,13 @@ char *rofi_expand_path ( const char *input ) str[i] = g_strdup ( p->pw_dir ); } } + else if ( str[i][0] == '$' ) { + const char *v = g_getenv ( &( str[i][1] ) ); + if ( v != NULL ) { + g_free ( str[i] ); + str[i] = g_strdup ( v ); + } + } else if ( i == 0 ) { char * s = str[i]; if ( input[0] == G_DIR_SEPARATOR ) { diff --git a/source/view.c b/source/view.c index df41300e..2bae92e9 100644 --- a/source/view.c +++ b/source/view.c @@ -637,7 +637,8 @@ static void rofi_view_calculate_rows_columns ( RofiViewState *state ) // If it would fit in one column, only use one column. if ( state->num_lines < state->max_elements ) { state->columns = - MAX(1, ( state->num_lines + ( state->max_rows - state->num_lines % state->max_rows ) % state->max_rows ) / state->max_rows); + MAX ( 1, + ( state->num_lines + ( state->max_rows - state->num_lines % state->max_rows ) % state->max_rows ) / state->max_rows ); state->max_elements = state->menu_lines * state->columns; } // Sanitize.