Friday, April 17, 2020

Sublime text 3 and Python 3 build on MacOS

By default, Sublime text uses python command to build a python code and MacOS ships with python 2.7. If you want to use python 3 with sublime text build, first install desired Python 3 package.
To build Python 3 on Sublime text go to Tools-> Build System -> New Build System
Paste the following command:
{
    "shell_cmd": "/usr/bin/env python3 ${file}",
    "selector": "source.python",
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "working_dir": "${file_path}"
}
then save as Python3.sublime-build into /Users//Library/Application Support/Sublime Text 3/Packages/User


then open a new file and add the following lines to test python version.
import sys
print (sys.version)
Choose Python 3 build and Ctrl+B


You should see in the bottom of the Sublime text
3.6.3 (v3.6.3:2c5fed86e0, Oct  3 2017, 00:32:08) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
[Finished in 0.4s]

Tuesday, April 14, 2020

Disable Reopening Windows When Logging Back In Mac OS X Completely

File to be Modified:

~/Library/Preferences/ByHost/com.apple.loginwindow.*


- STEPS-


1. Converting The plist Binary File to XML

plutil -convert xml1 ~/Library/Preferences/ByHost/com.apple.loginwindow.*

2. Edit the plist File

Delete Everything Under: TALAppsToRelaunchAtLogin , you should have only <array></array>

3. Converting The plist XML File to Binary

plutil -convert binary1 ~/Library/Preferences/ByHost/com.apple.loginwindow.*

Change The plist File Permission

chflags uchg com.apple.loginwindow.*.plist