summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2019-05-04 10:24:59 +0200
committerDave Davenport <qball@gmpclient.org>2019-05-04 10:24:59 +0200
commite7da00dbff338327c5beb8ced42ab84016a18ed7 (patch)
tree04ed018375f1b94989fc0c385e59bea6c2d61908
parent47079270313d0f495952e4569073d268acd57536 (diff)
[DMenu] Add format option to output string stripped from pango markup.
-rw-r--r--doc/rofi-theme-selector.12
-rw-r--r--doc/rofi-theme.52
-rw-r--r--doc/rofi.15
-rw-r--r--doc/rofi.1.markdown1
-rw-r--r--source/helper.c10
5 files changed, 17 insertions, 3 deletions
diff --git a/doc/rofi-theme-selector.1 b/doc/rofi-theme-selector.1
index 47d0bff7..74712e74 100644
--- a/doc/rofi-theme-selector.1
+++ b/doc/rofi-theme-selector.1
@@ -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
diff --git a/doc/rofi-theme.5 b/doc/rofi-theme.5
index d09cd0ae..52928dcf 100644
--- a/doc/rofi-theme.5
+++ b/doc/rofi-theme.5
@@ -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
diff --git a/doc/rofi.1 b/doc/rofi.1
index 34796684..f8ea3d81 100644
--- a/doc/rofi.1
+++ b/doc/rofi.1
@@ -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
diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown
index d54d76ec..7c9fd572 100644
--- a/doc/rofi.1.markdown
+++ b/doc/rofi.1.markdown
@@ -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)
diff --git a/source/helper.c b/source/helper.c
index 8dde6627..8b522841 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -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 );