diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-11-26 09:16:27 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-11-26 09:19:35 +0300 |
commit | 4050729e483e5346f514ea0a052716fd48d4bfbf (patch) | |
tree | 621a9743c7528a54482aabaf5af6cef04569d054 | |
parent | 7cb7ee07be1bd2912af4773643d1ebc1d2520ae6 (diff) |
wizard: after installing the font on iTerm2, ask for system reboot if iTerm2 session restoration is enabledv1.14.0
-rw-r--r-- | internal/wizard.zsh | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh index 39edc089..364a4705 100644 --- a/internal/wizard.zsh +++ b/internal/wizard.zsh @@ -563,14 +563,25 @@ function install_font() { print flowing +c "%2FMeslo Nerd Font%f" successfully installed. print -P "" - flowing +c Please "%Brestart iTerm2%b" for the changes to take effect. - print -P "" - flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." - flowing +c -i 5 " 2. Open %BiTerm2%b." - print -P "" - flowing +c "It's" important to "%Brestart iTerm2%b" by following the instructions above. \ - "It's" "%Bnot enough%b" to close iTerm2 by clicking on the red circle. You must \ - click "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + () { + local out + out=$(/usr/bin/defaults read 'Apple Global Domain' NSQuitAlwaysKeepsWindows 2>/dev/null) || return + [[ $out == 1 ]] || return + out="$(iterm_get OpenNoWindowsAtStartup 2>/dev/null)" || return + [[ $out == false ]] + } + if (( $? )); then + flowing +c Please "%Brestart iTerm2%b" for the changes to take effect. + print -P "" + flowing +c -i 5 " 1. Click" "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + flowing +c -i 5 " 2. Open %BiTerm2%b." + print -P "" + flowing +c "It's" important to "%Brestart iTerm2%b" by following the instructions above. \ + "It's" "%Bnot enough%b" to close iTerm2 by clicking on the red circle. You must \ + click "%BiTerm2 → Quit iTerm2%b" or press "%B⌘ Q%b." + else + flowing +c Please "%Brestart your computer%b" for the changes to take effect. + fi while true; do sleep 60 2>/dev/null; done ;; esac |