답변:
NotifyOSD 팀이 알림에 소리를 추가하는 데 시간이 걸리므로 특정 사용 사례에 대해 동일한 결과를 얻을 수있는 스크립트가 있습니다.
(시스템이 절전 모드로 전환 될 때 경고음 만 울립니다. 두려워하는 모든 알림 음이 울리지 않습니다 ...)
다음 스크립트를 복사하여 붙여 넣습니다.
#!/bin/bash
#
# This script plays a sound if the system is going into hibernation/sleep mode
# as an answer to http://askubuntu.com/questions/552999/how-to-warn-noise-bleep-when-ubuntu-is-about-to-go-into-sleep-mode/553026
# Original script name: /etc/pm/sleep.d/sleep-beep
#
# Copyright (c) Fabby 2015
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. See the GNU General Public License for more details.
# You DID NOT receive a copy of the GNU General Public License along with this program as the license is bigger then this program.
# Therefore, see http://www.gnu.org/licenses/ for more details.
case $1 in
suspend|suspend_hybrid|hibernate)
notify-send --urgency=NORMAL --icon=face-tired "Going to sleep"
ogg123 /usr/share/sounds/ubuntu/stereo/desktop-login.ogg
;;
resume|thaw)
# No need to do anything here, but easy to add if needed
;;
esac
으로 gedit
sleep-beep
문서 디렉토리에있는 그대로 저장스크립트를 실행 가능하게 만든 다음 올바른 디렉토리로 복사하십시오.
sudo chmod +x ~/Documents/sleep-beep
sudo cp ~/Documents/sleep-beep /etc/pm/sleep.d/sleep-beep
명령 줄에서 ogg 파일을 재생해야하므로 다음 사항도 필요합니다.
sudo apt-get install vorbis-tools