/tridactyl-tricks

A collection of tips and tricks for maximizing your productivity with Tridactyl

Tridactyl Tricks

Tridactyl is an amazing tool, offering fantastic capabilities for a keyboard driven and predictable workflow in the browser. However there are many wonderful features that offer great customization possibilities which are not usually advertised or have easily available online examples. This repository exists to collect snippets with explanations for such features.

Native Messenger and Exclaim Commands

With the native messenger enabled, tridactyl can communicate directly with the system shell and execute arbitrary commands. This means you can run virtually run any commands using elements from the browser (such as the URL or selection) without breaking flow.

Warning: This might have security risks (such as Remote Code Execution) and before using any of this snippets (or writing new ones along the lines), you should know what you are doing.

Youtube-dl

  • Download the auto generated subtiles of the current YouTube video.
bind yds composite js "\"" + document.location.href + "\"" | exclaim cd $HOME/Downloads/ && youtube-dl --write-auto-sub --skip-download
  • Play the current YouTube link’s audio in the background.
  • Play the current YouTube video in a popup
bind Ypv js tri.native.run(`mpv --ytdl-format="[height <=? 480]" --ontop --geometry=20%x20% '${document.location.href}'`)

(Configure your Window Manager to set up the location of the window.)

Global Actions

Hypothes.is

  • Copy all visible hightlights from the current page. (Caveat: Breaks into multiple lines if a continuous highlight has different HTML syntaxes)
command yankHypothesis js let x = document.getElementsByClassName('hypothesis-highlight'); let t = ""; for (let j =0;j <x.length; j++) {t = t + '\n\n' + x[j].innerHTML}; function h () {return t}; h()

bind yh composite yankHypothesis | yank