Add option to specify terminal to launch

This commit is contained in:
QC 2014-01-20 21:17:19 +01:00
parent 22399d0fae
commit eda0a9e0d0
2 changed files with 21 additions and 1 deletions

View file

@ -23,6 +23,8 @@ simpleswitcher \- a simple EWMH window switcher
.IR comdo ]
.RB [ \-now ]
.RB [ \-rnow ]
.RB [ \-term
.IR terminal ]
.SH DESCRIPTION
.I simpleswitcher
@ -136,6 +138,13 @@ Set the width of the menu as a percentage of the screen width (default: 60).
.RS
simpleswitcher -width 60
.RE
.TP
.B -term
Specify what terminal to start (default x-terminal-emulator)
.P
.RS
simpleswitcher -term xterm
.RE
.SH Switch between modi
Type '?'<enter> to switch between window list and run mode.
.SH SEE ALSO

View file

@ -71,10 +71,19 @@
#define OPACITY "_NET_WM_WINDOW_OPACITY"
#define I3_SOCKET_PATH_PROP "I3_SOCKET_PATH"
#define TERMINAL_DEFAULT "x-terminal-emulator"
char *config_terminal_emulator;
#ifdef TIMING
#include <time.h>
#endif
static void* allocate( unsigned long bytes )
{
void *ptr = malloc( bytes );
@ -212,7 +221,7 @@ static inline int execsh( const char *cmd ,int run_in_term )
{
// use sh for args parsing
if ( run_in_term )
return execlp( "x-terminal-emulator", "x-terminal-emulator", "-e", "sh", "-c", cmd, NULL );
return execlp( config_terminal_emulator, config_terminal_emulator, "-e", "sh", "-c", cmd, NULL );
return execlp( "/bin/sh", "sh", "-c", cmd, NULL );
}
@ -1539,6 +1548,8 @@ int main( int argc, char *argv[] )
config_menu_bc = find_arg_str( ac, av, "-bc", MENUBC );
config_window_opacity = find_arg_int( ac, av, "-o", 100 );
config_terminal_emulator = find_arg_str( ac, av, "-term", TERMINAL_DEFAULT);
config_zeltak_mode = ( find_arg( ac, av, "-zeltak" ) >= 0 );
#ifdef I3