From 446394d541aad7cb691747266eb583bf2d3cedf7 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 26 Feb 2017 20:47:35 +0100 Subject: [PATCH] macOS switch to Hyper from iTerm Even if Hyper is in electron, it is for some reason still faster than iTerm. iTerm is probably the slowest terminal emulator that I ever used. Also, added experimental config files for chunkwm (kwm successor). Still sticking to kwm, because chunkwm do not provides any handling for moving windows between spaces. Signed-off-by: Tomas Slusny --- README.md | 2 - config/chunkwmrc | 10 +++ config/chunkwmtilingrc | 23 ++++++ config/hyper.js | 31 ++++++++ config/khdrc | 58 +-------------- config/khdrc_chunkwm | 137 +++++++++++++++++++++++++++++++++++ install.conf.yaml | 2 +- lib/macos/iterm2.applescript | 9 --- lib/shell/fzf | 2 +- lib/vim/base16-vim | 2 +- lib/vim/deoplete.nvim | 2 +- lib/vim/fzf.vim | 2 +- lib/vim/syntastic | 2 +- lib/vim/vim-fugitive | 2 +- lib/vim/vim-javacomplete2 | 2 +- lib/vim/vim-snippets | 2 +- 16 files changed, 211 insertions(+), 77 deletions(-) create mode 100755 config/chunkwmrc create mode 100755 config/chunkwmtilingrc create mode 100644 config/hyper.js create mode 100644 config/khdrc_chunkwm delete mode 100755 lib/macos/iterm2.applescript diff --git a/README.md b/README.md index d62228de..1f03f9a5 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,6 @@ because most of the time I just cannot make up my mind, and I change my decision configuration that will remap caps lock to hyper is in dotfiles. * [Alfred 3](https://www.alfredapp.com/) - Used as launcher application in my kwm/khd config. Not needed, you can just adjust keybindings in khdrc to use Spotlight, but Alfred is just too awesome to pass. -* [iTerm2](http://iterm2.com/) - It is better than Terminal, and supports 256 colors, instead of Terminal's 16. Also, it - have no titlebar mode, what is great. And my macOS setup is configured to be working properly with iTerm2. ## How to install? diff --git a/config/chunkwmrc b/config/chunkwmrc new file mode 100755 index 00000000..93abcf1d --- /dev/null +++ b/config/chunkwmrc @@ -0,0 +1,10 @@ +#!/bin/bash + +export CHUNKC_SOCKET=3920 + +# Plugins +chunkc plugin_dir ~/.chunkwm_plugins +chunkc hotload 1 +chunkc load tiling.so +# chunkc load ffm.so +chunkc load border.so diff --git a/config/chunkwmtilingrc b/config/chunkwmtilingrc new file mode 100755 index 00000000..dad82054 --- /dev/null +++ b/config/chunkwmtilingrc @@ -0,0 +1,23 @@ +#!/bin/bash + +export CHUNKC_SOCKET=4131 + +# Tiling +chunkc config global_space_mode bsp +chunkc config global_space_offset_top 25 +chunkc config global_space_offset_bottom 0 +chunkc config global_space_offset_left 0 +chunkc config global_space_offset_right 0 +chunkc config global_space_offset_gap 0 + +chunkc config bsp_spawn_left 1 +chunkc config bsp_optimal_ratio 1.618 +chunkc config bsp_split_mode optimal +chunkc config bsp_split_ratio 0.5 + +chunkc config mouse_follows_focus 0 +chunkc config window_float_next 0 + +# signal dock to make windows topmost when floated +# requires chwm-sa (https://github.com/koekeishiya/chwm-sa) +chunkc config window_float_topmost 0 diff --git a/config/hyper.js b/config/hyper.js new file mode 100644 index 00000000..0d72ae09 --- /dev/null +++ b/config/hyper.js @@ -0,0 +1,31 @@ +module.exports = { + config: { + fontSize: 12, + fontFamily: 'Terminus', + padding: '5px', + + base16: { + scheme: 'solarized' + }, + + hyperStatusLine: { + fontFamily: 'Terminus' + }, + + css: ` + .header_header { + display: none; + } + .terms_terms { + margin-top: 0; + } + `, + + showWindowControls: 'false', + shell: '/bin/zsh', + shellArgs: ['--login'], + bell: false, + }, + + plugins: [ 'hypersixteen', 'hyperminimal' ], +}; diff --git a/config/khdrc b/config/khdrc index f3b9dc3f..fd4b1e78 100644 --- a/config/khdrc +++ b/config/khdrc @@ -11,7 +11,7 @@ khd mode resize restore default khd mode resize color 0xFF2AA198 # Launch terminal -cmd + alt + ctrl - return : ~/.kwm/iterm2.applescript +cmd + alt + ctrl - return : open -na /Applications/Hyper.app # Launch app manager cmd + alt + ctrl - space : open /Applications/Alfred\ 3.app @@ -95,59 +95,3 @@ resize + shift - h : kwmc window -c reduce 0.05 west resize + shift - j : kwmc window -c reduce 0.05 south resize + shift - k : kwmc window -c reduce 0.05 north resize + shift - l : kwmc window -c reduce 0.05 east - -# Give Focus To Screen -# cmd + alt - 1 : kwmc display -f 0 -# cmd + alt - 2 : kwmc display -f 1 -# cmd + alt - 3 : kwmc display -f 2 - -# Swap focused window -# ctrl + alt - m : kwmc window -s mark - -# # Pseudo containers -# cmd + ctrl + alt - p : kwmc tree -pseudo create -# cmd + ctrl + alt - o : kwmc tree -pseudo destroy - -# # Detach Focused Window And Reinsert In Direction -# ctrl + shift - k : kwmc window -m north -# ctrl + shift - l : kwmc window -m east -# ctrl + shift - j : kwmc window -m south -# ctrl + shift - h : kwmc window -m west - -# # Detach Marked Window And Reinsert At Focused Window -# ctrl + shift - x : kwmc window -m mark - -# # Move Focused Window To Space -# ctrl + alt - left : kwmc window -m space left -# ctrl + alt - right : kwmc window -m space right - -# # Move Focused Window To Screen -# ctrl + alt - 1 : kwmc window -m display 0 -# ctrl + alt - 2 : kwmc window -m display 1 -# ctrl + alt - 3 : kwmc window -m display 2 - -# Set Temporary Window Container -# cmd + alt + ctrl - d : kwmc window -z parent - -# Set Space Tiling Mode To BSP -# cmd + alt + ctrl - a : kwmc space -t bsp - -# Set Space Tiling Mode To Monocle -# cmd + alt + ctrl - s : kwmc space -t monocle - -# Set Space Tiling Mode To Floating -# cmd + alt + ctrl - d : kwmc space -t float - -# Rotate Window-Tree By 90degrees (Clockwise) -# cmd + alt + ctrl - r : kwmc tree rotate 90 - -# Modify Container -# cmd + alt + ctrl - s : kwmc window -c split-mode toggle -# cmd + alt + ctrl - 0x32 : kwmc window -c type toggle - -# Mark Window -# cmd + alt + ctrl - m : kwmc window -mk focused -# cmd + alt + ctrl - h : kwmc window -mk west wrap -# cmd + alt + ctrl - l : kwmc window -mk east wrap -# cmd + alt + ctrl - j : kwmc window -mk south wrap -# cmd + alt + ctrl - k : kwmc window -mk north wrap diff --git a/config/khdrc_chunkwm b/config/khdrc_chunkwm new file mode 100644 index 00000000..cafda540 --- /dev/null +++ b/config/khdrc_chunkwm @@ -0,0 +1,137 @@ +# Launch terminal +cmd + alt + ctrl - return : open -na /Applications/Hyper.app + +# Launch app manager +cmd + alt + ctrl - space : open /Applications/Alfred\ 3.app + +# Launch password manager +cmd + alt + ctrl - z : ~/.kwm/pass.applescript +cmd + alt + ctrl - y : ~/.kwm/pass.applescript + +# Launch process manager +cmd + alt + ctrl - x : ~/.kwm/pkill.applescript + +# Launch clipboard manager +cmd + alt + ctrl - c : khd -p "cmd + alt - c" + +# Launch music manager +cmd + alt + ctrl - v : ~/.kwm/spotify.applescript + +# Restard khd +cmd + alt + ctrl - escape : khd -e "reload" + +# Restard window manager +# cmd + alt + ctrl + shift - escape : brew services restart kwm + +# Lock screen +cmd + alt + ctrl - e : pmset displaysleepnow + +# Close window +cmd + alt + ctrl - w ![Firefox] : khd -p "cmd - w" +cmd + alt + ctrl - w [Firefox] : khd -p "cmd + shift - w" + +# Quit application +cmd + alt + ctrl + shift - w : khd -p "cmd - q" + +# Set space tiled +cmd + alt + ctrl - t : chunkc space -l bsp + +# Set space monocle +cmd + alt + ctrl - m : chunkc space -l monocle + +# Toggle window fullscreen +cmd + alt + ctrl - f : chunkc window -t fullscreen + +# Toggle window floating +cmd + alt + ctrl - s : chunkc window -t float + +# Give Focus To Window +cmd + alt + ctrl - h : chunkc window -f west +cmd + alt + ctrl - l : chunkc window -f east +cmd + alt + ctrl - j : chunkc window -f south +cmd + alt + ctrl - k : chunkc window -f north + +# Move window +cmd + alt + ctrl + shift - h : chunkc window -w west +cmd + alt + ctrl + shift - j : chunkc window -w south +cmd + alt + ctrl + shift - k : chunkc window -w north +cmd + alt + ctrl + shift - l : chunkc window -w east + +# Resize windows +# cmd + alt + ctrl - r : khd -e "mode activate resize" +# resize - h : kwmc window -c expand 0.05 west +# resize - j : kwmc window -c expand 0.05 south +# resize - k : kwmc window -c expand 0.05 north +# resize - l : kwmc window -c expand 0.05 east +# resize + shift - h : kwmc window -c reduce 0.05 west +# resize + shift - j : kwmc window -c reduce 0.05 south +# resize + shift - k : kwmc window -c reduce 0.05 north +# resize + shift - l : kwmc window -c reduce 0.05 east + +# Move between spaces +# cmd + alt + ctrl - 0x12 : kwmc space -fExperimental 1 +# cmd + alt + ctrl - 0x13 : kwmc space -fExperimental 2 +# cmd + alt + ctrl - 0x14 : kwmc space -fExperimental 3 +# cmd + alt + ctrl - 0x15 : kwmc space -fExperimental 4 +# cmd + alt + ctrl - 0x16 : kwmc space -fExperimental 5 +# cmd + alt + ctrl + shift - 0x12 : kwmc window -m space 1 +# cmd + alt + ctrl + shift - 0x13 : kwmc window -m space 2 +# cmd + alt + ctrl + shift - 0x14 : kwmc window -m space 3 +# cmd + alt + ctrl + shift - 0x15 : kwmc window -m space 4 +# cmd + alt + ctrl + shift - 0x16 : kwmc window -m space 5 + +# Give Focus To Screen +# cmd + alt - 1 : kwmc display -f 0 +# cmd + alt - 2 : kwmc display -f 1 +# cmd + alt - 3 : kwmc display -f 2 + +# Swap focused window +# ctrl + alt - m : kwmc window -s mark + +# # Pseudo containers +# cmd + ctrl + alt - p : kwmc tree -pseudo create +# cmd + ctrl + alt - o : kwmc tree -pseudo destroy + +# # Detach Focused Window And Reinsert In Direction +# ctrl + shift - k : kwmc window -m north +# ctrl + shift - l : kwmc window -m east +# ctrl + shift - j : kwmc window -m south +# ctrl + shift - h : kwmc window -m west + +# # Detach Marked Window And Reinsert At Focused Window +# ctrl + shift - x : kwmc window -m mark + +# # Move Focused Window To Space +# ctrl + alt - left : kwmc window -m space left +# ctrl + alt - right : kwmc window -m space right + +# # Move Focused Window To Screen +# ctrl + alt - 1 : kwmc window -m display 0 +# ctrl + alt - 2 : kwmc window -m display 1 +# ctrl + alt - 3 : kwmc window -m display 2 + +# Set Temporary Window Container +# cmd + alt + ctrl - d : kwmc window -z parent + +# Set Space Tiling Mode To BSP +# cmd + alt + ctrl - a : kwmc space -t bsp + +# Set Space Tiling Mode To Monocle +# cmd + alt + ctrl - s : kwmc space -t monocle + +# Set Space Tiling Mode To Floating +# cmd + alt + ctrl - d : kwmc space -t float + +# Rotate Window-Tree By 90degrees (Clockwise) +# cmd + alt + ctrl - r : kwmc tree rotate 90 + +# Modify Container +# cmd + alt + ctrl - s : kwmc window -c split-mode toggle +# cmd + alt + ctrl - 0x32 : kwmc window -c type toggle + +# Mark Window +# cmd + alt + ctrl - m : kwmc window -mk focused +# cmd + alt + ctrl - h : kwmc window -mk west wrap +# cmd + alt + ctrl - l : kwmc window -mk east wrap +# cmd + alt + ctrl - j : kwmc window -mk south wrap +# cmd + alt + ctrl - k : kwmc window -mk north wrap diff --git a/install.conf.yaml b/install.conf.yaml index 37023157..1a3c7d3a 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -33,8 +33,8 @@ $HOME/.profile: config/profile $HOME/.vimrc: config/vimrc $HOME/.tmux.conf: config/tmux.conf + $HOME/.hyper.js: config/hyper.js $HOME/.kwm/kwmrc: config/kwmrc - $HOME/.kwm/iterm2.applescript: lib/macos/iterm2.applescript $HOME/.kwm/pass.applescript: lib/macos/alfred/pass.applescript $HOME/.kwm/pkill.applescript: lib/macos/alfred/pkill.applescript $HOME/.kwm/spotify.applescript: lib/macos/alfred/spotify.applescript diff --git a/lib/macos/iterm2.applescript b/lib/macos/iterm2.applescript deleted file mode 100755 index 647cc377..00000000 --- a/lib/macos/iterm2.applescript +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env osascript - -if application "iTerm2" is running then - tell application "iTerm2" - create window with default profile - end tell -else - activate application "iTerm2" -end if diff --git a/lib/shell/fzf b/lib/shell/fzf index b29375c8..cd59e5d0 160000 --- a/lib/shell/fzf +++ b/lib/shell/fzf @@ -1 +1 @@ -Subproject commit b29375c844744fb45183bdbbb6d1ff854cf23b7a +Subproject commit cd59e5d07b3a69a75f7c0d02efd66b6f04bb13a1 diff --git a/lib/vim/base16-vim b/lib/vim/base16-vim index f6e70df4..b6a40755 160000 --- a/lib/vim/base16-vim +++ b/lib/vim/base16-vim @@ -1 +1 @@ -Subproject commit f6e70df4c43cda3f895ff07bdad2dc7cccc43966 +Subproject commit b6a4075594806b0d9d7759506b6e84fcec8b22c1 diff --git a/lib/vim/deoplete.nvim b/lib/vim/deoplete.nvim index 134c763f..7dd1a910 160000 --- a/lib/vim/deoplete.nvim +++ b/lib/vim/deoplete.nvim @@ -1 +1 @@ -Subproject commit 134c763f7a7d2130ebbe8686623a5064b2195dde +Subproject commit 7dd1a91092f66eafe5a939e8529b384a4e2ecc67 diff --git a/lib/vim/fzf.vim b/lib/vim/fzf.vim index fcca65bb..364fea3c 160000 --- a/lib/vim/fzf.vim +++ b/lib/vim/fzf.vim @@ -1 +1 @@ -Subproject commit fcca65bbe5168c09829124c0f6f468aa782d01f6 +Subproject commit 364fea3ca09b7c70294e4b856893919b0b689375 diff --git a/lib/vim/syntastic b/lib/vim/syntastic index 6fb14d62..32a37549 160000 --- a/lib/vim/syntastic +++ b/lib/vim/syntastic @@ -1 +1 @@ -Subproject commit 6fb14d624b6081459360fdbba743f82cf84c8f92 +Subproject commit 32a3754915901489e6d3b713e8fa9874638454df diff --git a/lib/vim/vim-fugitive b/lib/vim/vim-fugitive index f44845e4..87c1bda4 160000 --- a/lib/vim/vim-fugitive +++ b/lib/vim/vim-fugitive @@ -1 +1 @@ -Subproject commit f44845e4408aae03e018e98afb7fbf0c2ee87dd5 +Subproject commit 87c1bda4d5573185a1f79c42a919c4b62bc34c42 diff --git a/lib/vim/vim-javacomplete2 b/lib/vim/vim-javacomplete2 index d82a99be..0f2b2a5d 160000 --- a/lib/vim/vim-javacomplete2 +++ b/lib/vim/vim-javacomplete2 @@ -1 +1 @@ -Subproject commit d82a99bef270dc75c7c349bf756c5d210ecaf7f4 +Subproject commit 0f2b2a5d178bf932e1a5723d2bad7c88ad70762b diff --git a/lib/vim/vim-snippets b/lib/vim/vim-snippets index 8fe91f30..7ebdf055 160000 --- a/lib/vim/vim-snippets +++ b/lib/vim/vim-snippets @@ -1 +1 @@ -Subproject commit 8fe91f303c33a3df5add646caa2b4dc179b79db3 +Subproject commit 7ebdf0559849cfac76ea2db0b00cdbbcfa85de65