# Commands config The commands config file decides what options (that will run a certain command on select) to be display in the *video* and *playlist* page respectively, it is located in `~/.config/youtube-tui/commands.yml`. ## Example commands config ```yaml video: - Play video: ${video-player} ${embed-url} - Play audio: ${terminal-emulator} ${video-player} ${embed-url} --no-video - Open in browser: ${browser} ${url} - Download video (webm): ${terminal-emulator} ${youtube-downloader} -o ${download-path} ${embed-url} - 'Mode: ${provider}': '%switch-provider%' playlist: - Switch view: '%switch-view%' - Play all videos: ${video-player} ${all-videos} - Play all audio: ${terminal-emulator} ${video-player} ${all-videos} --no-video - Shuffle play all audio: ${terminal-emulator} ${video-player} ${all-videos} --no-video --shuffle - Open in browser: ${browser} ${url} - Download all video (webm): ${terminal-emulator} ${youtube-downloader} -o ${download-path} ${all-videos} - 'Mode: ${provider}': '%switch-provider%' ``` ## Env variables Notice that a lot of the commands contains the `${label}` pattern, this actually replaces the text with the env variables set in `main.yml`, or is added by the current page (video or playlist) on-the-go. Replacing all these with known values it might look something like this: ```yaml video: - Play video: mpv 'https://youtube.com/embed/dQw4w9WgXcQ' - Play audio: konsole -e mpv 'https://youtube.com/embed/dQw4w9WgXcQ' --no-video - Open in browser: firefox 'https://youtu.be/dQw4w9WgXcQ' - Download video (webm): konsole -e yt-dlp -o '~/Downloads/%(title)s-%(id)s.%(ext)s' 'https://youtube.com/embed/dQw4w9WgXcQ' - 'Mode: ${provider}': '%switch-provider%' playlist: - Switch view: '%switch-view%' - Play all videos: mpv 'https://youtube.com/embed/Z8oiddSsB6I' 'https://youtube.com/embed/yiS0DPekSDQ' 'https://youtube.com/embed/YhM8GYuDFps' # and much more... - Play all audio: konsole -e mpv 'https://youtube.com/embed/Z8oiddSsB6I' 'https://youtube.com/embed/yiS0DPekSDQ' 'https://youtube.com/embed/YhM8GYuDFps' --no-video - Shuffle play all audio: konsole -e mpv 'https://youtube.com/embed/Z8oiddSsB6I' 'https://youtube.com/embed/yiS0DPekSDQ' 'https://youtube.com/embed/YhM8GYuDFps' --no-video --shuffle - Open in browser: firefox 'https://www.youtube.com/playlist?list=PLdgHTasZAjYZlCXN9rTcX9LFOQ-RIrzCs' - Download all video (webm): konsole -e yt-dlp -o '~/Downloads/%(title)s-%(id)s.%(ext)s' 'https://youtube.com/embed/Z8oiddSsB6I' 'https://youtube.com/embed/yiS0DPekSDQ' 'https://youtube.com/embed/YhM8GYuDFps' - 'Mode: ${provider}': '%switch-provider%' ``` ## Item commands (will be replaced by global vim-like commands in the next major version) Notice that there is another pattern in the commands, it is the `%label%` commands. They are special cases that are consumed by the item and is never actually ran as a system command. For instance `%switch-provider%` toggles the provider between `YouTube` and `Invidious`.