drishya दृश्य
video player

drishya

दृश्य · “sight”

A keyboard-driven video player for YouTube, your files and any stream, with resume, history and downloads.

v0.2.1 latest3 releases6 decisions recordedMIT license

Watching a YouTube video: the video on the left, its title, channel and views, quality and chapter on the right with what plays next, the controls and keys below

Dṛśya (दृश्य) is Sanskrit for "sight, what is seen". It's the sibling of nāda ("sound"), the music player: same keys, same look.

#Features

The search panel: the top result from YouTube with its thumbnail, more results, and the keys The settings menu over the video: quality, speed, subtitles

The library as a grid: folders and videos with thumbnails and lengths Watch with the Info side panel: the video's link, views, date and description

#Install

#Requirements

# Arch
sudo pacman -S --needed python-gobject gtk4 mpv yt-dlp ffmpeg libsecret ttf-jetbrains-mono-nerd
# Debian / Ubuntu
sudo apt install python3-gi gir1.2-gtk-4.0 libmpv2 yt-dlp ffmpeg libsecret-tools

#drishya

git clone https://github.com/Theyashsawarkar/drishya ~/.local/share/drishya
ln -s ~/.local/share/drishya/bin/drishya ~/.local/bin/drishya
drishya            # opens the player (it starts itself the first time)

For app launchers and to open video files with it:

ln -s ~/.local/share/drishya/data/dev.vayu.Drishya.desktop ~/.local/share/applications/
xdg-mime default dev.vayu.Drishya.desktop video/mp4 video/x-matroska video/webm

Update with git -C ~/.local/share/drishya pull && drishya quit.

To start it with your session (so it opens at once), a user service:

# ~/.config/systemd/user/drishya.service
[Unit]
PartOf=graphical-session.target
After=graphical-session.target
[Service]
ExecStart=%h/.local/bin/drishya daemon
Restart=on-failure
[Install]
WantedBy=graphical-session.target

On a tiling compositor, float the mini player in a corner. sway:

for_window [app_id="^dev\.vayu\.Drishya$" title="^drishya mini$"] floating enable, sticky enable, resize set 480 270, move position 1420 790

#Usage

drishya                     open the player, or close it if it's open
drishya play <what>         play now: a YouTube link, any stream or video link, a file or folder,
                            or search words (plays the top YouTube result)
drishya add [--next] <what> add to Up next instead
drishya show | hide | mini  the window, hidden, the mini player
drishya tab <name>          watch queue library youtube history downloads
drishya ctl <command>       toggle play pause next prev | seek +10 | seek 1:30 | vol 80 | speed 1.5
drishya status [--json]     what's playing
drishya quit                stop it

Tabs: 0 Watch, 1 Up next, 2 Library, 3 History, 4 Downloads; / searches YouTube, your videos and history from any of them. Lists move with j/k; Enter plays. ? shows every key.

#Keys

The footer always shows the keys for where you are; ? shows them all. The same rules everywhere: / searches, Esc goes back or closes, j/k move, h/l go back and in (menus, the grid), Enter does the main thing, Tab switches section; while typing, Ctrl+j/Ctrl+k move. Counts work like vim: 5j, 3.. A tab number followed by a key that takes no count (or a lone 1) goes to that tab first.

Volume and brightness: =/- change the system volume and Ctrl+=/Ctrl+- the screen's brightness (pactl or wpctl, and brightnessctl); when the window closes, both go back to how they were.

Everywhere

KeyAction
/Open the search panel (YouTube, your videos, history, links, : commands)
oOpen the search panel to paste a link or file path
Ctrl+Tab / Ctrl+Shift+TabSwitch to the next / previous tab (wraps around)
Ctrl+0..4Switch to that numbered tab at once (the number shown on it)
0Switch to Watch (the video)
1Switch to Up next (the queue)
2Switch to your video library (a grid)
3Switch to your history (continue watching)
4Switch to downloads
j / kMove down / up (counts work: 5j)
gg / GJump to the top / bottom (12G: to the 12th)
Ctrl+d / Ctrl+uScroll half a page down / up
SpaceToggle play / pause
EnterPlay the selected video
. / ,Seek forward / back 10 seconds (3. = 30 s)
> / <Play the next / previous video
= / -Raise / lower the system volume (back as it was when the window closes)
Ctrl+= / Ctrl+-Raise / lower the screen brightness (back as it was when the window closes)
mToggle mute
fToggle fullscreen (zen: just the video; Esc leaves it too)
tToggle theater mode (the video without the side panel)
zSwitch to the mini player (picture-in-picture)
QOpen the settings menu (quality, speed, subtitles, audio, download)
cCycle subtitles (off, then each language)
#Cycle the audio track
[ / ]Slow down / speed up playback (0.25× steps)
\Reset playback speed to normal
{ / }Jump to the previous / next chapter
SStart the video over from the beginning
MToggle autoplay (related videos or the next episode after yours)
DSave the video to your disk with subtitles (download)
VSelect several videos (visual mode)
uRestore the last queue change (undo)
Ctrl+rRestore an undone queue change (redo)
:Run a command (:seek 1:30, :speed 1.5…)
iShow the video's title and link (in fullscreen, briefly in the corner)
?Show all keys
q / EscClose the window (pauses; z keeps a mini player)

