Implement passcode-based fullscreen phone locker (locker.so / xlocker)
This commit is contained in:
1 parent
32d5d2f2b4
commit
0656042f7f
56 files changed
+1264
-120
No files matched your search
+15
-5
@@ -1021,11 +1021,15 @@ static int xdrawer_run_main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto isOtherPluginActive = [&]() {
|
||||
if (::access("/tmp/bananarchy_screen_locked", F_OK) == 0) {
|
||||
return true;
|
||||
}
|
||||
static const char* kPids[] = {
|
||||
"xdialer.pid", "xcalllog.pid", "xcallscreen.pid", "xcontacts.pid",
|
||||
"xsms.pid", "xfiles.pid", "xcamera.pid", "xthemes.pid",
|
||||
"xmodem.pid", "xnetworks.pid", "xringtones.pid", "xwallpapers.pid",
|
||||
"xmusic.pid",
|
||||
"xlocker.pid", "xdialer.pid", "xcalllog.pid", "xcallscreen.pid",
|
||||
"xcontacts.pid", "xsms.pid", "xfiles.pid", "xcamera.pid",
|
||||
"xthemes.pid", "xmodem.pid", "xnetworks.pid", "xringtones.pid",
|
||||
"xwallpapers.pid", "xmusic.pid", "xsip.pid", "xemail.pid",
|
||||
"xirc.pid", "xtox.pid", "xsmallweb.pid", "xgps.pid",
|
||||
};
|
||||
for (const char* pf : kPids) {
|
||||
int p = readIntFile(getRuntimeFile(pf), -1);
|
||||
@@ -1040,7 +1044,7 @@ static int xdrawer_run_main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto showWindow = [&]() {
|
||||
if (visible) {
|
||||
if (visible || ::access("/tmp/bananarchy_screen_locked", F_OK) == 0) {
|
||||
return;
|
||||
}
|
||||
writeIntFile(pidPath, static_cast<int>(::getpid()));
|
||||
@@ -1057,6 +1061,12 @@ static int xdrawer_run_main(int argc, char** argv) {
|
||||
closeOtherPlugin("xringtones.pid", "/tmp/dwm_plugin_ringtones.fifo");
|
||||
closeOtherPlugin("xwallpapers.pid", "/tmp/dwm_plugin_wallpapers.fifo");
|
||||
closeOtherPlugin("xmusic.pid", "/tmp/dwm_plugin_music.fifo");
|
||||
closeOtherPlugin("xsip.pid", "/tmp/dwm_plugin_sip.fifo");
|
||||
closeOtherPlugin("xemail.pid", "/tmp/dwm_plugin_email.fifo");
|
||||
closeOtherPlugin("xirc.pid", "/tmp/dwm_plugin_irc.fifo");
|
||||
closeOtherPlugin("xtox.pid", "/tmp/dwm_plugin_tox.fifo");
|
||||
closeOtherPlugin("xsmallweb.pid", "/tmp/dwm_plugin_smallweb.fifo");
|
||||
closeOtherPlugin("xgps.pid", "/tmp/dwm_plugin_gps.fifo");
|
||||
if (::access("/tmp/dwm_plugin_dmenu.active", F_OK) == 0) {
|
||||
int dfd = ::open("/tmp/dwm_plugin_dmenu.fifo", O_WRONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
if (dfd >= 0) {
|
||||
|
||||
Reference in new issue
Block a user