Sound Themer
A sound theming program which can play sounds from a given sound theme folder. Configured using TOML, allows for different themes to have different internal file structures and sound file extensions, as well as have sounds named differently (the mapping between keywords and sound file names is changed in the config). The intended use case is to provide sounds for system notifications, which differ based on the type of notification.
The CLI for this application is written using Clap (Command Line Argument Parser), so each command and subcommand can be followed by help to learn more about it.
Aliases are provided for all commands, meaning they can be shortened.
sound_themer p audio-change ≡ sound_themer play audio-change ≡ sound_themer play audio-volume-change
Usage
| Command | Description |
|---|---|
sound_themer play <SOUND_NAME>sound_themer p <SOUND_NAME>
|
Plays a sound from the theme folder, mapping from sound_name to its associated value for this theme (if one exists). |
sound_themer listsound_themer ls
|
Lists the sound files in the currently selected theme's folder. |
sound_themer --theme <THEME_NAME> <COMMAND>sound_themer -t <THEME_NAME> <COMMAND> |
Overrides the theme which is selected in config.toml |
Config
The configuration is in TOML, and allows for setting a theme_name, along with defining how each theme works.
Inner directories of the theme folder can be provided, along with the extension for sound files in this theme.
Mapping keyword values to their file name counterparts is also configured here, allowing for using the same commands to play sounds from any theme.
If the provided keyword doesn't exist in the mapping, the program will attempt to play a sound from the theme matching the provided keyword with no mapping.
# Name of the selected sound theme
theme_name = "freedesktop"
[[themes]]
# Name of the sound theme folder
name = "freedesktop"
# Extension on the sound files
sound_ext = "oga"
# Directories where the sounds are found
directories = ["stereo"]
# Provide a mapping between certain phrases and their respective sound file name
mapping = {
audio-change = "audio-volume-change",
login = "service-login",
logout = "service-logout",
message = "message",
power-plug = "power-plug",
power-unplug = "power-unplug",
dialog-info = "dialog-information",
dialog-warning = "dialog-warning",
dialog-error = "dialog-error",
screen-capture = "screen-capture",
device-added = "device-added",
device-removed = "device-removed",
camera-shutter = "camera-shutter",
trash-empty = "trash-empty",
complete = "complete"
}