From: Matthias Gerstner <Matthias.Gerstner@ncp-e.com>
To: Alan Mackenzie <acm@muc.de>
Cc: "gentoo-user@lists.gentoo.org" <gentoo-user@lists.gentoo.org>
Subject: Re: [gentoo-user] Can I suppress the bleep when shutting down?
Date: Tue, 20 Oct 2015 19:22:48 +0200 [thread overview]
Message-ID: <20151020172248.GA32751@mgpc.ncp.de> (raw)
In-Reply-To: <20151020164439.GA6901@acm.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 1752 bytes --]
Hi Alan,
> I simply want to disable that one particular beeping at shutdown time.
well this topic made me curious where the beep is coming from.
It does originate from the shutdown command itself which is part of the
sys-apps/sysvinit package. In this package's source you find can a file
"src/dowall.c", where you will in turn find a function "wall(...)".
This is the function where the warning messages will be produced that
show up in the terminal and the message is produced like this:
snprintf(line, sizeof(line),
"\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n",
user, hostname, tty, date);
The "\007" is the beep you're getting. It's a bell character that you
can produce manually by doing this, too:
echo -e "\007"
Unfortunately the bell character is hard coded into the warning message.
Also there seems to be no way to suppress the warning message.
But you could still try is to disable the interpretation of the bell
character by your terminal. Then you could make an alias or wrapper
around the original shutdown command that does this.
According to Arch Linux docs here:
https://wiki.archlinux.org/index.php/Disable_PC_speaker_beep
You can locally disable the bell in the terminal by calling "setterm
-blength 0". But this doesn't work with my terminals. Says it's
unsupported.
Then you can put this in your ~/.inputrc: "set bell-style none". This
works for me. Then, however, all terminals stop beeping. The pcspkr is
still loaded though and can be used.
As you only want to stop the beep only during shutdown you might also be
able to call "xset -b", disabling the bell on the X-server (globally?).
This is not persistent across reboots and you won't have any beeps until
the machine shuts down.
Regards
Matthias
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-10-20 17:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 16:10 [gentoo-user] Can I suppress the bleep when shutting down? Alan Mackenzie
2015-10-20 16:20 ` Alec Ten Harmsel
2015-10-20 16:27 ` wabenbau
2015-10-20 16:44 ` Alan Mackenzie
2015-10-20 17:22 ` Matthias Gerstner [this message]
2015-10-20 17:57 ` Marc Joliet
2015-10-20 18:48 ` Alan McKinnon
2015-10-20 20:24 ` Marc Joliet
2015-10-20 18:01 ` [gentoo-user] " »Q«
2015-10-20 18:20 ` [gentoo-user] " Alan Mackenzie
2015-10-20 17:22 ` Alan McKinnon
2015-10-20 18:27 ` Alan Mackenzie
2015-10-20 19:03 ` [gentoo-user] " James
2015-10-21 11:58 ` Alan Mackenzie
2015-10-21 9:03 ` [gentoo-user] " Peter Humphrey
2015-10-21 9:55 ` Mick
2015-10-21 10:23 ` Alan Mackenzie
2015-10-21 13:29 ` Neil Bothwick
2015-10-21 13:41 ` Mick
2015-10-21 13:46 ` Mick
2015-10-21 17:10 ` Lee
2015-10-22 14:51 ` João Miguel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151020172248.GA32751@mgpc.ncp.de \
--to=matthias.gerstner@ncp-e.com \
--cc=acm@muc.de \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox