如何在每次启动时自动静音?

ænd*_*rük 14 sound default

有时我忘记在关闭笔记本电脑之前启用静音。

在显示登录屏幕之前,我可以将它设置为每次 Ubuntu 启动时默认静音吗?


当我尝试 DoR 的建议时sudo alsactl store,存储的设置在/var/lib/alsa/asound.state下次重新启动时丢失。每次我重新启动时,都有东西使用这个文件来自动保存当前的音量设置。

截屏

hto*_*que 7

我认为这需要两部分:

  1. 要在 GDM 中静音,请输入:

    amixer sset Master 0
    amixer sset Master off
    
    Run Code Online (Sandbox Code Playgroud)

    在文件中/etc/rc.local(确保exit 0是该文件中的最后一行)。这会将主通道上的音量设置为 0 并将其静音。

  2. 要将会话中的声音静音,请将上述内容添加到启动应用程序中:

    System > Preferences > Startup Applications,然后单击添加并创建新的启动项:

    • 姓名: Mute Sound
    • 命令: /bin/bash -c "amixer sset Master 0 ; amixer sset Master off"
    • 评论: Set Master channel volume to 0 and mute it

    单击Add and Close,您应该完成。

如果您在“系统”>“管理”>“登录屏幕”中关闭登录声音(取消选中“播放登录声音”复选框),则可以跳过第一部分。