1
0
Fork 0

Add dark and light modes for macOS
continuous-integration/drone/push Build is failing Details

main
Ambrose Chua 2019-08-25 16:22:25 +08:00
parent 076598ead4
commit dc26661045
7 changed files with 705 additions and 6 deletions

View File

@ -11,10 +11,21 @@ brew "git"
brew "zsh"
brew "bash" # improve bash version
brew "neovim"
brew "pinentry"
# languages
brew "python"
brew "go"
brew "node"
brew "deno"
# system
brew "grpc"
brew "protobuf"
# flutter
brew "usbmuxd", args: ["HEAD"]
brew "libimobiledevice", args: ["HEAD"]
brew "ideviceinstaller"
brew "ios-deploy"
brew "cocoapods"
# more system
cask "docker"
# desktop
@ -24,6 +35,7 @@ brew "koekeishiya/formulae/chunkwm"
cask "bitbar"
cask "iterm2-nightly"
cask "firefoxnightly"
cask "brave-browser"
# user tools
brew "thefuck"
@ -42,10 +54,11 @@ brew "coreutils"
brew "gawk"
brew "gnu-getopt"
brew "gnu-sed"
brew "gnu-tar"
brew "figlet"
brew "toilet"
brew "lolcat"
#brew "neofetch"
brew "neofetch"
brew "openssl"
brew "p7zip"
brew "unrar"
@ -61,10 +74,13 @@ cask "virtualbox"
cask "xquartz"
#cask "daisydisk"
brew "ncdu"
tap "jeffreywildman/virt-manager"
brew "jeffreywildman/virt-manager/virt-viewer"
brew "jeffreywildman/virt-manager/virt-manager"
#cask "osxfuse"
#cask "gpgtools"
#cask "karabiner-elements"
cask "switchresx"
#cask "switchresx"
#cask "keycastr" # replaced by custom keycastr
cask "whoozle-android-file-transfer"
cask "intel-power-gadget"
@ -73,10 +89,10 @@ cask "intel-power-gadget"
# extra tools
brew "highlight"
brew "pwgen"
brew "ghi"
#brew "ghi"
brew "hadolint"
#brew "kubernetes-helm"
#brew "terraform"
brew "terraform"
brew "ykman"
cask "keybase"
#cask "yubikey-neo-manager"
@ -88,6 +104,7 @@ cask "graphql-playground"
# extra network
brew "aria2"
brew "shadowsocks-libev", restart_service: true
brew "ipfs"
#brew "wrk"
#cask "tuntap"
# speedtest.net app
@ -114,13 +131,15 @@ brew "ffmpeg"
#brew "gifsicle"
brew "graphicsmagick", args: ["with-webp"]
brew "asciinema"
cask "gimp"
#cask "gimp"
cask "krita"
#cask "adobe-dng-converter"
cask "inkscape"
# audacity
cask "obs"
cask "vlc"
# blackmagic davinci resolve
cask "blender"
# blackmagic disk speed test
# epson scan
cask "skyfonts"

View File

@ -669,6 +669,611 @@
"ASCII Ligatures": false,
"Custom Directory": "No",
"Set Local Environment Vars": true
},
{
"ASCII Ligatures" : false,
"Set Local Environment Vars" : true,
"Working Directory" : "\\\/Users\\\/ambrosechua",
"Prompt Before Closing 2" : false,
"Dynamic Profile Filename" : "\/Users\/ambrose\/Library\/Application Support\/iTerm2\/DynamicProfiles\/env.json",
"Selected Text Color" : {
"Red Component" : 0.20000000000000001,
"Color Space" : "sRGB",
"Blue Component" : 0.20000000000000001,
"Alpha Component" : 1,
"Green Component" : 0.20000000000000001
},
"Rows" : 25,
"Ansi 11 Color" : {
"Red Component" : 0.396078431372549,
"Color Space" : "sRGB",
"Blue Component" : 0.51372549019607838,
"Green Component" : 0.4823529411764706
},
"Use Italic Font" : true,
"Foreground Color" : {
"Red Component" : 0.40000000000000002,
"Color Space" : "sRGB",
"Blue Component" : 0.40000000000000002,
"Alpha Component" : 1,
"Green Component" : 0.40000000000000002
},
"Use Custom Window Title" : false,
"Right Option Key Sends" : 0,
"Show Status Bar" : true,
"Character Encoding" : 4,
"Selection Color" : {
"Red Component" : 0.87450980392156863,
"Color Space" : "sRGB",
"Blue Component" : 0.87450980392156863,
"Alpha Component" : 1,
"Green Component" : 0.87450980392156863
},
"Show Mark Indicators" : false,
"Mouse Reporting" : false,
"Cursor Boost" : 0,
"Ansi 4 Color" : {
"Red Component" : 0.14901960784313725,
"Color Space" : "sRGB",
"Blue Component" : 0.82352941176470584,
"Green Component" : 0.54509803921568623
},
"Non-ASCII Anti Aliased" : true,
"Sync Title" : false,
"Disable Window Resizing" : true,
"Description" : "Default",
"Close Sessions On End" : true,
"Jobs to Ignore" : [
"rlogin",
"ssh",
"slogin",
"telnet"
],
"Scrollback Lines" : 0,
"Status Bar Layout" : {
"components" : [
{
"class" : "iTermStatusBarHostnameComponent",
"configuration" : {
"knobs" : {
"path" : "hostname",
"base: priority" : 2,
"base: compression resistance" : 1,
"shared text color" : {
"Red Component" : 0.5,
"Color Space" : "sRGB",
"Blue Component" : 0.25,
"Alpha Component" : 1,
"Green Component" : 0.25
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarJobComponent",
"configuration" : {
"knobs" : {
"maxwidth" : 1.7976931348623157e+308,
"base: priority" : 1,
"minwidth" : 0,
"base: compression resistance" : 1,
"shared text color" : {
"Red Component" : 0.5,
"Color Space" : "sRGB",
"Blue Component" : 0.25,
"Alpha Component" : 1,
"Green Component" : 0.41666666666666663
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarGitComponent",
"configuration" : {
"knobs" : {
"maxwidth" : 1.7976931348623157e+308,
"iTermStatusBarGitComponentPollingIntervalKey" : 2,
"base: compression resistance" : 1,
"minwidth" : 0,
"shared text color" : {
"Red Component" : 0.41666666666666669,
"Color Space" : "sRGB",
"Blue Component" : 0.25,
"Alpha Component" : 1,
"Green Component" : 0.5
},
"base: priority" : 1
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarSpringComponent",
"configuration" : {
"knobs" : {
"iTermStatusBarSpringComponentSpringConstantKey" : 0.01,
"shared text color" : {
"Red Component" : 0.25,
"Color Space" : "sRGB",
"Blue Component" : 0.25,
"Alpha Component" : 1,
"Green Component" : 0.5
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarNetworkUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 6,
"shared text color" : {
"Red Component" : 0.25,
"Color Space" : "sRGB",
"Blue Component" : 0.41666666666666663,
"Alpha Component" : 1,
"Green Component" : 0.5
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarCPUUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"shared text color" : {
"Red Component" : 0.25,
"Color Space" : "sRGB",
"Blue Component" : 0.5,
"Alpha Component" : 1,
"Green Component" : 0.41666666666666663
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarMemoryUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 3,
"shared text color" : {
"Red Component" : 0.25,
"Color Space" : "sRGB",
"Blue Component" : 0.5,
"Alpha Component" : 1,
"Green Component" : 0.25
}
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarBatteryComponent",
"configuration" : {
"knobs" : {
"ShowPercentage" : 1,
"base: priority" : 2,
"shared text color" : {
"Red Component" : 0.41666666666666696,
"Color Space" : "sRGB",
"Blue Component" : 0.5,
"Alpha Component" : 1,
"Green Component" : 0.25
},
"ShowTime" : 0
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarClockComponent",
"configuration" : {
"knobs" : {
"localize" : 1,
"base: priority" : 4,
"base: compression resistance" : 1,
"shared text color" : {
"Red Component" : 0.5,
"Color Space" : "sRGB",
"Blue Component" : 0.41666666666666652,
"Alpha Component" : 1,
"Green Component" : 0.25
},
"format" : "M\\\/dd h:mm"
},
"layout advanced configuration dictionary value" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
}
}
],
"advanced configuration" : {
"font" : "UbuntuMono-Regular 13",
"algorithm" : 0
}
},
"Flashing Bell" : false,
"Cursor Guide Color" : {
"Red Component" : 0.70213186740875244,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 0.25,
"Green Component" : 0.9268307089805603
},
"BM Growl" : true,
"Ansi 3 Color" : {
"Red Component" : 0.70980392156862748,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Green Component" : 0.53725490196078429
},
"Icon" : 1,
"Use Non-ASCII Font" : false,
"Link Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0.73423302173614502,
"Alpha Component" : 1,
"Green Component" : 0.35916060209274292
},
"Shortcut" : "",
"Background Image Location" : "",
"Bold Color" : {
"Red Component" : 0.20000000000000001,
"Color Space" : "sRGB",
"Blue Component" : 0.20000000000000001,
"Alpha Component" : 1,
"Green Component" : 0.20000000000000001
},
"Unlimited Scrollback" : true,
"Allow Title Setting" : true,
"Custom Command" : "No",
"Title Components" : 1,
"Keyboard Map" : {
"0xf700-0x260000" : {
"Text" : "[1;6A",
"Action" : 10
},
"0x37-0x40000" : {
"Text" : "0x1f",
"Action" : 11
},
"0x32-0x40000" : {
"Text" : "0x00",
"Action" : 11
},
"0xf709-0x20000" : {
"Text" : "[17;2~",
"Action" : 10
},
"0xf70c-0x20000" : {
"Text" : "[20;2~",
"Action" : 10
},
"0xf729-0x20000" : {
"Text" : "[1;2H",
"Action" : 10
},
"0xf72b-0x40000" : {
"Text" : "[1;5F",
"Action" : 10
},
"0xf705-0x20000" : {
"Text" : "[1;2Q",
"Action" : 10
},
"0xf703-0x260000" : {
"Text" : "[1;6C",
"Action" : 10
},
"0xf700-0x220000" : {
"Text" : "[1;2A",
"Action" : 10
},
"0xf701-0x280000" : {
"Text" : "0x1b 0x1b 0x5b 0x42",
"Action" : 11
},
"0x38-0x40000" : {
"Text" : "0x7f",
"Action" : 11
},
"0x33-0x40000" : {
"Text" : "0x1b",
"Action" : 11
},
"0xf703-0x220000" : {
"Text" : "[1;2C",
"Action" : 10
},
"0xf701-0x240000" : {
"Text" : "[1;5B",
"Action" : 10
},
"0xf70d-0x20000" : {
"Text" : "[21;2~",
"Action" : 10
},
"0xf702-0x260000" : {
"Text" : "[1;6D",
"Action" : 10
},
"0xf729-0x40000" : {
"Text" : "[1;5H",
"Action" : 10
},
"0xf706-0x20000" : {
"Text" : "[1;2R",
"Action" : 10
},
"0x34-0x40000" : {
"Text" : "0x1c",
"Action" : 11
},
"0xf700-0x280000" : {
"Text" : "0x1b 0x1b 0x5b 0x41",
"Action" : 11
},
"0x2d-0x40000" : {
"Text" : "0x1f",
"Action" : 11
},
"0xf70e-0x20000" : {
"Text" : "[23;2~",
"Action" : 10
},
"0xf702-0x220000" : {
"Text" : "[1;2D",
"Action" : 10
},
"0xf703-0x280000" : {
"Text" : "0x1b 0x1b 0x5b 0x43",
"Action" : 11
},
"0xf700-0x240000" : {
"Text" : "[1;5A",
"Action" : 10
},
"0xf707-0x20000" : {
"Text" : "[1;2S",
"Action" : 10
},
"0xf70a-0x20000" : {
"Text" : "[18;2~",
"Action" : 10
},
"0x35-0x40000" : {
"Text" : "0x1d",
"Action" : 11
},
"0xf70f-0x20000" : {
"Text" : "[24;2~",
"Action" : 10
},
"0xf703-0x240000" : {
"Text" : "[1;5C",
"Action" : 10
},
"0xf701-0x260000" : {
"Text" : "[1;6B",
"Action" : 10
},
"0xf702-0x280000" : {
"Text" : "0x1b 0x1b 0x5b 0x44",
"Action" : 11
},
"0xf72b-0x20000" : {
"Text" : "[1;2F",
"Action" : 10
},
"0x36-0x40000" : {
"Text" : "0x1e",
"Action" : 11
},
"0xf708-0x20000" : {
"Text" : "[15;2~",
"Action" : 10
},
"0xf701-0x220000" : {
"Text" : "[1;2B",
"Action" : 10
},
"0xf70b-0x20000" : {
"Text" : "[19;2~",
"Action" : 10
},
"0xf702-0x240000" : {
"Text" : "[1;5D",
"Action" : 10
},
"0xf704-0x20000" : {
"Text" : "[1;2P",
"Action" : 10
}
},
"Ansi 14 Color" : {
"Red Component" : 0.57647058823529407,
"Color Space" : "sRGB",
"Blue Component" : 0.63137254901960782,
"Green Component" : 0.63137254901960782
},
"Ansi 2 Color" : {
"Red Component" : 0.52156862745098043,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Green Component" : 0.59999999999999998
},
"Send Code When Idle" : false,
"ASCII Anti Aliased" : true,
"Tags" : [
],
"Ansi 9 Color" : {
"Red Component" : 0.79607843137254897,
"Color Space" : "sRGB",
"Blue Component" : 0.086274509803921567,
"Green Component" : 0.29411764705882354
},
"Use Bold Font" : true,
"Silence Bell" : false,
"Ansi 12 Color" : {
"Red Component" : 0.51372549019607838,
"Color Space" : "sRGB",
"Blue Component" : 0.58823529411764708,
"Green Component" : 0.58039215686274515
},
"Window Type" : 12,
"Allow Title Reporting" : false,
"Use Bright Bold" : true,
"Has Hotkey" : false,
"Cursor Text Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 1,
"Green Component" : 1
},
"Default Bookmark" : "No",
"Cursor Color" : {
"Red Component" : 0.29999999999999999,
"Color Space" : "sRGB",
"Blue Component" : 0.29999999999999999,
"Alpha Component" : 1,
"Green Component" : 0.29999999999999999
},
"Ansi 1 Color" : {
"Red Component" : 0.86274509803921573,
"Color Space" : "sRGB",
"Blue Component" : 0.18431372549019609,
"Green Component" : 0.19607843137254902
},
"Name" : "Solarized Light Matched",
"Guid" : "6EC7301A-566F-43DE-81D8-80813E350FA7",
"Blinking Cursor" : false,
"Ansi 8 Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0.21176470588235294,
"Green Component" : 0.16862745098039217
},
"Ansi 10 Color" : {
"Red Component" : 0.34509803921568627,
"Color Space" : "sRGB",
"Blue Component" : 0.45882352941176469,
"Green Component" : 0.43137254901960786
},
"Idle Code" : 0,
"Badge Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 0.5,
"Green Component" : 0.1491314172744751
},
"Smart Cursor Color" : false,
"Ambiguous Double Width" : false,
"Blur Radius" : 12.270590101522842,
"Ansi 0 Color" : {
"Red Component" : 0.027450980392156862,
"Color Space" : "sRGB",
"Blue Component" : 0.25882352941176473,
"Green Component" : 0.21176470588235294
},
"Blur" : false,
"Normal Font" : "UbuntuMono-Regular 15",
"Vertical Spacing" : 1,
"Use Underline Color" : true,
"Ansi 7 Color" : {
"Red Component" : 0.93333333333333335,
"Color Space" : "sRGB",
"Blue Component" : 0.83529411764705885,
"Green Component" : 0.90980392156862744
},
"Place Prompt at First Column" : false,
"Space" : 0,
"Command" : "",
"Terminal Type" : "xterm-256color",
"Horizontal Spacing" : 1,
"Reduce Flicker" : true,
"Option Key Sends" : 0,
"Only The Default BG Color Uses Transparency" : true,
"Blink Allowed" : true,
"Minimum Contrast" : 0,
"Ansi 15 Color" : {
"Red Component" : 0.99215686274509807,
"Color Space" : "sRGB",
"Blue Component" : 0.8901960784313725,
"Green Component" : 0.96470588235294119
},
"Unicode Version" : 9,
"Ansi 6 Color" : {
"Red Component" : 0.16470588235294117,
"Color Space" : "sRGB",
"Blue Component" : 0.59607843137254901,
"Green Component" : 0.63137254901960782
},
"Transparency" : 0.072204156091370555,
"Background Color" : {
"Red Component" : 0.87450980392156863,
"Color Space" : "sRGB",
"Blue Component" : 0.87450980392156863,
"Alpha Component" : 1,
"Green Component" : 0.87450980392156863
},
"Screen" : -2,
"Bound Hosts" : [
],
"Non Ascii Font" : "Monaco 12",
"Ansi 13 Color" : {
"Red Component" : 0.42352941176470588,
"Color Space" : "sRGB",
"Blue Component" : 0.7686274509803922,
"Green Component" : 0.44313725490196076
},
"Use Tab Color" : false,
"Columns" : 80,
"Unicode Normalization" : 0,
"Visual Bell" : false,
"Custom Directory" : "No",
"Thin Strokes" : 3,
"Ansi 5 Color" : {
"Red Component" : 0.82745098039215681,
"Color Space" : "sRGB",
"Blue Component" : 0.50980392156862742,
"Green Component" : 0.21176470588235294
}
}
]
}

73
.local/bin/mode Executable file
View File

@ -0,0 +1,73 @@
#!/bin/zsh
MODE_DEFAULT=('.wallpaper.jpg' 'true' 'Solarized Matched' 'Dark Matched')
MODE_DARK=('.wallpaper.dark.png' 'true' 'Solarized Matched' 'Dark Matched')
MODE_LIGHT=('.wallpaper.light.png' 'false' 'Solarized Light Matched' 'Light Matched')
evaluate() {
input="$1"
shift
replacements=($@)
for i in {1..$#replacements}; do
match="{$i}"
replacement="${replacements[i]}"
input="$(echo "$input" | sed "s/$match/$replacement/g")"
done
echo $input
}
change_system_theme() {
mode=($@)
template="
tell application \"System Events\"
set picture of desktops to \"$HOME/{1}\"
tell appearance preferences
set dark mode to {2}
end tell
end tell
"
osascript -e "$(evaluate "$template" $mode)"
}
change_iterm2_theme() {
mode=($@)
template='
import iterm2
async def main(conn):
app = await iterm2.async_get_app(conn)
profiles = await iterm2.PartialProfile.async_query(conn)
new_profile = None
for profile in profiles:
if profile.name == "{3}":
new_profile = await profile.async_get_full_profile()
await profile.async_make_default()
windows = app.terminal_windows
for window in windows:
tabs = window.tabs
for tab in tabs:
sessions = tab.sessions
for session in sessions:
await session.async_set_profile(new_profile)
iterm2.run_until_complete(main)
'
script="$HOME/Library/Application Support/iTerm2/Scripts/change-theme.py"
evaluate "$template" $mode > $script
python3 $script
}
mode_name="MODE_$1:u"
mode=(${(P)mode_name})
if [[ -z $mode ]]; then
echo "No mode specified"
exit 1
fi
change_system_theme $mode
change_iterm2_theme $mode

BIN
.wallpaper.dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 MiB

After

Width:  |  Height:  |  Size: 22 MiB

BIN
.wallpaper.light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

4
.zshrc
View File

@ -71,7 +71,9 @@ fi
export PATH="$(go env GOPATH)/bin:$PATH"
# rust
source $HOME/.cargo/env
if [[ -f $HOME/.cargo/env ]]; then
source $HOME/.cargo/env
fi
# yarn bin
export PATH="$HOME/.yarn/bin:$PATH"