On Tue, 20 Feb 2001, marco.fioretti wrote:
> >... I have used blackbox 0.61 rpm with RedHat 6.2 with no
> >problems for a couple of months now. Install was a piece
> >of cake. Only glitch ...(is not being able to use)...
> >keystrokes to change between windows and workspaces.
> >
> >The programmers have left it up to bbkeys to handle those
> >functions from now on and I have yet to get bbkeys up and
> >running on RedHat 6.2. A dependency problem.
> >....
>
[snip]
> Ah, well. It *does* look as I'll have to wait for all the 0.61.x
goodies
> until I do have time to upgrade the whole
> thing. No problem though, 0.51 is already a fine WM.
[snip]
The only dependency problem that I know of on bbkeys is that a
pre-rolled RPM probably has the Qt config tool with it. Build bbkeys
from source (it's really small, and it doesn't build the Qt tool by
default) and apply this patch to the source, it kinda eliminates the
need for the Qt tool.
-- Begin file: bbkeys.diff ---
--- bbkeys.cc.orig Thu Sep 28 17:15:11 2000
+++ bbkeys.cc Tue Feb 20 06:11:54 2001
@@ -591,42 +591,27 @@
void ToolWindow::setKeygrabs(void)
{
- int pid, status;
- char command[80];
- extern char **environ;
-
- memset(command, 0, 80);
-
- if (noQt) {
- sprintf(command, "xterm -bg black -fg green -e bbkeysConfigC");
+ int res;
+ if (! fork()) {
+ if (noQt) {
+ // Make 'bbkeysconf' automagically fail...
+ res = 1;
+ } else {
+ res = execlp("bbkeysconf", "bbkeysconf", NULL);
+ }
+ if (res != 0) {
+ res = execlp("bbkeysConfigGtk", "bbkeysConfigGtk", NULL);
+ if (res != 0) {
+ res = execlp("xterm", "xterm", "-bg", "black", "-fg",
+"green",
"-e", "bbkeysConfigC", NULL);
+ if (res != 0) {
+ execlp("rxvt", "rxvt", "-bg", " black", "-fg",
+"green", "-e",
"bbkeysConfigC", NULL);
+ }
+ }
+ }
+ exit(0);
} else {
- sprintf(command, "bbkeysconf");
+ puts("bbkeys: Cannot spawn a new process.");
}
-
- pid = fork();
- if (pid == -1) {
- fprintf(stderr,
- "bbkeys: Couldn't fork a process to
launch configurator.\n");
- return;
- }
-
- if (pid == 0) {
- char *argv[4];
- argv[0] = "sh";
- argv[1] = "-c";
- argv[2] = command;
- argv[3] = 0;
- execve("/bin/sh", argv, environ);
- exit(127);
- }
-
- do {
- if (waitpid(pid, &status, 0) == -1) {
- if (errno != EINTR)
- return;
- } else
- return;
- } while (1);
}
void ToolWindow::loadKeygrabs(void)
-- End file --