Skip to content

Instantly share code, notes, and snippets.

View SmileMachine's full-sized avatar
🏠
Working from home

SmileMachine

🏠
Working from home
View GitHub Profile
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
@SmileMachine
SmileMachine / install-omz.sh
Last active November 21, 2025 21:44
Install Oh My Zsh and some useful plugins on a new machine.
#!/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'