Useful Commands/MacOS only: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 3: Line 3:
|-
|-
| Optimize Screen Capture ||
| Optimize Screen Capture ||
<source lang="bash">
<syntaxhighlight lang="bash">
# Save screen capture into ~/Pictures/Screenshots
# Save screen capture into ~/Pictures/Screenshots
defaults write com.apple.screencapture \
defaults write com.apple.screencapture \
Line 14: Line 14:
# Apply
# Apply
killall SystemUIServer
killall SystemUIServer
</source>
</syntaxhighlight>
|-
|-
| Open text file using GitHub Atom<br>(Need to reboot after written) ||
| Open text file using GitHub Atom<br>(Need to reboot after written) ||
<source lang="bash">
<syntaxhighlight lang="bash">
defaults write com.apple.LaunchServices/com.apple.launchservices.secure \
defaults write com.apple.LaunchServices/com.apple.launchservices.secure \
   LSHandlers -array-add \
   LSHandlers -array-add \
   '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.github.atom;}'  
   '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.github.atom;}'  
</source>
</syntaxhighlight>
|-
|-
| Get ID of an application ||
| Get ID of an application ||
<source lang="bash">
<syntaxhighlight lang="bash">
osascript -e 'id of app "Atom"'
osascript -e 'id of app "Atom"'
</source>
</syntaxhighlight>
|-
|-
| Open Finder and select the file ||
| Open Finder and select the file ||
<source lang="bash">
<syntaxhighlight lang="bash">
open -R something.txt
open -R something.txt
</source>
</syntaxhighlight>
|-
|-
| Write NTFS ||
| Write NTFS ||
<source lang="bash">
<syntaxhighlight lang="bash">
df -h
df -h
umount /dev/disk3s1
umount /dev/disk3s1
Line 41: Line 41:
cd /Volumes/WinToGo
cd /Volumes/WinToGo
cp -R ~/Downloads/WindowsSupport/* .
cp -R ~/Downloads/WindowsSupport/* .
</source>
</syntaxhighlight>
|}
|}

Latest revision as of 20:27, 3 April 2025

TODO Command
Optimize Screen Capture
# Save screen capture into ~/Pictures/Screenshots
defaults write com.apple.screencapture \
  location ~/Pictures/Screenshots

# Disable shadow
defaults write com.apple.screencapture \
  disable-shadow -bool true

# Apply
killall SystemUIServer
Open text file using GitHub Atom
(Need to reboot after written)
defaults write com.apple.LaunchServices/com.apple.launchservices.secure \
  LSHandlers -array-add \
  '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.github.atom;}'
Get ID of an application
osascript -e 'id of app "Atom"'
Open Finder and select the file
open -R something.txt
Write NTFS
df -h
umount /dev/disk3s1
sudo mkdir /Volumes/WinToGo
sudo mount -t ntfs -o rw,auto,nobrowse /dev/disk3s1 /Volumes/WinToGo
cd /Volumes/WinToGo
cp -R ~/Downloads/WindowsSupport/* .