aboutsummaryrefslogtreecommitdiff
path: root/util/fbrun/FbRun.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-04 21:01:31 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-04 21:01:31 (GMT)
commite6570b61f34e9d7822f500706a5a2cd6bc436234 (patch)
tree3f186315662e41fc8908d07a1720de0282113981 /util/fbrun/FbRun.cc
parent4b5c00b764417b91388d6e88b10f3cbd2764ff02 (diff)
downloadfluxbox-e6570b61f34e9d7822f500706a5a2cd6bc436234.zip
fluxbox-e6570b61f34e9d7822f500706a5a2cd6bc436234.tar.bz2
add -print option to fbrun to return result to stdout instead of executing it
Diffstat (limited to 'util/fbrun/FbRun.cc')
-rw-r--r--util/fbrun/FbRun.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index c304413..f98a02e 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -58,6 +58,7 @@ using std::ios;
58FbRun::FbRun(int x, int y, size_t width): 58FbRun::FbRun(int x, int y, size_t width):
59 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()), 59 FbTk::TextBox(DefaultScreen(FbTk::App::instance()->display()),
60 m_font, ""), 60 m_font, ""),
61 m_print(false),
61 m_font("fixed"), 62 m_font("fixed"),
62 m_display(FbTk::App::instance()->display()), 63 m_display(FbTk::App::instance()->display()),
63 m_bevel(4), 64 m_bevel(4),
@@ -115,6 +116,12 @@ void FbRun::run(const std::string &command) {
115 FbTk::App::instance()->end(); // end application 116 FbTk::App::instance()->end(); // end application
116 m_end = true; // mark end of processing 117 m_end = true; // mark end of processing
117 118
119 if (m_print) {
120 std::cout << command;
121 hide();
122 return;
123 }
124
118 // fork and execute program 125 // fork and execute program
119 if (!fork()) { 126 if (!fork()) {
120 127