Adding fixime, newterm and opencopied patches
This commit is contained in:
parent
35e6403c69
commit
7615c2f0aa
15 changed files with 233 additions and 10 deletions
20
patch/newterm.c
Normal file
20
patch/newterm.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
void
|
||||
newterm(const Arg* a)
|
||||
{
|
||||
int res;
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
die("fork failed: %s\n", strerror(errno));
|
||||
break;
|
||||
case 0:
|
||||
res = chdir(getcwd_by_pid(pid));
|
||||
execlp("st", "./st", NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static char *getcwd_by_pid(pid_t pid) {
|
||||
char buf[32];
|
||||
snprintf(buf, sizeof buf, "/proc/%d/cwd", pid);
|
||||
return realpath(buf, NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue