Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuya-maemichi-synspective/51bc4c8af4d737307c169b721e8d308c to your computer and use it in GitHub Desktop.
Save yuya-maemichi-synspective/51bc4c8af4d737307c169b721e8d308c to your computer and use it in GitHub Desktop.
macOS snippets
xmlstarlet ed --inplace -u '//module/@type' -v 'EMPTY_MODULE'
find ~ \
-path "$HOME/.Trash" -prune -or \
-path "$HOME/Library" -prune -or \
-path '*/node_modules' -prune -or \
-path '*/.idea/*.iml' -type f -print
find ~ \
-path "$HOME/.Trash" -prune -or \
-path "$HOME/Google Drive" -prune -or \
-path "$HOME/Library" -prune -or \
-path '*/node_modules' -prune -or \
-path '*/.idea/*.iml' -type f \
-exec xmlstarlet sel -t -m 'module' -v '@type' -n '{}' \;
cat '/System/Applications/System Settings.app/Contents/Resources/Sidebar.plist' |
xmlstarlet sel -T -t -v '//array/dict/array/string' -n |
awk '{print "x-apple.systempreferences:" $0}'
cat '/System/Applications/System Settings.app/Contents/Resources/Sidebar.plist' |
xpath -p 'x-apple.systempreferences:' -e '//array/dict/array/string/text()' 2>/dev/null
open 'x-apple.systempreferences:com.apple.Displays-Settings.extension?arrangementSection'
x-apple.systempreferences:com.apple.Displays-Settings.extension?arrangementSection
x-apple.systempreferences:com.apple.preferences.softwareupdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment