Adding fixime, newterm and opencopied patches

This commit is contained in:
bakkeby 2019-09-16 12:40:07 +02:00
parent 35e6403c69
commit 7615c2f0aa
15 changed files with 233 additions and 10 deletions

20
patch/newterm.c Normal file
View 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);
}