feat: play system bell on volume change

it can be disabled within the colorshell's configuration file, under the `misc` section: misc:play_bell_on_volume_change: (true|false)
This commit is contained in:
retrozinndev
2025-07-18 12:32:30 -03:00
parent 07d30747bf
commit a06fb5f9e7
3 changed files with 28 additions and 9 deletions
+6
View File
@@ -92,6 +92,12 @@ export function deleteFile(path: string): void {
execAsync([ "rm", "-r", path ]);
}
export function playSystemBell(): void {
execAsync("canberra-gtk-play -i bell").catch((e: Error) => {
console.error(`Couldn't play system bell. Stderr: ${e.message}\n${e.stack}`);
});
}
export function isInstalled(commandName: string): boolean {
const proc = Gio.Subprocess.new(["bash", "-c", `command -v ${commandName}`],
Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE);