refactor(audio): remove sound_pack from PlaybackData and add verbose mode
This commit is contained in:
2 files changed
+20
-32
No files matched your search
+1
-19
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user