4
Extensions
Storm Dragon edited this page 2025-07-30 15:30:36 -04:00

Extensions

TTYverse supports extensions that add functionality like sound notifications, text-to-speech, and desktop integration. Extensions enhance your fediverse experience with customizable features.

Available Extensions

TTYverse includes four core extensions that enhance functionality:

Sound Pack Extension (soundpack)

  • Purpose: Audio notifications for 11 different event types
  • Notification types: default, mention, dm, me, search, follow, boost, favourite, poll, edit, announcement
  • Sound files: Stored in ~/.local/share/ttyverse/sounds/default/
  • Audio formats: OGG Vorbis recommended, MP3 and WAV supported
  • Configuration: Customizable sound commands and notification categories

Text-to-Speech Extension (tts)

  • Purpose: Speak posts and notifications aloud for accessibility
  • Engines: espeak (recommended), festival, pico2wave, cepstral, macOS say
  • Features: Configurable voice, speed, and language settings
  • Commands: /tts to toggle, /tts help for options

Desktop Notifications Extension (libnotifyperl)

  • Purpose: Visual notification bubbles on Linux/Unix desktops
  • Requirements: libnotify and Gtk2::Notify Perl module
  • Integration: Works with GNOME, KDE, XFCE, and other desktop environments
  • Features: Shows notification bubbles for mentions, DMs, and other events

Timestamp Extension (timestamp)

  • Purpose: Enhanced timestamp display with intelligent time gap detection
  • Features: Shows timestamps when significant time passes between posts
  • Display: Automatic timestamp insertion for better timeline readability

Installing Extensions

Using the Extension Manager

TTYverse includes a management script for easy extension control:

# Show available extensions
./extensions/manage-extensions.sh list

# Enable an extension
./extensions/manage-extensions.sh enable soundpack

# Disable an extension  
./extensions/manage-extensions.sh disable soundpack

# Check extension status
./extensions/manage-extensions.sh status soundpack

Manual Installation

Extensions are stored in the XDG data directory:

~/.local/share/ttyverse/extensions/

Load extensions when starting TTYverse:

./ttyverse.pl -exts=soundpack,tts,libnotifyperl

Configuration

Extension Settings

Configure extensions in your TTYverse RC file (~/.config/ttyverse/ttyverserc):

# Load extensions automatically at startup
exts=soundpack,tts,timestamp,libnotifyperl

# Enable sound notifications
notifytype=soundpack
notifies=boost,favourite,favorite,mention,dm,follow

# Sound pack settings
extpref_sound_command=paplay
extpref_soundpack=default

# Text-to-speech settings
extpref_tts_synthesizer=espeak
extpref_tts_language=en-US
extpref_tts_rate=175

# Notification settings
notificationpause=6             # Notification refresh rate (0=use main pause)

Runtime Configuration

Some settings can be changed while TTYverse is running:

# Toggle text-to-speech
/tts

# Get TTS help
/tts help

Extension Dependencies

Sound Pack Extension

  • Audio system: PulseAudio (paplay), ALSA (aplay), or similar
  • Sound files: OGG Vorbis format recommended
  • Commands: paplay, play (SoX), ogg123, or mpv

Text-to-Speech Extension

  • Synthesizers: espeak (recommended), festival, pico2wave
  • Commercial: Cepstral Swift (Linux), macOS say command
  • Languages: Depends on synthesizer (espeak supports many)

Desktop Notifications Extension

  • Perl module: Gtk2::Notify
  • System: libnotify (libnotify-dev or similar package)
  • Desktop: GUI environment with DISPLAY variable set

Install dependencies on common distributions:

# Debian/Ubuntu
sudo apt install libgtk2-notify-perl espeak pulseaudio-utils

# Fedora/RHEL  
sudo dnf install perl-Gtk2-Notify espeak pulseaudio-utils

# Arch Linux
sudo pacman -S perl-gtk2-notify espeak pulseaudio

Troubleshooting

Extension Loading Issues

# Check if extensions are loading properly
./ttyverse.pl -exts=soundpack -verbose

# Test extension syntax
perl -c ~/.local/share/ttyverse/extensions/soundpack.pl

# Check extension manager status
./extensions/manage-extensions.sh list

Common Problems

Extension not loading

  • Check that the extension file exists in ~/.local/share/ttyverse/extensions/
  • Verify the extension is enabled: ./extensions/manage-extensions.sh status extensionname
  • Look for Perl syntax errors: perl -c extensionname.pl

No sound notifications

  • Test audio system: paplay /usr/share/sounds/alsa/Front_Left.wav
  • Check sound pack configuration in RC file
  • Verify sound files exist in ~/.local/share/ttyverse/sounds/default/

Text-to-speech not working

  • Test synthesizer: espeak "test message"
  • Check TTS configuration: /tts help
  • Install required TTS engine packages

Desktop notifications not appearing

  • Verify GUI environment: echo $DISPLAY
  • Test notification system: notify-send "Test"
  • Install libnotify Perl module

Getting Help

For specific extension issues, check the Troubleshooting guide or examine the extension source code for configuration examples.

Creating Custom Extensions

Want to create your own extensions? See the Extension Development guide for detailed information on:

  • Extension architecture and hooks
  • Available functions and variables
  • Code examples and best practices
  • Testing and distribution

See also: Extension Development | Configuration | Troubleshooting