refactor(audio): remove sound_pack from PlaybackData and add verbose mode

This commit is contained in:
sankalp committed 2025-10-08 12:55:44 +05:45
1 parent 59f258a028
commit 884c09b607
2 files changed
+20 -32

No files matched your search

+1 -19
View File
@@ -1,3 +1,4 @@
#define _POSIX_C_SOURCE 200809L
#include "config.h"
@@ -211,25 +212,6 @@ void cleanup_processes(int sig) {
exit(0);
}
int check_sudo_cached() {
int status = system("sudo -n true 2>/dev/null");
return WEXITSTATUS(status) == 0;
}
int ensure_sudo_access() {
if (check_sudo_cached()) {
return 1;
}
printf("This program requires sudo access to monitor keyboard events.\n");
printf("Please enter your password when prompted:\n");
int status = system("sudo -v");
if (WEXITSTATUS(status) != 0) {
fprintf(stderr, "Error: Failed to obtain sudo access\n");
return 0;
}
return 1;
}
static char *get_user_config_path(char *buffer, size_t buflen) {
const char *home = getenv("HOME");
if (!home || strlen(home) == 0) {