Option to disable audio bell
This commit is contained in:
parent
d96c7d71a7
commit
f7cb3e3f9e
3 changed files with 10 additions and 5 deletions
|
|
@ -160,6 +160,7 @@ def to_layout_names(raw):
|
|||
'window_border_width': float,
|
||||
'wheel_scroll_multiplier': float,
|
||||
'visual_bell_duration': float,
|
||||
'enable_audio_bell': to_bool,
|
||||
'click_interval': float,
|
||||
'mouse_hide_wait': float,
|
||||
'cursor_blink_interval': float,
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ repaint_delay 10
|
|||
# seconds. Set to zero to disable.
|
||||
visual_bell_duration 0.0
|
||||
|
||||
# Enable/disable the audio bell. Useful in environments that require silence.
|
||||
enable_audio_bell yes
|
||||
|
||||
# The modifier keys to press when clicking with the mouse on URLs to open the URL
|
||||
open_url_modifiers ctrl+shift
|
||||
|
||||
|
|
|
|||
|
|
@ -108,11 +108,12 @@ def write_to_child(self, data):
|
|||
wakeup()
|
||||
|
||||
def bell(self):
|
||||
try:
|
||||
with open('/dev/tty', 'wb') as f:
|
||||
f.write(b'\007')
|
||||
except EnvironmentError:
|
||||
pass # failure to beep is not critical
|
||||
if self.opts.enable_audio_bell:
|
||||
try:
|
||||
with open('/dev/tty', 'wb') as f:
|
||||
f.write(b'\007')
|
||||
except EnvironmentError:
|
||||
pass # failure to beep is not critical
|
||||
if self.opts.visual_bell_duration > 0:
|
||||
self.start_visual_bell_at = monotonic()
|
||||
glfw_post_empty_event()
|
||||
|
|
|
|||
Loading…
Reference in a new issue