Activate passcode lockscreen immediately upon GUI startup on boot

This commit is contained in:
Luxferre committed 2026-10-30 09:34:09 +02:00
1 parent 8c2a337c0d
commit 8df412085b
53 files changed
+79 -22

No files matched your search

+18 -2
View File
@@ -24,6 +24,7 @@
#include <poll.h>
#include <sstream>
#include <string>
#include <sys/file.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -178,8 +179,23 @@ inline bool isPluginDaemonAlive(const char* name) {
}
}
buf[n] = '\0';
return (std::strstr(buf, "dwm-plugin") != nullptr &&
std::strstr(buf, name) != nullptr);
return (std::strstr(buf, name) != nullptr);
}
inline int acquirePluginDaemonLock(const char* name) {
if (!name || !name[0]) {
return -1;
}
std::string lockPath = std::string("/tmp/dwm_plugin_") + name + ".lock";
int fd = ::open(lockPath.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666);
if (fd < 0) {
return -1;
}
if (::flock(fd, LOCK_EX | LOCK_NB) != 0) {
::close(fd);
return -1;
}
return fd;
}
inline bool sendPluginCommand(const char* name, const std::string& cmdLine) {