drishya दृश्य
video player

drishya

दृश्य · “sight”

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

रूपं दृश्यं लोचनं दृक् तद्दृश्यं दृक्तु मानसम् ।
दृश्या धीवृत्तयः साक्षी दृगेव न तु दृश्यते ॥

Form is what is seen and the eye the seer; the eye is seen by the mind, and the mind's movements by the witness, who is never seen. Dṛg-Dṛśya-Viveka 1
v0.4.0 latest5 releases7 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                     toggle the player: open it, hide it, or bring it here
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 | layout dock
drishya status [--json]     what's playing
drishya quit                close it for good (what `:q` does)

drishya is a toggle: closed, it opens; open and focused, it hides (and pauses); open but behind other windows or on another workspace, it comes to you, focused. q and Esc hide the window too; :q or drishya quit closes drishya itself, saving where you were.

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

drishya is vim-driven, with Space as the leader, the same grammar as every Vayu tool (and as nāda): a key you use all the time is one key (j/k, p play/pause, H/L tabs, f fullscreen, dd, yy); everything else is Space, then a group, then the thing (Space c a the audio track, Space t h the history). Wait a moment after Space (or g, d, y) and a strip shows what can come next; Esc cancels. Space Space opens a palette of every action, ? or Space ? shows every key of the tab you're on. Counts work like vim: 5j, 3., 2dd; digits are always counts (tabs are H/L, Space t, Ctrl+0..4). In fullscreen (zen) Space still plays and pauses. While typing, Ctrl+j/Ctrl+k move. Confirmations take y only.

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.

Moved in this release (the old key says where, then goes away): Space play/pause is p (fullscreen keeps Space); Up next's paste p/P is gp/gP; i info is Space i; zz is Space g p; a lone 0-4 is H/L or Space t. Q settings is also Space ,.

Everywhere

KeyAction
jMove down (counts work: 5j)
kMove up
g gJump to the top (12gg: to the 12th)
GJump to the bottom (12G: to the 12th)
Ctrl+dScroll half a page down
Ctrl+uScroll half a page up
HSwitch to the previous tab (wraps around)
LSwitch to the next tab (wraps around)
Ctrl+TabSwitch to the next tab (also from the search box)
Ctrl+Shift+TabSwitch to the previous tab (also from the search box)
Ctrl+0Switch to Watch at once (Ctrl+1 Up next, 2 Library, 3 History, 4 Downloads)
pToggle play / pause (in fullscreen, Space too)
EnterPlay the selected video
.Seek forward 10 seconds (3. = 30 s)
,Seek back 10 seconds
>Play the next video
<Play the previous video
=Raise the system volume (back as it was when the window closes)
-Lower the system volume
Ctrl+=Raise the screen brightness (back as it was when the window closes)
Ctrl+-Lower the screen brightness
mToggle mute
fToggle fullscreen (zen: just the video; Esc leaves it too)
tToggle theater mode (the video without the side panel)
TSwitch the player layout (cinema, dock, glass, study)
zSwitch to the mini player (picture-in-picture)
cCycle subtitles (off, then each language)
#Cycle the audio track
[Slow down playback (0.25× steps)
]Speed up playback (0.25× steps)
\Reset playback speed to normal
{Jump to the previous chapter
}Jump to the next chapter
SStart the video over from the beginning
MToggle autoplay (related videos or the next episode after yours)
DSave the playing 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)
QOpen the settings menu (quality, speed, subtitles, audio, download)
rRefresh the lists (Library: reload the folders)
/Open the search panel (YouTube, your videos, history, links, : commands)
oOpen the search panel to paste a link or file path
:Run a command (:seek 1:30, :speed 1.5…)
?Show every key of this tab
qClose the window (pauses; z keeps a mini player)
EscLeave fullscreen, go back, or close the window
iShow where video info moved (Space i; for one release)
0Show where the tab numbers moved (H / L, Space t; for one release)
Space SpaceOpen the palette (every action of this tab, fuzzy)
Space ?Show every key of this tab
Space qClose the window (pauses)
Space t wSwitch to Watch (the video)
Space t uSwitch to Up next (the queue)
Space t lSwitch to your video library
Space t hSwitch to your history (continue watching)
Space t dSwitch to downloads
Space u fToggle fullscreen (zen)
Space u tToggle theater mode
Space u lSwitch the player layout (cinema, dock, glass, study)
Space u mSwitch to the mini player
Space c cCycle subtitles
Space c aCycle the audio track
Space p aToggle autoplay
Space p sStart the video over from the beginning
Space p zToggle the sleep timer (pauses in 30 min)
Space ,Open the settings menu (quality, speed, subtitles, audio, download)
Space y yCopy the playing video's title
Space y lCopy the playing video's link (or file path)
Space f fSearch everything
Space f ySearch YouTube
Space f vSearch your videos
Space f hSearch your history
Space f cSearch the : commands
Space x dSave the video to your disk (download)
Space iShow the video's title and link
Space g pGo to the video that's playing (in Up next)
Space o bOpen the playing video's page in the browser
Space rRefresh the lists (Library: reload the folders)
Space d cClear Up next (asks first; u brings it back)

Watch

KeyAction
hSeek back 5 seconds (3h = 15 s)
lSeek forward 5 seconds
TabSwitch the side panel (up next, chapters, info)
EnterPlay the side panel's video, or jump to its chapter

Up next

KeyAction
d dRemove the video from the queue (2dd: two; u undoes it)
xRemove the video from the queue (like dd; u undoes it)
d GRemove every video from here to the end (u undoes it)
y yCopy the video (yank)
g pPaste removed or copied videos below
g PPaste removed or copied videos above
JMove the video down
KMove the video up
AMove the video to play next
DSave the video to your disk (download)
nJump to the next match (after a search here)
NJump to the previous match
Space d dRemove the video from the queue (u undoes it)

Library

KeyAction
hMove left in the grid
lMove right in the grid
EnterOpen the folder or play the video (the rest of the folder after it)
BackspaceGo up a folder
aAdd to the end of the queue
AAdd to play next
RReload the folders
Space a aAdd to the end of the queue
Space a nAdd to play next

YouTube results

KeyAction
EnterPlay the result
aAdd the result to the end of the queue
AAdd the result to play next
DSave the result to your disk (download)
Space a aAdd the result to the end of the queue
Space a nAdd the result to play next

History

KeyAction
EnterResume the video where you left it
aAdd the video to the end of the queue
AAdd the video to play next
d dForget the video (removes it from the history; asks first)
xForget the video (like dd; asks first)
DSave the video to your disk (download)
nJump to the next match (after a search here)
NJump to the previous match
Space a aAdd the video to the end of the queue
Space a nAdd the video to play next
Space d dForget the video (asks first)

Downloads

KeyAction
EnterPlay the saved video
RRetry a failed download
xCancel a download in progress
d dDelete the saved file (asks first)
Space x rRetry a failed download
Space x cCancel a download in progress
Space d dDelete the saved file (asks first)

Up next, visual mode (V)

KeyAction
dRemove the selected videos (u undoes it)
xRemove the selected videos (like d; u undoes it)
yCopy the selected videos (yank)
VLeave visual mode
EscLeave visual mode

History, visual mode (V)

KeyAction
dForget the selected videos (asks first)
xForget the selected videos (like d; asks first)
aAdd the selected videos to the end of the queue
AAdd the selected videos to play next
VLeave visual mode
EscLeave visual mode

YouTube results, visual mode (V)

KeyAction
aAdd the selected results to the end of the queue
AAdd the selected results to play next
DSave the selected results (download)
VLeave visual mode
EscLeave visual mode

Fullscreen (f)

KeyAction
SpaceToggle play / pause (zen has no leader)

Settings menu (Q, Space ,)

KeyAction
jMove down through the settings menu
kMove up through the settings menu
lOpen the setting or choose it (Enter too)
hGo back in the settings menu (Backspace too)
EscClose the settings menu (Q and q too)

Search panel (/)

KeyAction
TabSwitch where to look (all, YouTube, your videos, history, commands)
Shift+TabSwitch back where to look
Ctrl+jMove down through the results while typing
Ctrl+kMove up 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

Sign in

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

Palette (Space Space)

KeyAction
Ctrl+jMove down through the actions (Down too)
Ctrl+kMove up through the actions (Up too)
EnterRun the action
EscClose the palette

While a key waits

KeyAction
EscCancel a pending key or count (Space, g, d…)

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 · :hideQuit drishya (playback stops; the toggle key starts it again) · hide the window

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