Specify what you want urlview to open your links with in ~/.urlview after COMMAND. I.e. the line below will make urlview open all urls in Firefox.
COMMAND firefox
| function run() { | |
| // Rob Trew 2015 | |
| // Ver 0.01 | |
| // UI day/night toggling through OS X 10.10 JXA Javascript for Automation | |
| // SWITCH FROM DAY-TIME DARK MENU BAR AND DOCK WITH DARK BACKGROUND | |
| // TO NIGHT-TIME *ALL DARK* | |
| // (TOGGLE MODE AND BACKGROUND TO BRIGHT, THEN INVERT ALL) |
| # An lf command in my ~/.bash_profile | |
| # like a simple ls, but selects the glob-matched files in the Finder | |
| # `lf *.txt` to Finder-select all *.txt files in the working directory | |
| # `lf *.[^t]?? to Finder-select all files with a 3-char extension which doesn't start with t | |
| lf() { | |
| local IFS=":"; local f=$@; local seln=""; fldr="$(pwd)" | |
| for l in ${f[@]}; do | |
| if [[ ! -d $l ]]; then | |
| seln=$seln"file \"$l\", " | |
| fi |
| // YOSEMITE Javascript for Applications JXA | |
| // Capture the main result links from a Google search page as Markdown | |
| // ( Using XPath to search for <a> elements which are children | |
| // of elements with class 'r' | |
| var resultLinksMD = function () { | |
| var r = document.evaluate( | |
| "//*[@class='r']/a", | |
| document, null, 0, null | |
| ), |
| set strJS to " | |
| var xpathResults = document.evaluate('//*[@class=\\'r\\']/a', document, null, 0, null), | |
| lst = [], | |
| oNode; | |
| while (oNode = xpathResults.iterateNext()) { | |
| lst.push([ | |
| '[', | |
| oNode.text, | |
| '](', |
| (function () { | |
| 'use strict'; | |
| // OSX JavaScript for Applications lacks the persistent 'properties' | |
| // of AppleScript (in which global variables and properties persist between script runs) | |
| // but we can, of course, serialise to JSON or plist at the end of a script | |
| // parsing it at the start of the next run. | |
| // Here is one approach to persistence between script runs | |
| // using JSON.stringify() and JSON.parse() |
| async function nextFrame() { | |
| return new Promise((resolve) => { | |
| requestAnimationFrame(resolve) | |
| }) | |
| } | |
| async function randomDelay(min, max) { | |
| const delay = Math.random() * (max - min) + min; | |
| const startTime = performance.now() | |
| while (performance.now() - startTime < delay) { |
| // Helper function to convert node lists returned by querySelectorAll to an array | |
| // so that we can used methods like map and filter. | |
| function toArray(nodeList) { | |
| let array = [] | |
| nodeList.forEach(node => array.push(node)) | |
| return array | |
| } | |
| // Returns a text (like markdown) representation of a trello board. | |
| function trelloBoardAsText() { |
| /* | |
| Requirements: | |
| * iTerm | |
| * nvim | |
| * nvr | |
| Install: | |
| 1. New application in Automator | |
| 2. Add Run JavaScript action |
| # Modified from https://github.com/alyssais configuration. | |
| # | |
| # The following configuration heavily leverages modal keymaps to minimize the | |
| # pollution of global keybindings. In addition, the modal keymaps facilitate | |
| # the consistent use of the same keybindings across different modes. For | |
| # example, this configuration uses 'h', 'l', 'j', and 'k' to represent west, | |
| # east, south, and north when: changing focus, warping windows, resizing | |
| # windows, swapping windows, and moving floating windows. Those four keys are | |
| # mapped differently depending on the current mode to provide a consistent user | |
| # experience. |