1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[DMenu] Add format option to output string stripped from pango markup.

This commit is contained in:
Dave Davenport 2019-05-04 10:24:59 +02:00
parent 4707927031
commit e7da00dbff
5 changed files with 17 additions and 3 deletions

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ROFI\-THEME\-SELECTOR" "1" "January 2018" "" ""
.TH "ROFI\-THEME\-SELECTOR" "1" "May 2019" "" ""
.
.SH "NAME"
\fBrofi\-theme\-selector\fR \- Preview and apply themes for \fBrofi\fR

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ROFI\-THEME" "5" "April 2019" "" ""
.TH "ROFI\-THEME" "5" "May 2019" "" ""
.
.SH "NAME"
\fBrofi\-theme\fR \- Rofi theme format files

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ROFI" "1" "March 2019" "" ""
.TH "ROFI" "1" "May 2019" "" ""
.
.SH "NAME"
\fBrofi\fR \- A window switcher, application launcher, ssh dialog and dmenu replacement
@ -1021,6 +1021,9 @@ Allows the output of dmenu to be customized (N is the total number of input entr
\'q\' quote string
.
.IP "\(bu" 4
\'p\' Selected string stripped from pango markup (Needs to be a valid string)
.
.IP "\(bu" 4
\'f\' filter string (user input)
.
.IP "\(bu" 4

View file

@ -597,6 +597,7 @@ Allows the output of dmenu to be customized (N is the total number of input entr
* 'i' index (0 - (N-1))
* 'd' index (1 - N)
* 'q' quote string
* 'p' Selected string stripped from pango markup (Needs to be a valid string)
* 'f' filter string (user input)
* 'F' quoted filter string (user input)

View file

@ -1180,6 +1180,16 @@ void rofi_output_formatted_line ( const char *format, const char *string, int se
else if ( format[i] == 's' ) {
fputs ( string, stdout );
}
else if ( format[i] == 'p' ) {
char *esc = NULL;
pango_parse_markup(string, -1, 0, NULL, &esc, NULL, NULL);
if ( esc ){
fputs ( esc, stdout );
g_free ( esc );
} else {
fputs ( "invalid string" , stdout );
}
}
else if ( format[i] == 'q' ) {
char *quote = g_shell_quote ( string );
fputs ( quote, stdout );