feat: add enable/disable keyboard and mouse sounds with CLI options and config file

This commit is contained in:
sankalp committed 2025-10-13 23:43:50 +05:45
1 parent 7c10a7a5e3
commit 347d3048f0
12 files changed
+298 -199

No files matched your search

+2
View File
@@ -13,6 +13,8 @@ typedef struct {
int verbose;
int keyboard_mute; // -1 unchanged, 0 unmute, 1 mute
int mouse_mute; // -1 unchanged, 0 unmute, 1 mute
int keyboard_enabled; // -1 unchanged, 0 disabled, 1 enabled
int mouse_enabled; // -1 unchanged, 0 disabled, 1 enabled
} CliOptions;
void print_usage(const char *program_name);
+1 -1
View File
@@ -8,7 +8,7 @@ int handle_reload(const char *user_cfg_path,
char *current_mouse_config_path, char *current_mouse_sound_dir,
int current_mute, int current_verbose,
int current_mouse_volume_arg, int current_keyboard_mute,
int current_mouse_mute);
int current_mouse_mute, int *current_keyboard_enabled, int *current_mouse_enabled);
#endif // KEYVIBE_RELOAD_H
+2
View File
@@ -39,5 +39,7 @@ extern int g_verbose;
extern int g_mute;
extern int g_keyboard_mute;
extern int g_mouse_mute;
extern int g_keyboard_enabled;
extern int g_mouse_enabled;
#endif // KEYVIBE_AUDIO_TYPES_H
+4
View File
@@ -24,4 +24,8 @@ void write_runtime_mute_file(int mute);
void write_runtime_keyboard_mute_file(int mute);
void write_runtime_mouse_mute_file(int mute);
// Runtime enabled helpers
int write_runtime_keyboard_enabled_file(int enabled);
int write_runtime_mouse_enabled_file(int enabled);
#endif // KEYVIBE_UTILS_H
+2 -2
View File
@@ -8,11 +8,11 @@ char *get_user_config_path(char *buffer, size_t buflen);
// Write ~/.keyvibe.json in new format
int write_user_config(const char *path, const char *keyboard_sound,
const char *mouse_sound, int keyboard_volume,
int mouse_volume);
int mouse_volume, int keyboard_enabled, int mouse_enabled);
// Read ~/.keyvibe.json supporting new and legacy formats
int read_user_config(const char *path, char **out_keyboard_sound,
char **out_mouse_sound, int *out_keyboard_volume,
int *out_mouse_volume);
int *out_mouse_volume, int *out_keyboard_enabled, int *out_mouse_enabled);
#endif // KEYVIBE_CONFIG_IO_H