Created
August 29, 2017 23:57
-
-
Save danman01/3ed44c3449e5480cd776e7998138ede9 to your computer and use it in GitHub Desktop.
atom_teach_resize
This file contains 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 | |
# source into your .bash_profile | |
# call with atom_teach_resize and turn off with atom_teach_resize off | |
function atom_teach_resize() { | |
if [[ ! "$1" = "off" ]] && [[ ! -z "$1" ]]; then | |
echo "arg1: only \"off\" acceptable!" | |
exit | |
elif [[ ! -z "$1" ]]; then | |
COMMENT="//" | |
else | |
COMMENT="" | |
fi | |
# set your atom teaching font size here | |
FONT_SIZE="30px" | |
BASE_DIR=".atom" | |
TEACHING_STYLE="teaching-styles.less" | |
ATOM_STYLE="styles.less" | |
TEACH_STYLE_PATH=${HOME}/${BASE_DIR}/${TEACHING_STYLE} | |
ATOM_STYLE_PATH=${HOME}/${BASE_DIR}/${ATOM_STYLE} | |
cat > ${TEACH_STYLE_PATH}<<EOF | |
${COMMENT}@teaching-font-size: ${FONT_SIZE}; | |
atom-text-editor, html, body, .tree-view, .tab-bar .tab { | |
${COMMENT}font-size: @teaching-font-size; | |
} | |
EOF | |
IMPORT_STRING="@import \"${TEACHING_STYLE}\";" | |
if ! grep -q "${IMPORT_STRING}" "${ATOM_STYLE_PATH}"; then | |
echo "${IMPORT_STRING}" >> ${ATOM_STYLE_PATH} | |
fi | |
cat ${ATOM_STYLE_PATH} > "${ATOM_STYLE_PATH}.tmp" | |
mv "${ATOM_STYLE_PATH}.tmp" ${ATOM_STYLE_PATH} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment