Simple script to access twitch
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Samuel D fc7b0e2996
All checks were successful
Arch Package / build-publish (pull_request) Has been skipped
Arch Package / manual-build-publish (pull_request) Has been skipped
Arch Package / test-build (push) Has been skipped
Arch Package / manual-build-publish (push) Has been skipped
Arch Package / build-publish (push) Successful in 53s
Arch Package / test-build (pull_request) Successful in 58s
docs: Add changelog and simplify package description
2026-08-04 00:51:54 +02:00
.forgejo/workflows ci: Add Arch package building and publishing workflow 2026-08-04 00:39:40 +02:00
.gitignore First Commit 2024-04-21 11:53:42 +02:00
CHANGELOG.md docs: Add changelog and simplify package description 2026-08-04 00:51:54 +02:00
PKGBUILD docs: Add changelog and simplify package description 2026-08-04 00:51:54 +02:00
README.md add readme 2026-08-04 00:45:07 +02:00
simple-twitch-lib.sh fix json escaped character by using printf instead of echo 2025-07-02 18:46:20 +02:00
simple-twitch.conf rename files 2025-01-25 18:18:40 +01:00
simple-twitch.desktop rename files 2025-01-25 18:18:40 +01:00
simple-twitch.service add stream live notification 2025-01-25 21:20:47 +01:00
simple-twitch.sh fix twich sound desync for 4k streams 2025-08-31 18:44:17 +02:00
simple-twitch.timer add stream live notification 2025-01-25 21:20:47 +01:00
twitch-stream-notif.sh add stream live notification 2025-01-25 21:20:47 +01:00

simple-twitch

A lightweight shell script to browse and watch Twitch streams, VODs, and categories directly from your desktop using a dmenu-based interface.

Features

  • 📺 Watch live streams from your followed channels or by searching categories
  • 🎮 Browse by game/category: search and save favourite categories
  • 📼 Watch VODs with resolution selection and automatic resume (saves last watched position)
  • 🔔 Desktop notifications for new live streams via a systemd timer (checks every 5 minutes)
  • 💬 Opens chat in a browser alongside the stream
  • ➕ Manage channels and games: add/remove favourites from the menu

Dependencies

Package Purpose
mpv Stream/VOD playback
yt-dlp Stream URL resolution
curl Twitch API requests
jq JSON parsing
dmenu Interactive menu UI (configurable)
firefox Chat window (configurable)
notify-send Desktop notifications
sed, awk, grep Text processing

Installation

Arch Linux (AUR / PKGBUILD)

makepkg -si

Manual

Copy the files to their appropriate locations:

install -Dm755 simple-twitch.sh /usr/bin/simple-twitch
install -Dm644 simple-twitch-lib.sh /usr/share/simple-twitch/simple-twitch-lib.sh
install -Dm600 simple-twitch.conf /etc/simple-twitch.conf
install -Dm644 simple-twitch.service /usr/lib/systemd/user/simple-twitch.service
install -Dm644 simple-twitch.timer /usr/lib/systemd/user/simple-twitch.timer
install -Dm644 twitch-stream-notif.sh /var/lib/simple-twitch/twitch-stream-notif.sh
install -Dm644 simple-twitch.desktop /usr/share/applications/simple-twitch.desktop

Configuration

Edit /etc/simple-twitch.conf and fill in your Twitch API credentials:

TWITCH_CLIENTID=your_client_id
TWITCH_SECRET=your_client_secret

You can obtain these by registering an application at dev.twitch.tv.

Optional settings

Variable Default Description
MENU_CMD dmenu Menu command to use (e.g. rofi -dmenu)
CHAT_CMD firefox --new-window Command to open Twitch chat
MAX_VID 100 Maximum number of VODs to fetch

Channel & game lists

After installation, two files are used to store your favourites:

  • $XDG_CONFIG_HOME/simple-twitch/listchanneltwitch: one channel name per line
  • $XDG_CONFIG_HOME/simple-twitch/listgamestwitch: saved game/category entries

These can be managed directly from the interactive menu.

Usage

simple-twitch [OPTION] [ARG]
Option Description
(none) Open the interactive dmenu interface
--live [channel] Show live streams from your channel list (or a specific channel)
--game Browse streams by game/category
--vod Browse and watch VODs
--refresh-token Manually refresh the Twitch OAuth token
--help Show usage information

Stream Notifications

Enable the systemd user timer to receive desktop notifications when a channel in your list goes live:

systemctl --user enable --now simple-twitch.timer

The timer runs every 5 minutes and sends a notify-send notification for any newly live channels.