Index: ChangeLog =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/ChangeLog,v retrieving revision 1.415 diff -u -p -r1.415 ChangeLog --- ChangeLog 5 Jan 2006 04:36:07 -0000 1.415 +++ ChangeLog 24 Jan 2006 11:41:18 -0000 @@ -1,1 +1,13 @@ +2006-01-24 Bernhard R. Link + + * src/actions.c (cmd_execa,cmd_execf): new functions + (spawn): new argument to set frame for client_info + (cmd_exec): give spawn current_frame() + (cmd_verbexec): give spawn current_frame() + (cmd_tmpwm): give span NULL + (init_user_commands): add execa and execf commands + * src/actions.h (spawn): new argument added to prototype + (cmd_execa,cmd_execf): new prototypes + * doc/ratpoison.1: document new functions execf and execa + 2006-01-04 Shawn Betts Index: doc/ratpoison.1 =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/doc/ratpoison.1,v retrieving revision 1.19 diff -u -p -r1.19 ratpoison.1 --- doc/ratpoison.1 3 Jan 2006 21:34:20 -0000 1.19 +++ doc/ratpoison.1 24 Jan 2006 11:41:18 -0000 @@ -292,6 +292,15 @@ to \fIkey\fP without modifiers or \fBC\- has no modifiers. .cmd exec shell\-command ( C\-t ! ) Spawn a shell executing \fIshell\-command\fP. +.cmd execa shell\-command +Spawn a shell executing \fIshell\-command\fP, without remembering +the current frame, so that _NET_WM_PID declaring programs will be +placed into the frame active when they open a window instead of +the frame active when ratpoison gets this command. +.cmd execf frame shell\-command +Spawn a shell executing \fIshell\-command\fP, showing _NET_WM_PID +supporting programs in the given frame instead of the frame selected +when this program is run. .cmd fdump [ screenno ] Output the defining data for all frames of the current screen, or for screen number \fIscreenno\fP if this is specified. Index: src/actions.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v retrieving revision 1.260 diff -u -p -r1.260 actions.c --- src/actions.c 3 Jan 2006 21:34:20 -0000 1.260 +++ src/actions.c 24 Jan 2006 11:41:19 -0000 @@ -182,6 +182,11 @@ init_user_commands() "Key: ", arg_KEY); add_command ("exec", cmd_exec, 1, 1, 1, "/bin/sh -c ", arg_SHELLCMD); + add_command ("execa", cmd_execa, 1, 1, 1, + "/bin/sh -c ", arg_SHELLCMD); + add_command ("execf", cmd_execf, 2, 2, 2, + "frame to execute in:", arg_FRAME, + "/bin/sh -c ", arg_SHELLCMD); add_command ("fdump", cmd_fdump, 1, 0, 0, "", arg_NUMBER); add_command ("focus", cmd_next_frame, 0, 0, 0); @@ -2452,12 +2457,26 @@ cmd_colon (int interactive, struct cmdar cmdret * cmd_exec (int interactive, struct cmdarg **args) { - spawn (ARG_STRING(0), 0); + spawn (ARG_STRING(0), 0, current_frame()); + return cmdret_new (RET_SUCCESS, NULL); +} + +cmdret * +cmd_execa (int interactive, struct cmdarg **args) +{ + spawn (ARG_STRING(0), 0, NULL); + return cmdret_new (RET_SUCCESS, NULL); +} + +cmdret * +cmd_execf (int interactive, struct cmdarg **args) +{ + spawn (ARG_STRING(1), 0, ARG(0,frame)); return cmdret_new (RET_SUCCESS, NULL); } int -spawn(char *cmd, int raw) +spawn(char *cmd, int raw, rp_frame *frame) { rp_child_info *child; int pid; @@ -2491,7 +2510,7 @@ spawn(char *cmd, int raw) child->cmd = strdup (cmd); child->pid = pid; child->terminated = 0; - child->frame = current_frame(); + child->frame = frame; child->group = rp_current_group; child->screen = current_screen(); @@ -4232,7 +4251,7 @@ cmd_tmpwm (int interactive, struct cmdar /* Disable our SIGCHLD handler */ set_sig_handler (SIGCHLD, SIG_IGN); /* Launch the new WM and wait for it to terminate. */ - pid = spawn (ARG_STRING(0), 0); + pid = spawn (ARG_STRING(0), 0, NULL); PRINT_DEBUG (("spawn pid: %d\n", pid)); do { @@ -4449,7 +4468,7 @@ cmdret * cmd_verbexec (int interactive, struct cmdarg **args) { marked_message_printf(0, 0, "Running %s", ARG_STRING(0)); - spawn (ARG_STRING(0), 0); + spawn (ARG_STRING(0), 0, current_frame()); return cmdret_new (RET_SUCCESS, NULL); } Index: src/actions.h =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/actions.h,v retrieving revision 1.84 diff -u -p -r1.84 actions.h --- src/actions.h 20 Oct 2005 06:21:44 -0000 1.84 +++ src/actions.h 24 Jan 2006 11:41:19 -0000 @@ -96,7 +96,7 @@ user_command struct list_head node; }; -int spawn(char *data, int raw); +int spawn(char *data, int raw, rp_frame *frame); cmdret *command (int interactive, char *data); /* command function prototypes. */ @@ -115,6 +115,8 @@ RP_CMD (delete); RP_CMD (echo); RP_CMD (escape); RP_CMD (exec); +RP_CMD (execa); +RP_CMD (execf); RP_CMD (fdump); RP_CMD (focusdown); RP_CMD (focuslast);