In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
Select Basic. Select Long-Running Daemon
Give the script a decent name (I chose auto_dark_mode.py
)
Save and open the script in your editor of choice.
fig, ax = plt.subplots() | |
x = [] | |
y = [] | |
plt.plot() | |
plt.xlabel() | |
plt.ylabel() | |
ax.legend(loc='best') |
The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.
Vist iTerm 2 homepage to download the beta. Thanks @stefanwascoding.
switch_automatic.py
to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch
with:# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
# Make sure you have a recent version: the code points that Powerline |
#### | |
#### pyenv-virtualenv bash prompt customization | |
#### | |
# pyenv | |
eval "$(pyenv init -)" | |
# pyenv-virtualenv: |
def ShowSolutions(n, id): | |
nqReduced = 4 | |
nqM = 100 | |
for i in range(n): | |
plotname = pathPrefix+foldername + 'plot-id'+str(i+1)+'.pdf' | |
fig, ax = plt.subplots() | |
plt.xlabel('q') | |
plt.ylabel(f'λi') | |
ax.text(0.15, 0.75, f'$\lambda_{i+1}$ | N={n}', horizontalalignment='center', | |
verticalalignment='center', transform=ax.transAxes) |
# .bashrc | |
# User specific aliases and functions | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
# custom commands | |
alias ls='ls --color=auto' |
# general imports | |
from flask_socketio import SocketIO | |
from flask_socketio import emit | |
from flask import Flask, render_template | |
from random import random | |
import time | |
from threading import Thread, Event | |
from threading import Lock | |
This guide will show how to run Wolfram Mathematica scripts right from the command-line, without using the Frontend.
Technically, a Mathematica script can be executed from the command line using the Mathematica Kernel.
After installation of the Wolfram Mathematica application, default location of that executable kernel should be at /Applications/Mathematica.app/Contents/MacOS
: