<commit_before>#!/bin/sh
#A script to increase, decrease or toggle the pulseaudio volume.

usage() {
  echo "Usage:
  volume-change.sh [OPTIONS]

Options:
  up: increase the volume by 5%
  down: decrease the volume by 5%
  toggle: mute/unmute the volume"
}

sink=$(pactl list sinks short | cut -f 1)
volume=$(amixer | grep "Front Left: Playback" | cut -d "[" -f 2 | cut -d "%" -f 1)

if [ "$1" == "toggle" ]; then
  pactl set-sink-mute "$sink" toggle
elif [ "$1" == "up" ]; then
  if [ "$volume" -lt 100 ]; then
    pactl set-sink-mute "$sink" false
    pactl set-sink-volume "$sink" +5%
  fi
elif [ "$1" == "down" ]; then
  if [ "$volume" -gt 0 ]; then
    pactl set-sink-mute "$sink" false 
    pactl set-sink-volume "$sink" -5%
  fi
else
  usage
fi

unset sink volume<commit_msg>volume-change.sh - for getting the sink, replace pactl output parsing with @DEFAULT_SINK@<commit_after>#!/bin/sh
#A script to increase, decrease or toggle the pulseaudio volume.

usage() {
  echo "Usage:
  volume-change.sh [OPTIONS]

Options:
  up: increase the volume by 5%
  down: decrease the volume by 5%
  toggle: mute/unmute the volume"
}

volume=$(amixer | grep "Front Left: Playback" | cut -d "[" -f 2 | cut -d "%" -f 1)

if [ "$1" == "toggle" ]; then
  pactl set-sink-mute @DEFAULT_SINK@ toggle
elif [ "$1" == "up" ]; then
  if [ "$volume" -lt 100 ]; then
    pactl set-sink-mute @DEFAULT_SINK@ false
    pactl set-sink-volume @DEFAULT_SINK@ +5%
  fi
elif [ "$1" == "down" ]; then
  if [ "$volume" -gt 0 ]; then
    pactl set-sink-mute @DEFAULT_SINK@ false 
    pactl set-sink-volume @DEFAULT_SINK@ -5%
  fi
else
  usage
fi

unset volume
{'fraction_non_alphanumeric': 0.15294840294840295, 'fraction_numerical': 0.016584766584766583, 'mean_word_length': 3.2093023255813953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5584564', 'n_tokens_mistral': 654, 'n_tokens_neox': 627, 'n_words': 207}