<commit_before>#!/bin/sh
# file: warn-battery.sh
# Script to sound a warning when the battery becomes low. To be run from cron.
# Requires the audio/mpg123 package.
#
# vim:fileencoding=utf-8:fdm=marker:ft=sh
#
# Copyright © 2020 <NAME> <<EMAIL>>
# Created: 2020-07-12T13:53:59+0200
# Last modified: 2020-07-12T13:58:33+0200


# Get the battery percentage
BAT=`sysctl -n hw.acpi.battery.life`
# Get current sound volume
VOL=`mixer vol | sed -e 's/^.*://'`
if [ $BAT -le 10 ]; then
    # Set sound level and play sound
    mixer vol 50
    out123 --wave-freq 400 --wave-sweep 800 --sweep-count 5 --wave-pat square
    # Restore sound volume.
    mixer vol $VOL
fi<commit_msg>Discard mixer output.<commit_after>#!/bin/sh
# file: warn-battery.sh
# Script to sound a warning when the battery becomes low. To be run from cron.
# Requires the audio/mpg123 package.
#
# vim:fileencoding=utf-8:fdm=marker:ft=sh
#
# Copyright © 2020 <NAME> <<EMAIL>>
# Created: 2020-07-12T13:53:59+0200
# Last modified: 2020-07-12T14:19:02+0200


# Get the battery percentage
BAT=`sysctl -n hw.acpi.battery.life`
# Get current sound volume
VOL=`mixer vol | sed -e 's/^.*://'`
if [ $BAT -le 10 ]; then
    # Set sound level and play sound
    mixer vol 50 >/dev/null
    out123 --wave-freq 400 --wave-sweep 800 --sweep-count 5 --wave-pat square
    # Restore sound volume.
    mixer vol $VOL >/dev/null
fi
{'fraction_non_alphanumeric': 0.14005805515239478, 'fraction_numerical': 0.0841799709724238, 'mean_word_length': 3.3917197452229297, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3776932', 'n_tokens_mistral': 599, 'n_tokens_neox': 499, 'n_words': 161}