Quote:
Originally Posted by anakod
Okay, but I don't know how I could rewrite this. This is very simple
PHP Code:
switch(fork()) { case 0: { execlp("/bin/sh", "sh", "-c", "/usr/bin/lipc-set-prop -s com.lab126.keyboard open net.fabiszewski.leafpad:Abc:1", NULL); } case -1: perror("Failed to open keyboard\n"); exit(1); }
switch(fork()) { case 0: { execlp("/bin/sh", "sh", "-c", "/usr/bin/lipc-set-prop -s com.lab126.keyboard close net.fabiszewski.leafpad", NULL); } case -1: perror("Failed to open keyboard\n"); exit(1); }
It's all under GPL.
|
Write down the shell commands you need, and possibly modify them. Remember the overall logic required, then delete the original code, and, from memory, write your own which essentially achieves the same result, but without being a verbatim copy (you did remember what you have to do, didn't you?)
Or, ask the original author for permission to re-use the code snippet under a different license.