Customizing my macOS Terminal

MacOS Terminal is ugly and not very functional. I have one always open, so I decided to make it look better. I used some tips from a Medium post (How To Customize Your macOS Terminal).

Setting the Theme

I’ve been using a theme called Homebrew for the last months, but I wasn’t satisfied with it, so I decided to take a look on the recommended theme “atom-one-dark-terminal“. I imported it and I liked it.

Setting preferences

On the same Terminal Preference Window, set those settings.

Text Tab
* Font: Menlo Regular 12 pt
*Text: Deselect Use Bold Fonts and Allow Blinking Text
*Cursor: Select Vertical Bar and Blink Cursor
Window Tab
*Title: Deselect Active process name, Arguments, Dimensions
Tab Tab
*Title: Deselect Path, Active process name, Arguments, Show activity indicator
Shell Tab
*Startup: Select Run command: and add ‘clear’ to the textbox, select Run inside shell
Keyboard Tab
*Select Use Option as Meta key

It’s almost the same as the Medium post suggested, my only change was the font size. I prefer it with 12pt.

Configuring .bash_profile

My .bash_profile was already set, but I decided to improve it and clean with the Medium suggestions.

# My .bash_profile

source ~/.bash_prompt
source ~/.aliases Code language: PHP (php)

Configuring .bash_prompt

I had to create the .bash_prompt:

touch .bash_promptCode language: CSS (css)

If you want to understand what to what, take a look in the Medium post. It’s well written and explained. I’m showing my complete .bash_prompt:

#!/usr/bin/env bash

# GIT FUNCTIONS
git_branch() {
    git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

# TERMINAL PROMPT
PS1="\[\e[0;93m\]\u\[\e[m\]"    # username
PS1+=" "    # space
PS1+="\[\e[0;95m\]\W\[\e[m\]"    # current directory
PS1+="\[\e[0;92m\]\$(git_branch)\[\e[m\]"    # current branch
PS1+=" "    # space
PS1+=">> "    # end prompt
export PS1;
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacadCode language: PHP (php)

Configuring .aliases

I had to create my .aliases too:

touch .aliasesCode language: CSS (css)

And here’s my file:

# NAVIGATION
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# COMMON DIRECTORIES
alias dl="cd ~/Downloads"
# alias dt="cd ~/Desktop"
alias dc="cd ~/Documents"
# alias p="cd ~/Documents/projects"
# alias home="cd ~"
# GIT
alias g="git"
alias gs="git status"
alias gd="git diff"
alias gb="git branch"
alias gm="git checkout master"
# SHOW/HIDE HIDDEN FILES
#alias showhidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder
#alias hidehidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder
# SHOW/HIDE DESKTOP ICONS
#alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder
#alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder

# CUSTOM CHANGES
alias ll="ls -alh"Code language: PHP (php)

Notice that I copied the Medium post file, but commented many of the lines. I also recreated one of my most used alias on this file (the “ll”).

After that, you just need to reopen Terminal and it’ll be working with the new tweaks.

Sources:

2021 goals: March progress

At the end of January I set my goals for 2021 looking for a more productive year. This is my March progress report.

You can check those progress reports:

  1. 2021 goals: January progress
  2. 2021 goals: February progress

2021 goals

  1. Write down my projects and researches in this blog;
  2. Be able to have a daily conversation in Japanese;
  3. Have all my photos edited. Have some of them at Shutterstock;
  4. Have Home Assistant fully functional at home with some automations concluded;
  5. Have a NAS server running with all our data organized;
  6. Learn to write in Arduino and make some DIY projects;
  7. Do periodical physical exercises;
  8. Meditate;
  9. Read more books.

Overall Review

Many things had stopped this month. I didn’t study Japanese at all, my Yoga activities are on hold and, I didn’t begin to edit my photos and my reading slowed down.

In the opposite direction, I keep writing a lot of drafts for my blog, and I’ve been learning a LOT of SQL, Python, Bash, and how to deal with data.

The decision of halting some activities and focus on others were well though, so I don’t feel sad for the exchange. I believe that this “phase” will last for more 1 or 2 months, and then I’ll be able to resume my goals.

What I could do better in April?

Avoid postponing my Yoga. Yoga is a activity that I must do to avoid pain.

Write down my projects and researches in this blog

Goal for this month: 4 posts
Achieved this month: 4/4 (100%)
Total achieved: 10/49 (20.4%)

Be able to have a daily conversation in Japanese

As I said on my overall review, it’s on halt.

Goal for this month: 6 hours
Achieved this month: 0/24 (0%)
Total achieved: 0/288 (0%)

Have all my photos edited. Have some of them at Shutterstock

This activity is also on halt.

Goal for this month: 0 hours
Achieved this month: 0/0 (%)
Total achieved: 0/344 (0%)

Have Home Assistant fully functional at home with some automations concluded

New devices shall be implemented in the forthcoming months and further modifications will be done. I just don’t tick it as complete because there’s always something else to implement or edit.

Total achieved: 90%

Have a NAS server running with all our data organized

My setup is done and nowadays I have a LOT of cronjobs running every day/hour. I’ll talk about them in other posts.

Total achieved: 100%

Learn to write in Arduino and make some DIY projects

This activity is also on halt, despite my readings of DIY projects sometime.

Goal for this year: 6 project
Total achieved: 0/6 (0%)

Do periodical physical exercises

Goal for this month: 12 days
Achieved this month: 4/12 (33.3%)
Total achieved: 17/120 (14.16%)

Meditate

Goal for this month: 12 days
Achieved this month: 12/12 (100%)
Total achieved: 21/120 (17.5%)

Read more books

I completed the Red Rising Saga. I began reading the 4th book (Iron Gold). I also began reading Data Science from Scratch from Joel Grus and Philosophy 101 from Paul Kleinman.

I’m not sure if I’ll complete any of these books until the end of the month, so I won’t count it now.

Goal for this month: 2 books
Achieved this month: 1/2 (50%)
Total achieved: 7/24 (29.16%)

Bonus activities

  1. Our printer now can send scanned pdf by e-mail or save it on the NAS Server. I also have automated OCRmyPDF to automatically OCR the scanned PDF’s that are saved on the NAS Server.
  2. I also automated Tesseract to scan a folder on the server for image files to OCR it. It’s very convenient for be because I’ve been working with a lot of images that must be typed.
  3. I implemented a script to backup and auto-forward e-mails from a Exchange mail server that we have to work with.
  4. I optimized my script for web scraping WTO and some japanese websites create daily reports if anything changes.
  5. I’ve been working with the web scraping data in SQLite (because it’s easier) and trying to create charts and reports using Metabase and Python.