On Watch (0)

KeyAction
h / lSeek back / forward 5 seconds (3l = 15 s)
TabSwitch the side panel (up next, chapters, info)
j / kMove through the side panel's list (Enter plays it or jumps to the chapter)

On Up next (1)

KeyAction
ddRemove the video from the queue (V: the selection)
yyCopy the video (yank)
p / PPaste removed or copied videos below / above
J / KMove the video down / up
AMove the video to play next
zzJump to the video that's playing

In the library (2)

KeyAction
h / j / k / lMove through the grid
EnterOpen the folder or play the video (the rest of the folder after it)
BackspaceGo up a folder
a / AAdd to the end of the queue / to play next
RReload the folders

In YouTube results (from /)

KeyAction
a / AAdd the result to the end of the queue / to play next

In the history (3)

KeyAction
ddForget the video (removes it from the history)

In downloads (4)

KeyAction
RRetry a failed download
xCancel a download in progress
ddDelete the saved file (asks first)

In the search panel (/)

KeyAction
Tab / Shift+TabSwitch where to look (all, YouTube, your videos, history, commands)
Ctrl+j / Ctrl+kMove through the results while typing
EnterPlay the result (a command: run it)
Ctrl+EnterPlay the result next
Shift+EnterAdd the result to Up next
Ctrl+dDownload the result
Ctrl+uClear the search box
Ctrl+xClear recent searches
EscClose the search panel

In the settings menu (Q)

KeyAction
j / kMove through the settings menu
l / EnterOpen the setting or choose it
h / BackspaceGo back in the settings menu
EscClose the settings menu

In the sign-in panel

KeyAction
EnterSign in and play (from the password field)
TabMove between the username and password fields
Ctrl+bSign in with your browser's login instead (sites yt-dlp plays)
Ctrl+sToggle remembering the login in your keyring
EscCancel signing in

In the mini player (z)

KeyAction
SpaceToggle play / pause
. / ,Seek forward / back 10 seconds
> / <Play the next / previous video
= / -Raise / lower the system volume
Ctrl+= / Ctrl+-Raise / lower the screen brightness
z / EnterSwitch back to the full player
q / EscClose the mini player (pauses)

#Commands

: opens the command line:

CommandWhat it does
:open <link, file or folder>Play it now (o opens this)
:add <…>Add to Up next
:yt <search>Search YouTube
:seek 1:30 · :seek +30Jump to a time, or by an amount
:speed 1.5Playback speed
:vol 80 · :vol +10Volume
:sub en · :sub offPick subtitles by language
:quality 720Play at up to 720p, from now on (Q picks from a list)
:sleep 30m · :sleep offPause after a while
:shotSave a screenshot to ~/Pictures
:logout [server]Forget the login for a server (and remove it from your keyring)
:autoplay on · offSame as M
:dlDownload what's playing
:clearEmpty Up next (u brings it back)
:q · :qaHide the window · quit

Press o, paste a link and Enter (or paste it into the YouTube search box, or run drishya play <link>). drishya plays:

When the server answers that it needs a login (HTTP 401 or 403), a sign-in panel opens: your username and password, sent as HTTP authentication with every request, including each segment of a stream. Tick Remember in my keyring (Ctrl+s) to keep it in your keyring (through libsecret), else it's kept only until drishya quits. A site that needs an account offers your browser's login instead (Ctrl+b: yt-dlp reads its cookies). A link with the login in it (https://user:password@host/…) works too: the login is taken out of the link, so it never reaches the history or the queue file.

The sign-in panel over the player: Sign in to the server, why, username and password fields, Remember in my keyring, and the keys

#Configuration

~/.config/drishya/config.toml, everything optional:

[drishya]
quality = 1080           # highest resolution to stream or download
autoplay = true          # more after your videos: related ones, or the next episode
resume = true            # start where you stopped
seek_step = 10           # seconds for , and .
fine_step = 5            # seconds for h and l on the Watch tab
volume_step = 5
subtitles = "en"         # your subtitle languages, e.g. "en,hi"
video_dirs = ["~/Videos"]
download_dir = "~/Videos/YouTube"
hwdec = "auto-copy-safe" # mpv's hardware decoding; "no" to turn it off
pause_on_hide = true     # q pauses (z keeps a mini player going)
# opacity = 0.62         # the window's glass (unset: your theme's)

Styles: ~/.config/drishya/style.css is loaded after drishya's own. State: ~/.local/state/drishya (history, queue, settings, downloads); thumbnails: ~/.cache/drishya.

#How it works

#Troubleshooting

#Contributing

Bug reports, ideas and pull requests are welcome: see CONTRIBUTING.md, and CHANGELOG.md for what changed in each release.

drishya comes from Vayu, a keyboard-driven Wayland desktop, and works on any Linux desktop on its own.

#License

MIT