Skip to content

Instantly share code, notes, and snippets.

@shikaan
Last active October 8, 2020 19:27
Show Gist options
  • Save shikaan/75e740f854b8c5cc9f583f549d6c4977 to your computer and use it in GitHub Desktop.
Save shikaan/75e740f854b8c5cc9f583f549d6c4977 to your computer and use it in GitHub Desktop.
Randomly remove volume to practice timing
#! /usr/bin/env bash
SLEEP="$1"
while [[ 1 -eq 1 ]]; do
if [[ $(($RANDOM % 2)) -eq 0 ]]; then
echo "Mute"
sudo osascript -e "set volume output muted true"
else
echo "Unmute"
sudo osascript -e "set volume output muted false"
fi
sleep $SLEEP
done
#!/bin/bash
SLEEP="$1"
while [[ 1 -eq 1 ]]; do
amixer -q -D pulse sset Master toggle
if [[ $(($RANDOM % 2)) -eq 0 ]]; then
echo "Toggle!"
fi
sleep $SLEEP
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment