View Single Post
Old 02-20-2013, 10:54 AM   #9
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by anakod View Post
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.
ixtab is offline   Reply With Quote