Add modem/networks DWM plugins, Dual-SIM & PIN/PUK support, built-in dmenu views, and game UX fixes
This commit is contained in:
@@ -35,8 +35,13 @@ static int is_dmenu_builtin_arg(const char *arg) {
|
||||
return strcmp(arg, "sys") == 0 ||
|
||||
strcmp(arg, "ctx") == 0 ||
|
||||
strcmp(arg, "applications") == 0 ||
|
||||
strcmp(arg, "games") == 0 ||
|
||||
strcmp(arg, "scripts") == 0 ||
|
||||
strcmp(arg, "modem") == 0 ||
|
||||
strcmp(arg, "audio") == 0 ||
|
||||
strcmp(arg, "notifications") == 0 ||
|
||||
strcmp(arg, "wm") == 0 ||
|
||||
strcmp(arg, "timezone") == 0 ||
|
||||
strcmp(arg, "config") == 0 ||
|
||||
strcmp(arg, "power") == 0 ||
|
||||
strcmp(arg, "st") == 0 ||
|
||||
@@ -206,6 +211,14 @@ static int try_send_plugin_fifo(const char *plugin_name, int sub_argc, char **su
|
||||
len = snprintf(cmd, sizeof(cmd), "OPEN thread:%s\n", num);
|
||||
} else if (sub_argc >= 2 && sub_argv[1] && sub_argv[1][0]) {
|
||||
len = snprintf(cmd, sizeof(cmd), "OPEN %s\n", sub_argv[1]);
|
||||
} else if (sub_argc >= 1 && sub_argv[0]) {
|
||||
const char *b0 = strrchr(sub_argv[0], '/');
|
||||
b0 = b0 ? (b0 + 1) : sub_argv[0];
|
||||
if (strcasecmp(b0, "xbluetooth") == 0 || strcasecmp(b0, "bluetooth") == 0) {
|
||||
len = snprintf(cmd, sizeof(cmd), "OPEN bluetooth\n");
|
||||
} else {
|
||||
len = snprintf(cmd, sizeof(cmd), "OPEN\n");
|
||||
}
|
||||
} else {
|
||||
len = snprintf(cmd, sizeof(cmd), "OPEN\n");
|
||||
}
|
||||
@@ -254,6 +267,13 @@ static const char *resolve_plugin_name_from_argv0(const char *argv0) {
|
||||
if (strcasecmp(base, "xthemes") == 0 || strcasecmp(base, "themes") == 0) {
|
||||
return "themes";
|
||||
}
|
||||
if (strcasecmp(base, "xmodem") == 0 || strcasecmp(base, "modem") == 0) {
|
||||
return "modem";
|
||||
}
|
||||
if (strcasecmp(base, "xnetworks") == 0 || strcasecmp(base, "networks") == 0 ||
|
||||
strcasecmp(base, "xbluetooth") == 0 || strcasecmp(base, "bluetooth") == 0) {
|
||||
return "networks";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -78,6 +78,17 @@ constexpr const char* kIconSoundOff = "\xef\x91\xa6"; // U+F466 mute
|
||||
constexpr const char* kIconMicOn = "\xf3\xb0\x8d\xac"; // U+F036C mic on
|
||||
constexpr const char* kIconMicOff = "\xf3\xb0\x8d\xad"; // U+F036D mic off
|
||||
constexpr const char* kIconRecord = "\xef\x84\x91"; // U+F111 circle / record dot
|
||||
constexpr const char* kIconLock = "\xef\x80\xa3"; // U+F023 lock
|
||||
constexpr const char* kIconUnlock = "\xef\x82\x9c"; // U+F09C unlock
|
||||
constexpr const char* kIconSignal = "\xef\x80\x92"; // U+F012 signal bars
|
||||
constexpr const char* kIconWifi = "\xef\x87\xab"; // U+F1EB wifi
|
||||
constexpr const char* kIconBluetooth = "\xef\x8a\x94"; // U+F294 bluetooth
|
||||
constexpr const char* kIconGlobe = "\xef\x82\xac"; // U+F0AC globe / network
|
||||
constexpr const char* kIconSliders = "\xef\x87\x9e"; // U+F1DE sliders / config
|
||||
constexpr const char* kIconToggleOn = "\xef\x88\x85"; // U+F205 toggle on
|
||||
constexpr const char* kIconToggleOff = "\xef\x88\x84"; // U+F204 toggle off
|
||||
constexpr const char* kIconKey = "\xef\x82\x84"; // U+F084 key / PIN
|
||||
constexpr const char* kIconSim = "\xef\x9f\x84"; // U+F7C4 sim card / chip
|
||||
|
||||
inline int64_t nowMs() {
|
||||
struct timespec ts {};
|
||||
@@ -333,6 +344,26 @@ inline void runAsyncCmd(const std::string& cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string runCaptureCmd(const std::string& cmd, int* exitCodeOut = nullptr) {
|
||||
FILE* fp = ::popen(cmd.c_str(), "r");
|
||||
if (!fp) {
|
||||
if (exitCodeOut) {
|
||||
*exitCodeOut = -1;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
std::string out;
|
||||
char buf[512];
|
||||
while (std::fgets(buf, sizeof(buf), fp) != nullptr) {
|
||||
out += buf;
|
||||
}
|
||||
int status = ::pclose(fp);
|
||||
if (exitCodeOut) {
|
||||
*exitCodeOut = status;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
inline void runAsyncArgv(const char* prog,
|
||||
const char* arg1 = nullptr,
|
||||
const char* arg2 = nullptr,
|
||||
@@ -1013,6 +1044,8 @@ inline void closeOtherPlugins(const char* selfPluginName) {
|
||||
{"xfiles.pid", "files"},
|
||||
{"xcamera.pid", "camera"},
|
||||
{"xthemes.pid", "themes"},
|
||||
{"xmodem.pid", "modem"},
|
||||
{"xnetworks.pid", "networks"},
|
||||
};
|
||||
for (const auto& p : kAllPlugins) {
|
||||
if (selfPluginName && std::strcmp(p.name, selfPluginName) == 0) {
|
||||
@@ -1039,6 +1072,8 @@ inline void broadcastThemeReload(const char* selfPluginName = nullptr) {
|
||||
"files",
|
||||
"camera",
|
||||
"themes",
|
||||
"modem",
|
||||
"networks",
|
||||
};
|
||||
for (const char* name : kPlugins) {
|
||||
if (selfPluginName && std::strcmp(name, selfPluginName) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user