diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 76de2a312..e99fe29ce 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -2441,13 +2441,15 @@ pub fn setSecureInput(self: *Surface, value: apprt.action.SecureInput) void { } pub fn ringBell(self: *Surface) !void { + const features = self.app.config.@"bell-features"; const window = self.container.window() orelse { log.warn("failed to ring bell: surface is not attached to any window", .{}); return; }; // System beep - if (window.window.as(gtk.Native).getSurface()) |surface| { + if (features.system) system: { + const surface = window.window.as(gtk.Native).getSurface() orelse break :system; surface.beep(); } diff --git a/src/config/Config.zig b/src/config/Config.zig index 9cd285d3b..7997b9200 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -1848,6 +1848,22 @@ keybind: Keybinds = .{}, /// open terminals. @"custom-shader-animation": CustomShaderAnimation = .true, +/// The list of enabled features that are activated after encountering +/// a bell character. +/// +/// Valid values are: +/// +/// * `system` (default) +/// +/// Instructs the system to notify the user using built-in system functions. +/// This could result in an audiovisual effect, a notification, or something +/// else entirely. Changing these effects require altering system settings: +/// for instance under the "Sound > Alert Sound" setting in GNOME, +/// or the "Accessibility > System Bell" settings in KDE Plasma. +/// +/// Currently only implemented on Linux. +@"bell-features": BellFeatures = .{}, + /// Control the in-app notifications that Ghostty shows. /// /// On Linux (GTK), in-app notifications show up as toasts. Toasts appear @@ -5669,6 +5685,11 @@ pub const AppNotifications = packed struct { @"clipboard-copy": bool = true, }; +/// See bell-features +pub const BellFeatures = packed struct { + system: bool = false, +}; + /// See mouse-shift-capture pub const MouseShiftCapture = enum { false,