aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 83663fb..0d7d7b6 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbCommands.cc,v 1.3 2003/04/15 12:13:22 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.4 2003/04/28 00:34:59 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
@@ -33,13 +33,20 @@ using namespace std;
33 33
34namespace FbCommands { 34namespace FbCommands {
35 35
36ExecuteCmd::ExecuteCmd(const std::string &cmd):m_cmd(cmd) { 36ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) {
37 37
38} 38}
39 39
40void ExecuteCmd::execute() { 40void ExecuteCmd::execute() {
41#ifndef __EMX__ 41#ifndef __EMX__
42 if (! fork()) { 42 if (! fork()) {
43 std::string displaystring("DISPLAY=");
44 displaystring += DisplayString(FbTk::App::instance()->display());
45 char intbuff[64];
46 sprintf(intbuff, "%d", m_screen_num);
47 // remove last number of display and add screen num
48 displaystring.erase(displaystring.size()-1);
49 displaystring += intbuff;
43 setsid(); 50 setsid();
44 execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0); 51 execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0);
45 exit(0); 52 exit(0);