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 void
viwmfs(char *str) viwmfs_help(void)
{
printf("ViWMFS commands list:\n");
return;
}
void
viwmfs(int argc, char **argv)
{ {
int i; int i;
char *cmd; char *cmd, str[256] = { 0 };
Bool e; Bool e;
if(!str) if(!argc)
return; 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 == ':') if(*str == ':')
{ {
++str; for(i = 0; i < strlen(str); str[i] = str[i + 1], ++i);
cmd = _strdup(str); cmd = _strdup(str);
for(i = 0; cmd[i] && cmd[i] != ' '; ++i); for(i = 0; cmd[i] && cmd[i] != ' '; ++i);
cmd[i] = '\0'; cmd[i] = '\0';

View File

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

View File

@ -318,7 +318,7 @@ void getinfo_nmaster(void);
void getinfo(char *info); void getinfo(char *info);
/* viwmfs.c */ /* viwmfs.c */
void viwmfs(char *str); void viwmfs(int argc, char **argv);
/* wmfs.c */ /* wmfs.c */
int errorhandler(Display *d, XErrorEvent *event); 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 Make a launcher in the infobar to run an unix command\fR
.RE .RE
.PP .PP
\fBAlt + Escape\fR
.RS 4
Set WMFS in ViWMFS mode. (see wmfs -V)\fR
.RE
.PP
\fBAlt\-Shift + p\fR \fBAlt\-Shift + p\fR
.RS 4 .RS 4
Make a launcher in the infobar to run an ssh session\fR Make a launcher in the infobar to run an ssh session\fR

View File

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