This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plistlib # 读取 plist 文件 | |
| import subprocess # 执行命令 | |
| def get_default_opener(ext): | |
| # 获取当前的打开方式 | |
| result = subprocess.run(['duti', '-x', ext], capture_output=True, text=True) | |
| if result.returncode != 0: | |
| print(result.stderr) | |
| return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # !!! This script is used specially for first install of omz on a new machine | |
| # !!! All configurations in .zshrc will be replaced !!! (A backup file will be created) | |
| set -euo pipefail | |
| # Terminal colors | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' |