mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Add quote and escape string option.
This commit is contained in:
parent
8abf3335dc
commit
22f35983c0
3 changed files with 10 additions and 3 deletions
|
@ -519,7 +519,8 @@ The following options are further explained in the theming section:
|
||||||
* 's' selected string.
|
* 's' selected string.
|
||||||
* 'i' index (0 - (N-1)).
|
* 'i' index (0 - (N-1)).
|
||||||
* 'd' index (1 - N).
|
* 'd' index (1 - N).
|
||||||
* 'e' selected string escaped.
|
* 'q' quote string.
|
||||||
|
* 'e' escape string.
|
||||||
|
|
||||||
Default: 's'
|
Default: 's'
|
||||||
|
|
||||||
|
|
|
@ -678,7 +678,8 @@ Allows the output of dmenu to be customized (N is total number of input entries)
|
||||||
* 's' selected string.
|
* 's' selected string.
|
||||||
* 'i' index (0 \- (N\-1)).
|
* 'i' index (0 \- (N\-1)).
|
||||||
* 'd' index (1 \- N).
|
* 'd' index (1 \- N).
|
||||||
* 'e' selected string escaped.
|
* 'q' quote string.
|
||||||
|
* 'e' escape string.
|
||||||
Default: 's'
|
Default: 's'
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
|
|
|
@ -154,11 +154,16 @@ static void dmenu_output_formatted_line ( const char *format, const char *string
|
||||||
else if ( format[i] == 's' ) {
|
else if ( format[i] == 's' ) {
|
||||||
fputs ( string, stdout );
|
fputs ( string, stdout );
|
||||||
}
|
}
|
||||||
else if ( format[i] == 'e' ) {
|
else if ( format[i] == 'q' ) {
|
||||||
char *quote = g_shell_quote ( string );
|
char *quote = g_shell_quote ( string );
|
||||||
fputs ( quote, stdout );
|
fputs ( quote, stdout );
|
||||||
g_free ( quote );
|
g_free ( quote );
|
||||||
}
|
}
|
||||||
|
else if ( format[i] == 'e' ) {
|
||||||
|
char *quote = g_strescape ( string, "" );
|
||||||
|
fputs ( quote, stdout );
|
||||||
|
g_free ( quote );
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
fputc ( format[i], stdout );
|
fputc ( format[i], stdout );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue