Show me the [qr]code.

QRCode

有时候我需要把一个 URL 链接在手机上打开,当 iCloud 跨设备剪贴板共享并不能满足我的需求的时候,我就会用到它:

# Generate & show qrcode based on current clipboard. qrcode: #!/usr/bin/env bash set -euo pipefail content=$(pbpaste) if [[ -z $content 
  

Time to drink some water…

Drink reminder

这种功能的 app 就有很多了,但是在办公室如果是在手机上发出来的提醒会比较弱,我甚至会觉得是一种干扰,所以索性也移到了 mac 里。

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>willhan.drink.reminder</string> <key>ProgramArguments</key> <array>
  

Knock knock…

Notification

正准备跑一个时间可能很长的命令,然后切换到了其他 tab 或者 app 里去了,我想知道这个命令什么时候完成了才方便我再执行其他操作。

直接调用 macOS 内置的 say 通过语音的方式告诉结果:

# Notify me via TTS when the command is finished. function @() { $@ [[ $? -eq 0 ]]