如何让航站楼铃声不那么响(更安静)?

如何让航站楼铃声不那么响(更安静)?

我使用 Debian 和 Mate,也经常使用 vim。关于如何禁用响亮的蜂鸣声有很多答案,它在 mate-terminal 设置中被称为“终端铃声”,但实际上声音警报在 vim 中有一些很好的用处。我的典型工作流程是在无声音乐下工作,我需要警报更安静。听起来像滴水声,而不是系统蜂鸣声。

可能的解决方案的示例:如果我找出声音文件的位置,我想使用音频编辑器对其进行编辑。

答案1

您似乎是 Unix & Linux StackExchange 新手。欢迎!

现在,我的 MATE 桌面(我将其用作 Ubuntu 的桌面管理器)位于虚拟机中,没有启用声音,但我可以给您一些想法,我认为这些想法可以帮助您实现所需目标。

快速说明一下,如果我没记错的话,VIM 有自己的内部声音内容。如果我提到的东西都不起作用,请查找一些有关 VIM 声音的东西。一些可以开始的地方 - 不是解决方案,而是开始的地方 - 是A,, 和C

如果链接失效:(存档A, 搜索“echoerr”;存档B,搜索“errorbells”;存档C,搜索“beep”,它应该在“visualbell”下)

寻找想法

我的第一步是查看设置以查找可能有帮助的内容。

不需要官方,但我运行了我的设置的备份:gsettings list-recursively > ~/.gsettings_list-recursively.$(date +'%s').bak

现在,进行设置。

bballdave025@DWBMACHINE:~$ gsettings list-recursively | \
  grep "bell\|pitch\|freq\|duration\|audible\|volume" | \
  grep mate | grep -v plugins
org.mate.engrampa.dialogs.batch-add volume-size 0
org.mate.peripherals-keyboard bell-pitch 400
org.mate.peripherals-keyboard bell-custom-file ''
org.mate.peripherals-keyboard bell-mode 'on'
org.mate.peripherals-keyboard click-volume 0
org.mate.peripherals-keyboard bell-duration 100
org.mate.caja.desktop volumes-visible true
org.mate.Marco.general audible-bell true
org.mate.Marco.general visual-bell-type 'fullscreen'
org.mate.Marco.general visual-bell false
bballdave025@DWBMACHINE:~$

尝试的想法 1

已经在那里,您可以尝试如下操作。

gsettings set org.mate.peripherals-keyboard bell-custom-file \ 
  "/path/to/quieter/file"

(注:我很快就尝试了上面的方法 - Idea To Try 1 - 但我无法让它发挥作用。)

尝试的想法 2

不过,你可以尝试一下音量。这是手册页中的一些内容xset(一种改变你的X窗口系统首选项/配置)。

bballdave025@DWBMACHINE:~$ man xset | grep -B1 -A16 "^OPTIONS"

OPTIONS
       -display display
               This option specifies the server to use; see X(7).

       b       The b option controls bell volume, pitch  and  duration.   This
               option  accepts  up  to three numerical parameters, a preceding
               dash(-), or a 'on/off' flag.  If no parameters  are  given,  or
               the  'on'  flag  is used, the system defaults will be used.  If
               the dash or 'off' are given, the bell will be turned  off.   If
               only  one numerical parameter is given, the bell volume will be
               set to that value, as a percentage of its  maximum.   Likewise,
               the  second  numerical  parameter  specifies the bell pitch, in
               hertz, and the third numerical parameter specifies the duration
               in  milliseconds.  Note that not all hardware can vary the bell
               characteristics.  The X server will set the characteristics  of
               the bell as closely as it can to the user's specifications.

bballdave025@DWBMACHINE4UB20KDX:~$

让我们备份原始设置(某种),就好像您使用了参数 50 400 100

xset q b > ~/.xset_q_b.$(date +'%s').bak

然而,如果我没记错的话,来自 的铃声xset指的是[旧桌面的]内部铃声。我似乎记得运行类似的东西

xset b 10 400 1000 

但即使在注销和重置后也没有任何变化。

我想这就是为什么他们有

Note that not all hardware can vary the bell characteristics

(注:我很快就尝试了上面的方法 - Idea To Try 2 - 但我无法让它发挥作用。)

尝试的想法 3

在我的设置中,“终端铃声”似乎指向一个文件。我将使用一些命令找到该文件。

bballdave025@DWBMACHINE:~$ gsettings list-recursively | grep -i theme | grep -i sound
org.gnome.desktop.sound theme-name 'Yaru'
org.mate.sound theme-name 'Yaru'
org.gnome.evolution.plugin.mail-notification notify-sound-use-theme true
bballdave025@DWBMACHINE:~$ 
bballdave025@DWBMACHINE:~$ #  Oh, yeah, I should have done another
bballdave025@DWBMACHINE:~$ #+ `grep mate`, but this might help
bballdave025@DWBMACHINE:~$ #+ others with different desktop managers

是时候找到响铃文件了。

bballdave025@DWBMACHINE:~$ find /usr/share -type f -iname "*bell*" | grep Yaru
/usr/share/sounds/Yaru/stereo/bell.oga
bballdave025@DWBMACHINE:~$

在这里要做一件快速而肮脏的事情(我不建议这样做!) 将会

sudo mv /usr/share/sounds/Yaru/stereo/bell.oga \
  /usr/share/sounds/Yaru/stereo/bell.oga.disabled
sudo cp /path/to/your/nicer/file.ogg /usr/share/sounds/Yaru/stereo/bell.oga

但我认为你最好跟随制作新配置文件的说明来自 EOS StackEchange 的@elmato(我确实建议这个!)。简要地。

sudo mkdir -p /usr/share/sounds/mytheme/stereo
sudo touch /usr/share/sounds/mytheme/index.theme

获取您的声音文件,或制作一个。我会做一些事情sox

# get into your home directory, then install sox
cd
sudo apt-get install -y sox

# 1.5 seconds of an A3 plucked on a guitar at 0.1 of max volume
sox -n bell.ogg synth 1.5 pluck A3 vol 0.1

# write the `index.theme` file
sudo nano /usr/share/sounds/myprofile/index.theme

您的文件最终应该看起来像cat下面的命令中看到的那样。

$ cat /usr/share/sounds/myprofile/index.theme 
[Sound Theme]
Name=myprofile
Directories=stereo

[stereo]
OutputProfile=stereo
$ 

现在复制您想要的文件。我将使用 my ,但请注意文件扩展名从到 的bell.ogg更改。我在我的主目录中,这是我创建吉他拨弦文件的地方。然后,我将运行命令来更改我的设置以获得新的声音配置文件。 (请注意,除此之外的任何内容都会恢复为默认值。).ogg.ogabell.oga

sudo cp bell.ogg /usr/share/sounds/mytheme/stereo/bell.oga

gsettings set org.mate.sound theme-name mytheme

如果您想恢复为默认值,只需使用

gsettings reset org.mate.sound theme-name

(注:我很快就尝试了上面的方法 - Idea To Try 3 - 并且效果非常好。)

尝试整个默认主题的事情。如果不起作用,请尝试gsettings set org.mate.peripherals-keyboard bell-custom-file "/path/to/quieter/file".让我知道是否有效。

编辑:我在虚拟机上启用了声音,并且能够得到尝试的想法 3上班。当我在终端中退格太多次时,我听到了吉他弹拨的声音。当我做了一些vim不喜欢的事情时,我也会听到吉他弹拨的声音。

通过快速且绝对不全面的测试,两者都没有尝试的想法 1也不尝试的想法 2给了我想要的结果。

相关内容