Compare commits

..

No commits in common. "0a0ab0703ae6ec453e7b011ca1fb78049303166b" and "4a0b863735b5b06fa74c621cb58a92807227e4c5" have entirely different histories.

2 changed files with 2 additions and 12 deletions

View File

@ -6,9 +6,9 @@ Written in C++20, using epoll (without helper libraries), to stay nice and smol
# Why write this? # Why write this?
Because `app &` then `exec wm` in `.xinitrc` is impressively awful. What if your WM crashes, or your panel? Guess you lose them! Because `app &` then `exec wm` is impressively awful. What if your WM crashes, or your panel? Guess you lose them!
And if your WM crashes? Your whole Xorg server goes with it, meaning so does everything else. And if your WM crashes? Your whole xorg server goes with it, meaning so does everything else.
A more robust solution that's still small and easy to setup (read: Not written in bash) is clearly a better idea. A more robust solution that's still small and easy to setup (read: Not written in bash) is clearly a better idea.
@ -28,7 +28,4 @@ $ ninja -C build
# Configuration # Configuration
- Copy `/usr/share/doc/nanosm/nanosm.toml` to `~/.config/nanosm/` and edit it to your liking/setup. - Copy `/usr/share/doc/nanosm/nanosm.toml` to `~/.config/nanosm/` and edit it to your liking/setup.
- Remove the applications you added to your `nanosm.toml` from your `.xinitrc`, since nanosm will handle them
- Add `exec nanosm` to the end of your `.xinitrc`. - Add `exec nanosm` to the end of your `.xinitrc`.
- ...
- Profit?

View File

@ -3,7 +3,6 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <sched.h> #include <sched.h>
#include <signal.h> #include <signal.h>
#include <sys/prctl.h>
#include <sys/types.h> #include <sys/types.h>
#include "WordExp.hpp" #include "WordExp.hpp"
@ -50,12 +49,6 @@ namespace nanosm {
for(usize i = 0; i < exp.words.size(); ++i) for(usize i = 0; i < exp.words.size(); ++i)
argv[i] = exp.words[i].data(); argv[i] = exp.words[i].data();
// Ensure that if nanosm (the parent) dies, we die along with it
if(prctl(PR_SET_PDEATHSIG, SIGTERM) == -1) {
perror("Process pre-exec: prctl(PR_SET_PDEATHSIG)");
exit(1);
}
exit(execvp(exp.words[0].data(), argv.data())); exit(execvp(exp.words[0].data(), argv.data()));
} else { } else {
// Parent: monitor the pidfd by adding ourselves to the event loop now // Parent: monitor the pidfd by adding ourselves to the event loop now