Skip to content

savitojs/Gurbani-Live

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Gurbani Live - Bringing divine music to your terminal ✨

CI (Linux | macOS) GitHub Release GitHub license

🎢 Gurbani Live is a bash script that fetches live Gurbani channels from Sikhnet.com and allows you to play them using VLC. It also provides options to check the online status of channels and stop any ongoing playback.

This project combines the gists I have written together with fzf

⭐️ Like this project?

If you find this project helpful, please consider giving it a ⭐️ on GitHub! It helps others discover the project and motivates me to keep improving it. Thank you!

✨ Features

  • Fetch and display live Gurbani channels from Sikhnet.com
  • Play selected channels using VLC
  • Check the online status of available channels
  • Stop VLC playback directly from the command line
  • Switch channels between online via CLI
  • Favorites System: Mark channels as favorites for quick access
  • Quick Play: Instantly resume your last played channel
  • Interactive Controls: Stop, background, switch, favorite, and refresh options while playing

Prerequisites

The script requires the following tools to be installed:

  • vlc - VLC Media Player for audio playback
  • fzf - Fuzzy finder for interactive selection
  • jq - JSON processor for parsing API responses

Installing Dependencies

macOS (with Homebrew):

brew install vlc fzf jq

Ubuntu/Debian:

sudo apt-get update && sudo apt-get install -y vlc fzf jq

Fedora:

sudo dnf install -y vlc fzf jq

The script will automatically check for these dependencies and attempt to install them if they are missing.

Supported Platforms

  • macOS (via Homebrew)
  • Fedora (via dnf)
  • Ubuntu (via apt-get)

Usage

gurbani-live [options]

demo

Options

  • -h, --help Show the help message and exit

  • -s, --stop Stop the current VLC playback

  • -t, --status Show the online status of available channels without playing them

  • -i, --install Installs the script to writeable $PATH available

  • -u, --update Update the insalled script if version mismatch

  • -v, --version Shows the version of the installed script

  • -q, --quick Quick play the last played channel

Commands

  • completion [bash|zsh] Generate shell completion function

Shell Completion

The script includes built-in shell completion for bash and zsh that provides tab completion for all available options.

Enable Completion

One-time use:

# For bash
source <(gurbani-live completion bash)

# For zsh
source <(gurbani-live completion zsh)

Permanent setup: Add to your shell config file:

# For bash - add to ~/.bashrc
echo 'source <(gurbani-live completion bash)' >> ~/.bashrc

# For zsh - add to ~/.zshrc
echo 'source <(gurbani-live completion zsh)' >> ~/.zshrc

After enabling completion, you can use <TAB> to complete options:

gurbani-live --<TAB>
# Shows: --help --install --quick --status --stop --update --version

Quick Installation

One-line install (Latest stable release):

curl -sL https://github.com/savitojs/Gurbani-Live/releases/latest/download/gurbani-live | bash -s -- --install

Or install development version:

curl -sL https://raw.githubusercontent.com/savitojs/Gurbani-Live/main/gurbani-live | bash -s -- --install

This will:

  • βœ… Download and install the latest version
  • βœ… Interactive mode: Let you choose installation directory
  • βœ… Non-interactive mode: Auto-install to ~/.local/bin or ~/bin (when piped from curl)
  • βœ… Clean up old script names automatically

Note: When using the one-liner method, the script automatically detects it's running non-interactively and will install to a default location (preferring ~/.local/bin, then ~/bin, then the first writable directory in your PATH).

Alternative Installation

If you prefer to download first and then install:

curl -O https://raw.githubusercontent.com/savitojs/gurbani-live/main/gurbani-live
chmod +x gurbani-live
./gurbani-live --install

Examples (once installed)

  • Fetch and Play To fetch and play a channel:

    gurbani-live
  • Stop Playback To stop the current playback:

    gurbani-live --stop
  • Show Status To show the online status of channels:

    gurbani-live --status
  • Quick Play To instantly play your last listened channel:

    gurbani-live --quick

Interactive Features

When playing a channel, you have access to these interactive controls:

  • πŸ›‘ Stop (s) - Stop the current playback
  • πŸ’€ Background (b) - Continue playing in background
  • πŸ”„ Switch (c) - Switch to another channel
  • ⭐ Favorite (f) - Add/remove current channel from favorites
  • πŸ“» Refresh (r) - Refresh the channel list

Favorites

The script includes a built-in favorites system:

  • Mark Favorites: Press f while playing any channel to add/remove it from favorites
  • Visual Indication: Favorite channels are marked with ⭐ in the channel list
  • Persistent Storage: Your favorites are remembered between sessions

Data Storage

The script creates and maintains these files in your home directory:

  • ~/.gurbani_favorites - Stores your favorite channels (one per line)
  • ~/.gurbani_last_played - Remembers your last played channel for quick access

These files are automatically created when needed and can be safely deleted to reset preferences.

Migration from Old Version

If you have the old script named gurbani-fetch-n-play, the update process will automatically:

  • βœ… Migrate to the new name gurbani-live
  • βœ… Remove the old script file
  • βœ… Preserve all functionality

Simply run:

gurbani-fetch-n-play --update

The script will guide you through the migration process.

Development

Documentation

Project Structure

β”œβ”€β”€ docs/               # Documentation
β”‚   └── TESTING.md     # Testing guide
β”œβ”€β”€ test/              # Test scripts
β”‚   β”œβ”€β”€ test-with-act.sh      # GitHub Actions local testing with act
β”œβ”€β”€ .github/           # GitHub workflows
β”‚   └── workflows/
β”‚       └── release.yml       # Release automation
β”œβ”€β”€ gurbani-live       # Main script
└── gurbani-live-completion.sh  # Shell completion

License

This project is licensed under the MIT License.

Credits

Gratitude to Sikhnet for their Gurbani Radio Service

About

Gurbani Live - Bringing divine music to your terminal

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Languages