rebranding

This commit is contained in:
sankalp committed 2025-10-18 14:17:52 +05:45
1 parent 20b81a69dd
commit 1e9f5c784b
19 files changed
+89 -90

No files matched your search

+20 -21
View File
@@ -1,4 +1,3 @@
CC = gcc CC = gcc
# Updated include paths for modular headers # Updated include paths for modular headers
CFLAGS = -Wall -Wextra -std=c99 -Iinclude -Iinclude/app -Iinclude/audio -Iinclude/common -Iinclude/sound -Iinclude/config CFLAGS = -Wall -Wextra -std=c99 -Iinclude -Iinclude/app -Iinclude/audio -Iinclude/common -Iinclude/sound -Iinclude/config
@@ -11,25 +10,25 @@ LDFLAGS_SOUND = -ljson-c -lpulse -lpulse-simple -lsndfile -lpthread
LDFLAGS_KEYBOARD = $(shell pkg-config --libs libevdev libinput libudev) -lpthread LDFLAGS_KEYBOARD = $(shell pkg-config --libs libevdev libinput libudev) -lpthread
# Targets # Targets
KEYVIBE_TARGET = keyvibe VBX_TARGET = vbx
SOUND_TARGET = audio SOUND_TARGET = audio
KEYBOARD_TARGET = input KEYBOARD_TARGET = input
# Sources (reorganized) # Sources (reorganized)
KEYVIBE_SOURCE = src/main.c src/common/utils.c src/config.c src/soundpacks.c src/app/process.c src/app/watch.c src/cli.c src/app/reload.c VBX_SOURCE = src/main.c src/common/utils.c src/config.c src/soundpacks.c src/app/process.c src/app/watch.c src/cli.c src/app/reload.c
SOUND_SOURCE = src/audio/main.c src/audio/config.c src/audio/playback.c src/common/utils.c SOUND_SOURCE = src/audio/main.c src/audio/config.c src/audio/playback.c src/common/utils.c
KEYBOARD_SOURCE = src/input.c src/common/utils.c KEYBOARD_SOURCE = src/input.c src/common/utils.c
# Install paths # Install paths
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share/keyvibe SHAREDIR = $(PREFIX)/share/vbx
UDEV_RULE = /etc/udev/rules.d/99-keyvibe-allow-keyboard.rules UDEV_RULE = /etc/udev/rules.d/99-vbx-allow-keyboard.rules
all: $(KEYVIBE_TARGET) $(SOUND_TARGET) $(KEYBOARD_TARGET) all: $(VBX_TARGET) $(SOUND_TARGET) $(KEYBOARD_TARGET)
# Build main launcher (needs json-c) # Build main launcher (needs json-c)
$(KEYVIBE_TARGET): $(KEYVIBE_SOURCE) $(VBX_TARGET): $(VBX_SOURCE)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ -ljson-c -lpthread $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ -ljson-c -lpthread
$(SOUND_TARGET): $(SOUND_SOURCE) $(SOUND_TARGET): $(SOUND_SOURCE)
@@ -39,22 +38,22 @@ $(KEYBOARD_TARGET): $(KEYBOARD_SOURCE)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS_KEYBOARD) $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS_KEYBOARD)
clean: clean:
rm -f $(KEYVIBE_TARGET) $(SOUND_TARGET) $(KEYBOARD_TARGET) rm -f $(VBX_TARGET) $(SOUND_TARGET) $(KEYBOARD_TARGET)
test: all test: all
@echo "Testing sound packs:" @echo "Testing sound packs:"
./$(KEYVIBE_TARGET) --list ./$(VBX_TARGET) --list
@echo "" @echo ""
@echo "To run KeyVibe:" @echo "To run VBX:"
@echo " sudo ./$(KEYVIBE_TARGET) # Default sound" @echo " sudo ./$(VBX_TARGET) # Default sound"
@echo " sudo ./$(KEYVIBE_TARGET) -s cherrymx-blue-abs # Specific sound" @echo " sudo ./$(VBX_TARGET) -s cherrymx-blue-abs # Specific sound"
@echo " sudo ./$(KEYVIBE_TARGET) --help # Show help" @echo " sudo ./$(VBX_TARGET) --help # Show help"
install: install:
@echo "Installing KeyVibe to $(DESTDIR)$(BINDIR) and $(DESTDIR)$(SHAREDIR)..." @echo "Installing VBX to $(DESTDIR)$(BINDIR) and $(DESTDIR)$(SHAREDIR)..."
install -Dm755 $(KEYVIBE_TARGET) $(DESTDIR)$(BINDIR)/$(KEYVIBE_TARGET) install -Dm755 $(VBX_TARGET) $(DESTDIR)$(BINDIR)/$(VBX_TARGET)
install -Dm755 $(SOUND_TARGET) $(DESTDIR)$(BINDIR)/keyvibe-audio install -Dm755 $(SOUND_TARGET) $(DESTDIR)$(BINDIR)/vbx-audio
install -Dm755 $(KEYBOARD_TARGET) $(DESTDIR)$(BINDIR)/keyvibe-input install -Dm755 $(KEYBOARD_TARGET) $(DESTDIR)$(BINDIR)/vbx-input
install -d $(DESTDIR)$(SHAREDIR) install -d $(DESTDIR)$(SHAREDIR)
cp -r soundpacks $(DESTDIR)$(SHAREDIR)/ cp -r soundpacks $(DESTDIR)$(SHAREDIR)/
@echo "Installing udev rule for non-root keyboard access..." @echo "Installing udev rule for non-root keyboard access..."
@@ -71,10 +70,10 @@ install:
@echo "Installation complete." @echo "Installation complete."
uninstall: uninstall:
@echo "Uninstalling KeyVibe from $(DESTDIR)$(BINDIR) and $(DESTDIR)$(SHAREDIR)..." @echo "Uninstalling VBX from $(DESTDIR)$(BINDIR) and $(DESTDIR)$(SHAREDIR)..."
rm -f $(DESTDIR)$(BINDIR)/$(KEYVIBE_TARGET) rm -f $(DESTDIR)$(BINDIR)/$(VBX_TARGET)
rm -f $(DESTDIR)$(BINDIR)/keyvibe-audio rm -f $(DESTDIR)$(BINDIR)/vbx-audio
rm -f $(DESTDIR)$(BINDIR)/keyvibe-input rm -f $(DESTDIR)$(BINDIR)/vbx-input
rm -rf $(DESTDIR)$(SHAREDIR) rm -rf $(DESTDIR)$(SHAREDIR)
@echo "Removing udev rule..." @echo "Removing udev rule..."
@sudo rm -f $(UDEV_RULE) || true @sudo rm -f $(UDEV_RULE) || true
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_CLI_H #ifndef VBX_CLI_H
#define KEYVIBE_CLI_H #define VBX_CLI_H
typedef struct { typedef struct {
char *sound; char *sound;
@@ -20,6 +20,6 @@ typedef struct {
void print_usage(const char *program_name); void print_usage(const char *program_name);
int parse_cli(int argc, char **argv, CliOptions *out); int parse_cli(int argc, char **argv, CliOptions *out);
#endif // KEYVIBE_CLI_H #endif // VBX_CLI_H
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_PROCESS_H #ifndef VBX_PROCESS_H
#define KEYVIBE_PROCESS_H #define VBX_PROCESS_H
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>
@@ -20,4 +20,4 @@ int start_children(const char *sound_dir, const char *config_path, int volume,
int keyboard_mute, int mouse_mute, int keyboard_enabled, int mouse_enabled); int keyboard_mute, int mouse_mute, int keyboard_enabled, int mouse_enabled);
void handle_sighup(int sig); void handle_sighup(int sig);
#endif // KEYVIBE_PROCESS_H #endif // VBX_PROCESS_H
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_RELOAD_H #ifndef VBX_RELOAD_H
#define KEYVIBE_RELOAD_H #define VBX_RELOAD_H
int handle_reload(const char *user_cfg_path, int handle_reload(const char *user_cfg_path,
char *current_sound_name, char *current_mouse_sound_name, char *current_sound_name, char *current_mouse_sound_name,
@@ -10,6 +10,6 @@ int handle_reload(const char *user_cfg_path,
int current_mouse_volume_arg, int current_keyboard_mute, int current_mouse_volume_arg, int current_keyboard_mute,
int current_mouse_mute, int *current_keyboard_enabled, int *current_mouse_enabled); int current_mouse_mute, int *current_keyboard_enabled, int *current_mouse_enabled);
#endif // KEYVIBE_RELOAD_H #endif // VBX_RELOAD_H
+3 -3
View File
@@ -1,6 +1,6 @@
#ifndef KEYVIBE_WATCH_H #ifndef VBX_WATCH_H
#define KEYVIBE_WATCH_H #define VBX_WATCH_H
int start_config_watcher(const char *path); int start_config_watcher(const char *path);
#endif // KEYVIBE_WATCH_H #endif // VBX_WATCH_H
+3 -3
View File
@@ -1,10 +1,10 @@
#ifndef KEYVIBE_AUDIO_PLAYBACK_H #ifndef VBX_AUDIO_PLAYBACK_H
#define KEYVIBE_AUDIO_PLAYBACK_H #define VBX_AUDIO_PLAYBACK_H
int init_audio(void); int init_audio(void);
int parse_keyboard_event(const char *json_line, int *key_code, int *is_pressed); int parse_keyboard_event(const char *json_line, int *key_code, int *is_pressed);
void play_sound_segment(int key_code, int is_pressed); void play_sound_segment(int key_code, int is_pressed);
#endif // KEYVIBE_AUDIO_PLAYBACK_H #endif // VBX_AUDIO_PLAYBACK_H
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_AUDIO_TYPES_H #ifndef VBX_AUDIO_TYPES_H
#define KEYVIBE_AUDIO_TYPES_H #define VBX_AUDIO_TYPES_H
#include <sndfile.h> #include <sndfile.h>
@@ -42,4 +42,4 @@ extern int g_mouse_mute;
extern int g_keyboard_enabled; extern int g_keyboard_enabled;
extern int g_mouse_enabled; extern int g_mouse_enabled;
#endif // KEYVIBE_AUDIO_TYPES_H #endif // VBX_AUDIO_TYPES_H
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef KEYVIBE_MUTE_H #ifndef VBX_MUTE_H
#define KEYVIBE_MUTE_H #define VBX_MUTE_H
int read_runtime_mute_file(void); int read_runtime_mute_file(void);
void write_runtime_mute_file(int mute); void write_runtime_mute_file(int mute);
void write_runtime_keyboard_mute_file(int mute); void write_runtime_keyboard_mute_file(int mute);
void write_runtime_mouse_mute_file(int mute); void write_runtime_mouse_mute_file(int mute);
#endif // KEYVIBE_MUTE_H #endif // VBX_MUTE_H
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_UTILS_H #ifndef VBX_UTILS_H
#define KEYVIBE_UTILS_H #define VBX_UTILS_H
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
@@ -45,4 +45,4 @@ void *safe_memcpy(void *dest, const void *src, size_t n);
void *safe_memmove(void *dest, const void *src, size_t n); void *safe_memmove(void *dest, const void *src, size_t n);
void *safe_memset(void *s, int c, size_t n); void *safe_memset(void *s, int c, size_t n);
#endif // KEYVIBE_UTILS_H #endif // VBX_UTILS_H
+4 -4
View File
@@ -2,7 +2,7 @@
#define __CONFIG_H__ #define __CONFIG_H__
#define PROJECT_VERSION "1.1.0" #define PROJECT_VERSION "1.1.0"
#define GETTEXT_PACKAGE "keyvibe" #define GETTEXT_PACKAGE "vbx"
#define PKEXEC_PATH "/usr/bin/pkexec" #define PKEXEC_PATH "/usr/bin/pkexec"
// Prefix macro should be defined by compiler flags, fallback to /usr // Prefix macro should be defined by compiler flags, fallback to /usr
@@ -13,8 +13,8 @@
#define PACKAGE_BINDIR PACKAGE_PREFIX "/bin" #define PACKAGE_BINDIR PACKAGE_PREFIX "/bin"
#define PACKAGE_LOCALEDIR PACKAGE_PREFIX "/share/locale" #define PACKAGE_LOCALEDIR PACKAGE_PREFIX "/share/locale"
// KeyVibe specific paths relative to prefix // VBX specific paths relative to prefix
#define KeyVibe_DATA_DIR PACKAGE_PREFIX "/share/keyvibe" #define VBX_DATA_DIR PACKAGE_PREFIX "/share/vbx"
#define KeyVibe_BIN_DIR PACKAGE_PREFIX "/bin" #define VBX_BIN_DIR PACKAGE_PREFIX "/bin"
#endif #endif
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef KEYVIBE_SOUNDPACKS_H #ifndef VBX_SOUNDPACKS_H
#define KEYVIBE_SOUNDPACKS_H #define VBX_SOUNDPACKS_H
#include <stddef.h> #include <stddef.h>
int resolve_keyboard_sound_base_dir(const char *sound_name, char *out_basedir, int resolve_keyboard_sound_base_dir(const char *sound_name, char *out_basedir,
@@ -16,4 +16,4 @@ int validate_keyboard_sound_pack(const char *sound_name);
int validate_mouse_sound_pack(const char *sound_name); int validate_mouse_sound_pack(const char *sound_name);
int list_sound_packs(void); int list_sound_packs(void);
#endif // KEYVIBE_SOUNDPACKS_H #endif // VBX_SOUNDPACKS_H
+5 -5
View File
@@ -1,18 +1,18 @@
#ifndef KEYVIBE_CONFIG_IO_H #ifndef VBX_CONFIG_IO_H
#define KEYVIBE_CONFIG_IO_H #define VBX_CONFIG_IO_H
#include <stddef.h> #include <stddef.h>
// Resolve user config path: returns buffer on success, NULL on failure // Resolve user config path: returns buffer on success, NULL on failure
char *get_user_config_path(char *buffer, size_t buflen); char *get_user_config_path(char *buffer, size_t buflen);
// Write ~/.keyvibe.json in new format // Write ~/.vbx.json in new format
int write_user_config(const char *path, const char *keyboard_sound, int write_user_config(const char *path, const char *keyboard_sound,
const char *mouse_sound, int keyboard_volume, const char *mouse_sound, int keyboard_volume,
int mouse_volume, int keyboard_enabled, int mouse_enabled); int mouse_volume, int keyboard_enabled, int mouse_enabled);
// Read ~/.keyvibe.json supporting new and legacy formats // Read ~/.vbx.json supporting new and legacy formats
int read_user_config(const char *path, char **out_keyboard_sound, int read_user_config(const char *path, char **out_keyboard_sound,
char **out_mouse_sound, int *out_keyboard_volume, char **out_mouse_sound, int *out_keyboard_volume,
int *out_mouse_volume, int *out_keyboard_enabled, int *out_mouse_enabled); int *out_mouse_volume, int *out_keyboard_enabled, int *out_mouse_enabled);
#endif // KEYVIBE_CONFIG_IO_H #endif // VBX_CONFIG_IO_H
+9 -9
View File
@@ -21,7 +21,7 @@ volatile sig_atomic_t reload_requested = 0;
void cleanup_processes(int sig) { void cleanup_processes(int sig) {
(void)sig; (void)sig;
if (!is_daemon) { if (!is_daemon) {
printf("\nShutting down KeyVibe...\n"); printf("\nShutting down VBX...\n");
} }
if (sound_pid > 0) { if (sound_pid > 0) {
kill(sound_pid, SIGTERM); kill(sound_pid, SIGTERM);
@@ -42,7 +42,7 @@ int require_running_pid(pid_t *out_pid) {
pid_t running_pid = 0; pid_t running_pid = 0;
if (!read_pidfile(pidfile_path, &running_pid) || if (!read_pidfile(pidfile_path, &running_pid) ||
!process_is_running(running_pid)) { !process_is_running(running_pid)) {
fprintf(stderr, "KeyVibe: not running.\n"); fprintf(stderr, "VBX: not running.\n");
return 0; return 0;
} }
*out_pid = running_pid; *out_pid = running_pid;
@@ -108,8 +108,8 @@ int start_children(const char *sound_dir, const char *config_path, int volume,
return 0; return 0;
} }
char sound_player_path[MAX_PATH_LENGTH]; char sound_player_path[MAX_PATH_LENGTH];
snprintf(sound_player_path, sizeof(sound_player_path), "%s/keyvibe-audio", snprintf(sound_player_path, sizeof(sound_player_path), "%s/vbx-audio",
KeyVibe_BIN_DIR); VBX_BIN_DIR);
if (sound_pid == 0) { if (sound_pid == 0) {
close(pipefd[1]); close(pipefd[1]);
dup2(pipefd[0], STDIN_FILENO); dup2(pipefd[0], STDIN_FILENO);
@@ -131,11 +131,11 @@ int start_children(const char *sound_dir, const char *config_path, int volume,
int_to_str(keyboard_enabled_str, sizeof(keyboard_enabled_str), keyboard_enabled); int_to_str(keyboard_enabled_str, sizeof(keyboard_enabled_str), keyboard_enabled);
int_to_str(mouse_enabled_str, sizeof(mouse_enabled_str), mouse_enabled); int_to_str(mouse_enabled_str, sizeof(mouse_enabled_str), mouse_enabled);
execl(sound_player_path, "keyvibe-audio", "config.json", volume_str, execl(sound_player_path, "vbx-audio", "config.json", volume_str,
verbose_str, mute_str, mouse_config_path, mouse_volume_str, verbose_str, mute_str, mouse_config_path, mouse_volume_str,
keyboard_mute_str, mouse_mute_str, keyboard_enabled_str, keyboard_mute_str, mouse_mute_str, keyboard_enabled_str,
mouse_enabled_str, (char *)NULL); mouse_enabled_str, (char *)NULL);
perror("execl keyvibe-audio"); perror("execl vbx-audio");
exit(1); exit(1);
} }
keyboard_pid = fork(); keyboard_pid = fork();
@@ -148,13 +148,13 @@ int start_children(const char *sound_dir, const char *config_path, int volume,
} }
char get_key_presses_path[MAX_PATH_LENGTH]; char get_key_presses_path[MAX_PATH_LENGTH];
snprintf(get_key_presses_path, sizeof(get_key_presses_path), snprintf(get_key_presses_path, sizeof(get_key_presses_path),
"%s/keyvibe-input", KeyVibe_BIN_DIR); "%s/vbx-input", VBX_BIN_DIR);
if (keyboard_pid == 0) { if (keyboard_pid == 0) {
close(pipefd[0]); close(pipefd[0]);
dup2(pipefd[1], STDOUT_FILENO); dup2(pipefd[1], STDOUT_FILENO);
close(pipefd[1]); close(pipefd[1]);
execl(get_key_presses_path, "keyvibe-input", (char *)NULL); execl(get_key_presses_path, "vbx-input", (char *)NULL);
perror("execl keyvibe-input"); perror("execl vbx-input");
exit(1); exit(1);
} }
close(pipefd[0]); close(pipefd[0]);
+1 -1
View File
@@ -22,7 +22,7 @@ static int read_runtime_state(const char *filename_suffix, int default_value) {
if (!rd || strlen(rd) == 0) { if (!rd || strlen(rd) == 0) {
rd = "/tmp"; rd = "/tmp";
} }
if (!safe_snprintf(state_file, sizeof(state_file), "%s/keyvibe-%s-%d", rd, if (!safe_snprintf(state_file, sizeof(state_file), "%s/vbx-%s-%d", rd,
filename_suffix, (int)getuid())) { filename_suffix, (int)getuid())) {
return default_value; return default_value;
} }
+2 -2
View File
@@ -30,7 +30,7 @@ static void set_volume(int *volume_ptr, int value) {
} }
void print_usage(const char *program_name) { void print_usage(const char *program_name) {
printf("KeyVibe - Mechanical Keyboard Sound Simulator\n"); printf("VBX - Mechanical Keyboard Sound Simulator\n");
printf("Version: %s\n\n", PROJECT_VERSION); printf("Version: %s\n\n", PROJECT_VERSION);
printf("USAGE:\n"); printf("USAGE:\n");
@@ -79,7 +79,7 @@ void print_usage(const char *program_name) {
printf(" %s --keyboard-volume 80 --mouse-volume 60 # Different volumes\n", printf(" %s --keyboard-volume 80 --mouse-volume 60 # Different volumes\n",
program_name); program_name);
printf("\n"); printf("\n");
printf("CONFIG: Settings are saved to ~/.keyvibe.json and auto-reload in " printf("CONFIG: Settings are saved to ~/.vbx.json and auto-reload in "
"daemon mode.\n"); "daemon mode.\n");
} }
+3 -3
View File
@@ -13,7 +13,7 @@ int read_runtime_mute_file() {
const char *rd = getenv("XDG_RUNTIME_DIR"); const char *rd = getenv("XDG_RUNTIME_DIR");
if (!rd || strlen(rd) == 0) if (!rd || strlen(rd) == 0)
rd = "/tmp"; rd = "/tmp";
if (!safe_snprintf(mute_file, sizeof(mute_file), "%s/keyvibe-mute-%d", rd, if (!safe_snprintf(mute_file, sizeof(mute_file), "%s/vbx-mute-%d", rd,
(int)getuid())) (int)getuid()))
return 0; return 0;
FILE *f = fopen(mute_file, "r"); FILE *f = fopen(mute_file, "r");
@@ -34,7 +34,7 @@ static void write_runtime_state_file(const char *filename_suffix, int value) {
const char *rd = getenv("XDG_RUNTIME_DIR"); const char *rd = getenv("XDG_RUNTIME_DIR");
if (!rd || strlen(rd) == 0) if (!rd || strlen(rd) == 0)
rd = "/tmp"; rd = "/tmp";
if (!safe_snprintf(state_file, sizeof(state_file), "%s/keyvibe-%s-%d", rd, if (!safe_snprintf(state_file, sizeof(state_file), "%s/vbx-%s-%d", rd,
filename_suffix, (int)getuid())) filename_suffix, (int)getuid()))
return; return;
FILE *f = fopen(state_file, "w"); FILE *f = fopen(state_file, "w");
@@ -83,7 +83,7 @@ const char *get_runtime_dir(void) {
void build_pidfile_path(char *buffer, size_t buflen) { void build_pidfile_path(char *buffer, size_t buflen) {
const char *rd = get_runtime_dir(); const char *rd = get_runtime_dir();
safe_snprintf(buffer, buflen, "%s/keyvibe-%d.pid", rd, (int)getuid()); safe_snprintf(buffer, buflen, "%s/vbx-%d.pid", rd, (int)getuid());
} }
int read_pidfile(const char *path, pid_t *out_pid) { int read_pidfile(const char *path, pid_t *out_pid) {
+1 -1
View File
@@ -13,7 +13,7 @@ char *get_user_config_path(char *buffer, size_t buflen) {
const char *home = get_home_dir(); const char *home = get_home_dir();
if (!home) if (!home)
return NULL; return NULL;
if (!safe_snprintf(buffer, buflen, "%s/%s", home, ".keyvibe.json")) if (!safe_snprintf(buffer, buflen, "%s/%s", home, ".vbx.json"))
return NULL; return NULL;
return buffer; return buffer;
} }
+14 -14
View File
@@ -29,12 +29,12 @@
#include <unistd.h> #include <unistd.h>
#define MAX_PATH_LENGTH 1024 #define MAX_PATH_LENGTH 1024
#define AUDIO_BASE_DIR KeyVibe_DATA_DIR "/soundpacks" #define AUDIO_BASE_DIR VBX_DATA_DIR "/soundpacks"
#define KEYBOARD_AUDIO_DIR AUDIO_BASE_DIR "/keyboard" #define KEYBOARD_AUDIO_DIR AUDIO_BASE_DIR "/keyboard"
#define MOUSE_AUDIO_DIR AUDIO_BASE_DIR "/mouse" #define MOUSE_AUDIO_DIR AUDIO_BASE_DIR "/mouse"
#define USER_KEYBOARD_AUDIO_SUBPATH "/.local/share/keyvibe/soundpacks/keyboard" #define USER_KEYBOARD_AUDIO_SUBPATH "/.local/share/vbx/soundpacks/keyboard"
#define USER_MOUSE_AUDIO_SUBPATH "/.local/share/keyvibe/soundpacks/mouse" #define USER_MOUSE_AUDIO_SUBPATH "/.local/share/vbx/soundpacks/mouse"
#define USER_CONFIG_FILENAME ".keyvibe.json" #define USER_CONFIG_FILENAME ".vbx.json"
extern pid_t keyboard_pid; extern pid_t keyboard_pid;
extern pid_t sound_pid; extern pid_t sound_pid;
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
for (int i = 0; i < 30; i++) { for (int i = 0; i < 30; i++) {
if (!process_is_running(running_pid)) { if (!process_is_running(running_pid)) {
unlink(pidfile_path); unlink(pidfile_path);
printf("KeyVibe stopped.\n"); printf("VBX stopped.\n");
if (sound_name_owned) { if (sound_name_owned) {
free(sound_name); free(sound_name);
} }
@@ -177,7 +177,7 @@ int main(int argc, char *argv[]) {
if (mouse_sound_name_owned) { if (mouse_sound_name_owned) {
free(mouse_sound_name); free(mouse_sound_name);
} }
return errorf("KeyVibe: process did not stop in time\n"); return errorf("VBX: process did not stop in time\n");
} }
current_mute = read_runtime_mute_file(); current_mute = read_runtime_mute_file();
@@ -288,9 +288,9 @@ int main(int argc, char *argv[]) {
char get_key_presses_path[MAX_PATH_LENGTH]; char get_key_presses_path[MAX_PATH_LENGTH];
char sound_player_path[MAX_PATH_LENGTH]; char sound_player_path[MAX_PATH_LENGTH];
safe_snprintf_wrapper(get_key_presses_path, sizeof(get_key_presses_path), safe_snprintf_wrapper(get_key_presses_path, sizeof(get_key_presses_path),
"%s/keyvibe-input", KeyVibe_BIN_DIR); "%s/vbx-input", VBX_BIN_DIR);
safe_snprintf_wrapper(sound_player_path, sizeof(sound_player_path), "%s/keyvibe-audio", safe_snprintf_wrapper(sound_player_path, sizeof(sound_player_path), "%s/vbx-audio",
KeyVibe_BIN_DIR); VBX_BIN_DIR);
if (access(get_key_presses_path, X_OK) != 0 || if (access(get_key_presses_path, X_OK) != 0 ||
access(sound_player_path, X_OK) != 0) { access(sound_player_path, X_OK) != 0) {
if (sound_name_owned) { if (sound_name_owned) {
@@ -300,7 +300,7 @@ int main(int argc, char *argv[]) {
free(mouse_sound_name); free(mouse_sound_name);
} }
return errorf("Error: Cannot find or execute required binaries in %s\n", return errorf("Error: Cannot find or execute required binaries in %s\n",
KeyVibe_BIN_DIR); VBX_BIN_DIR);
} }
signal(SIGINT, cleanup_processes); signal(SIGINT, cleanup_processes);
signal(SIGTERM, cleanup_processes); signal(SIGTERM, cleanup_processes);
@@ -314,7 +314,7 @@ int main(int argc, char *argv[]) {
free(mouse_sound_name); free(mouse_sound_name);
} }
safe_fprintf(stderr, safe_fprintf(stderr,
"KeyVibe already running (pid %ld). Use --stop to stop it.\n", "VBX already running (pid %ld). Use --stop to stop it.\n",
(long)existing); (long)existing);
return 1; return 1;
} }
@@ -358,7 +358,7 @@ int main(int argc, char *argv[]) {
safe_strncpy(current_mouse_config_path, mouse_config_path, sizeof(current_mouse_config_path)); safe_strncpy(current_mouse_config_path, mouse_config_path, sizeof(current_mouse_config_path));
safe_strncpy(current_mouse_sound_dir, mouse_sound_dir, sizeof(current_mouse_sound_dir)); safe_strncpy(current_mouse_sound_dir, mouse_sound_dir, sizeof(current_mouse_sound_dir));
if (verbose && !is_daemon) { if (verbose && !is_daemon) {
printf("KeyVibe starting...\n"); printf("VBX starting...\n");
printf("Keyboard sound pack: %s\n", sound_name); printf("Keyboard sound pack: %s\n", sound_name);
printf("Mouse sound pack: %s\n", mouse_sound_name); printf("Mouse sound pack: %s\n", mouse_sound_name);
printf("Keyboard config file: %s\n", config_path); printf("Keyboard config file: %s\n", config_path);
@@ -368,7 +368,7 @@ int main(int argc, char *argv[]) {
printf("Press Ctrl+C to exit.\n\n"); printf("Press Ctrl+C to exit.\n\n");
} else { } else {
if (!is_daemon) { if (!is_daemon) {
printf("KeyVibe started with keyboard sound pack: %s, mouse sound pack: " printf("VBX started with keyboard sound pack: %s, mouse sound pack: "
"%s\n", "%s\n",
sound_name, mouse_sound_name); sound_name, mouse_sound_name);
printf("Press Ctrl+C to exit.\n"); printf("Press Ctrl+C to exit.\n");
@@ -443,7 +443,7 @@ int main(int argc, char *argv[]) {
} }
} }
if (!is_daemon) { if (!is_daemon) {
printf("KeyVibe exited.\n"); printf("VBX exited.\n");
} }
if (sound_name_owned) { if (sound_name_owned) {
free(sound_name); free(sound_name);
+3 -3
View File
@@ -10,11 +10,11 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#define AUDIO_BASE_DIR KeyVibe_DATA_DIR "/soundpacks" #define AUDIO_BASE_DIR VBX_DATA_DIR "/soundpacks"
#define KEYBOARD_AUDIO_DIR AUDIO_BASE_DIR "/keyboard" #define KEYBOARD_AUDIO_DIR AUDIO_BASE_DIR "/keyboard"
#define MOUSE_AUDIO_DIR AUDIO_BASE_DIR "/mouse" #define MOUSE_AUDIO_DIR AUDIO_BASE_DIR "/mouse"
#define USER_KEYBOARD_AUDIO_SUBPATH "/.local/share/keyvibe/soundpacks/keyboard" #define USER_KEYBOARD_AUDIO_SUBPATH "/.local/share/vbx/soundpacks/keyboard"
#define USER_MOUSE_AUDIO_SUBPATH "/.local/share/keyvibe/soundpacks/mouse" #define USER_MOUSE_AUDIO_SUBPATH "/.local/share/vbx/soundpacks/mouse"
static void get_user_keyboard_audio_dir(char *buffer, size_t buflen) { static void get_user_keyboard_audio_dir(char *buffer, size_t buflen) {
buffer[0] = '\0'; buffer[0] = '\0';