Conf/ViWMFS: Add bind to set WMFS in ViWMFS mode in the default configuration and improve viwmfs function.

This commit is contained in:
Martin Duquesnoy 2009-08-24 17:27:27 +02:00
parent 44e2844ad3
commit a34af54e78
5 changed files with 41 additions and 11 deletions

View File

@ -57,20 +57,42 @@ vicmd_to_uicb vicmd[] =
};
void
viwmfs(char *str)
viwmfs_help(void)
{
printf("ViWMFS commands list:\n");
return;
}
void
viwmfs(int argc, char **argv)
{
int i;
char *cmd;
char *cmd, str[256] = { 0 };
Bool e;
if(!str)
if(!argc)
return;
if(argc > 3)
{
for(i = 2; i < argc; ++i)
{
strcat(str, argv[i]);
if(*(str + strlen(str) - 1) != ':')
strcat(str, " ");
}
}
else
strcpy(str, argv[2]);
if(*str == ':')
{
++str;
for(i = 0; i < strlen(str); str[i] = str[i + 1], ++i);
cmd = _strdup(str);
for(i = 0; cmd[i] && cmd[i] != ' '; ++i);
cmd[i] = '\0';

View File

@ -415,7 +415,7 @@ main(int argc, char **argv)
exit(EXIT_SUCCESS);
break;
case 'V':
viwmfs(optarg);
viwmfs(argc, argv);
XCloseDisplay(dpy);
exit(EXIT_SUCCESS);
break;

View File

@ -318,7 +318,7 @@ void getinfo_nmaster(void);
void getinfo(char *info);
/* viwmfs.c */
void viwmfs(char *str);
void viwmfs(int argc, char **argv);
/* wmfs.c */
int errorhandler(Display *d, XErrorEvent *event);

5
wmfs.1
View File

@ -156,6 +156,11 @@ Swap the current client with the previous\fR
Make a launcher in the infobar to run an unix command\fR
.RE
.PP
\fBAlt + Escape\fR
.RS 4
Set WMFS in ViWMFS mode. (see wmfs -V)\fR
.RE
.PP
\fBAlt\-Shift + p\fR
.RS 4
Make a launcher in the infobar to run an ssh session\fR

View File

@ -155,10 +155,11 @@
command = "exec"
[/set_launcher]
#ViWMFS : manage wmfs with vi-based command.
[set_launcher]
name = "launcher_ssh"
prompt = "ssh to: "
command = "@WMFS_TERM@ -e ssh"
name = "viwmfs"
prompt = "> "
command = "wmfs -V"
[/set_launcher]
[/launcher]
@ -223,9 +224,11 @@
# Decease nmaster.
[key] mod = {"Alt", "Shift"} key = "d" func = "set_nmaster" cmd = "-1" [/key]
#Launchers.
#Launcher.
[key] mod = {"Alt"} key = "p" func = "launcher" cmd = "launcher_exec" [/key]
[key] mod = {"Alt", "Shift"} key = "p" func = "launcher" cmd = "launcher_ssh" [/key]
#ViWMFS
[key] mod = {"Alt"} key = "Escape" func = "launcher" cmd = "viwmfs" [/key]
# Set the tag x.
[key] mod = {"Alt"} key = "F1" func = "tag" cmd = "1" [/key]