Commandline options and Xresources now match in nameing.

This commit is contained in:
QC 2014-05-22 09:18:16 +02:00
parent beced5d36e
commit a26cf2637d
3 changed files with 64 additions and 36 deletions

View File

@ -28,14 +28,19 @@ rofi \- a simple EWMH window switcher
.RB [ \-now ]
.RB [ \-rnow ]
.RB [ \-snow ]
.RB [ \-term
.IR terminal ]
.RB [ \-terminal
.IR terminal
]
.RB [ \-loc
.IR position ]
.RB [ \-hmode ]
.RB [ \-fixed\-num\-lines ]
.RB [ \-padding
.IR padding ]
.IR padding
]
.RB [ \-opacity
.IR opacity %
]
.RB [ \-version ]
.RB [ \-help]
.RB [ \-display
@ -46,7 +51,8 @@ rofi \- a simple EWMH window switcher
.IR width ]
.RB [ \-dmenu
.RB [ \-p
.IR prompt ]]
.IR prompt
]
.RB [ \-dump ]
.SH DESCRIPTION
@ -155,11 +161,11 @@ Set the foreground text color (X11 named color or hex #rrggbb) for the highlight
rofi -fg "#ffffff"
.RE
.TP
.B -o
.B -opacity
Set the window opacity (0-100).
.P
.RS
rofi -o "75"
rofi -opacity "75"
.RE
.TP
.B -lines
@ -183,11 +189,11 @@ Set the width of the menu as a percentage of the screen width (default: 60).
rofi -width 60
.RE
.TP
.B -term
.B -terminal
Specify what terminal to start (default x-terminal-emulator)
.P
.RS
rofi -term xterm
rofi -terminal xterm
.RE
.TP
.B -loc

View File

@ -1901,6 +1901,13 @@ static void parse_cmd_options ( int argc, char ** argv )
}
// Parse commandline arguments about the looks.
find_arg_int ( argc, argv, "-opacity", &( config.window_opacity ) );
find_arg_int ( argc, argv, "-width", &( config.menu_width ) );
find_arg_int ( argc, argv, "-lines", &( config.menu_lines ) );
find_arg_int ( argc, argv, "-columns", &( config.menu_columns ) );
find_arg_str ( argc, argv, "-font", &( config.menu_font ) );
find_arg_str ( argc, argv, "-fg", &( config.menu_fg ) );
find_arg_str ( argc, argv, "-bg", &( config.menu_bg ) );
@ -1908,12 +1915,8 @@ static void parse_cmd_options ( int argc, char ** argv )
find_arg_str ( argc, argv, "-hlbg", &( config.menu_hlbg ) );
find_arg_str ( argc, argv, "-bc", &( config.menu_bc ) );
find_arg_int ( argc, argv, "-bw", &( config.menu_bw ) );
find_arg_int ( argc, argv, "-o", &( config.window_opacity ) );
// Parse commandline arguments about size and position
find_arg_int ( argc, argv, "-width", &( config.menu_width ) );
find_arg_int ( argc, argv, "-lines", &( config.menu_lines ) );
find_arg_int ( argc, argv, "-columns", &( config.menu_columns ) );
find_arg_int ( argc, argv, "-loc", &( config.location ) );
find_arg_int ( argc, argv, "-padding", &( config.padding ) );
find_arg_int ( argc, argv, "-xoffset", &( config.x_offset ) );
@ -1924,7 +1927,7 @@ static void parse_cmd_options ( int argc, char ** argv )
}
// Parse commandline arguments about behavior
find_arg_str ( argc, argv, "-term", &( config.terminal_emulator ) );
find_arg_str ( argc, argv, "-terminal", &( config.terminal_emulator ) );
if ( find_arg ( argc, argv, "-zeltak" ) >= 0 )
{
config.zeltak_mode = 1;

View File

@ -59,23 +59,43 @@ typedef struct
*/
static XrmOption xrmOptions[] = {
{ xrm_Number, "opacity", { .num = &config.window_opacity }, NULL },
{ xrm_Number, "width", { .num = &config.menu_width }, NULL },
{ xrm_Number, "lines", { .num = &config.menu_lines }, NULL },
{ xrm_Number, "columns", { .num = &config.menu_columns }, NULL },
{ xrm_String, "font", { .str = &config.menu_font }, NULL },
/* Foreground color */
{ xrm_String, "foreground", { .str = &config.menu_fg }, NULL },
{ xrm_String, "fg", { .str = &config.menu_fg }, NULL },
{ xrm_String, "background", { .str = &config.menu_bg }, NULL },
{ xrm_String, "bg", { .str = &config.menu_bg }, NULL },
{ xrm_String, "highlightfg", { .str = &config.menu_hlfg }, NULL },
{ xrm_String, "hlbg", { .str = &config.menu_hlfg }, NULL },
{ xrm_String, "highlightbg", { .str = &config.menu_hlbg }, NULL },
{ xrm_String, "hlbg", { .str = &config.menu_hlbg }, NULL },
{ xrm_String, "bordercolor", { .str = &config.menu_bc }, NULL },
{ xrm_Number, "padding", { .num = &config.padding }, NULL },
{ xrm_String, "bc", { .str = &config.menu_bc }, NULL },
{ xrm_Number, "borderwidth", { .num = &config.menu_bw }, NULL },
{ xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL },
{ xrm_Number, "bw", { .num = &config.menu_bw }, NULL },
{ xrm_Number, "location", { .num = &config.location }, NULL },
{ xrm_Number, "loc", { .num = &config.location }, NULL },
{ xrm_Number, "padding", { .num = &config.padding }, NULL },
{ xrm_Number, "yoffset", { .num = &config.y_offset }, NULL },
{ xrm_Number, "xoffset", { .num = &config.x_offset }, NULL },
{ xrm_Boolean,"fixed-num-lines", { .num = &config.fixed_num_lines }, NULL },
{ xrm_Number, "columns", { .num = &config.menu_columns }, NULL },
{ xrm_Boolean,"hmode", { .num = &config.hmode }, NULL },
{ xrm_String, "terminal", { .str = &config.terminal_emulator }, NULL },
/* Key bindings */
{ xrm_String, "key", { .str = &config.window_key }, NULL },
{ xrm_String, "rkey", { .str = &config.run_key }, NULL },
@ -119,7 +139,6 @@ void parse_xresource_options ( Display *display )
free ( xrmOptions[i].mem );
xrmOptions[i].mem = NULL;
}
//TODO this leaks memory.
*xrmOptions[i].str = ( char * ) malloc ( xrmValue.size * sizeof ( char ) );
strncpy ( *xrmOptions[i].str, xrmValue.addr, xrmValue.size );