1
0
Fork 0

Switch to yabai, improve keymap and folders

main
Ambrose Chua 2019-09-29 17:28:08 +08:00
parent 53f4bc5a49
commit 9eeab81060
Signed by: ambrose
GPG Key ID: BC367D33F140B5C2
16 changed files with 285 additions and 1470 deletions

View File

@ -1,48 +0,0 @@
#!/bin/bash
chunkc core::plugin_dir ~/.chunkwm_plugins
chunkc core::hotload 1
#
# Desktop
#
chunkc set global_desktop_mode bsp
chunkc set global_desktop_offset_top 20
chunkc set global_desktop_offset_bottom 20
chunkc set global_desktop_offset_left 20
chunkc set global_desktop_offset_right 20
chunkc set global_desktop_offset_gap 12
chunkc set desktop_padding_step_size 10
chunkc set desktop_gap_step_size 6
#
# Cursor
#
chunkc set mouse_follows_focus intrinsic
#
# Border
#
chunkc set focused_border_color 0xbbcb4b16
chunkc set focused_border_width 4
chunkc set focused_border_radius 8
chunkc set focused_border_skip_floating 1
chunkc set focused_border_outline 1
#
# Load Plugins
#
chunkc core::load tiling.so
chunkc core::load ffm.so
chunkc core::load border.so
#
# Floating rules
#
chunkc tiling::rule --owner \"System Preferences\" --state float

144
.config/skhd/skhdrc Normal file
View File

@ -0,0 +1,144 @@
#
# Resizing containers:
# See bottom
#
:: default : yabai -m config active_window_border_color 0xbbcb4b16
:: resize @ : yabai -m config active_window_border_color 0xffdc322f
#
# Basics:
#
# start a terminal
alt - return : ~/.local/bin/open-iterm
# kill focused window
alt + shift - q : yabai -m window --close
# start your launcher
alt - d : skhd -k "cmd - space"
#osascript -e 'tell application "System Events" to keystroke space using {command down}'
# reload skhd configuration file
alt + shift - c : skhd reload
# reload chunkwm
alt + shift - e : ~/.yabairc
#
# Moving around:
#
# Move your focus around
alt - h : yabai -m window --focus west
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - l : yabai -m window --focus east
# or use $mod+[up|down|left|right]
alt - left : yabai -m window --focus west
alt - down : yabai -m window --focus south
alt - up : yabai -m window --focus north
alt - right : yabai -m window --focus east
# Move the focused window with the same, but add Shift
alt + shift - h : yabai -m window --warp west
alt + shift - j : yabai -m window --warp south
alt + shift - k : yabai -m window --warp north
alt + shift - l : yabai -m window --warp east
# ditto, with arrow keys
alt + shift - left : yabai -m window --warp west
alt + shift - down : yabai -m window --warp south
alt + shift - up : yabai -m window --warp north
alt + shift - right : yabai -m window --warp east
#
# Workspaces:
#
# switch to workspace
alt - 0x12 : yabai -m space --focus 1
alt - 0x13 : yabai -m space --focus 2
alt - 0x14 : yabai -m space --focus 3
alt - 0x15 : yabai -m space --focus 4
alt - 0x17 : yabai -m space --focus 5
alt - 0x16 : yabai -m space --focus 6
alt - 0x1A : yabai -m space --focus 7
alt - 0x1C : yabai -m space --focus 8
alt - 0x19 : yabai -m space --focus 9
alt - 0x1D : yabai -m space --focus 10
# move focused container to workspace
alt + shift - 0x12 : yabai -m window --space 1
alt + shift - 0x13 : yabai -m window --space 2
alt + shift - 0x14 : yabai -m window --space 3
alt + shift - 0x15 : yabai -m window --space 4
alt + shift - 0x17 : yabai -m window --space 5
alt + shift - 0x16 : yabai -m window --space 6
alt + shift - 0x1A : yabai -m window --space 7
alt + shift - 0x1C : yabai -m window --space 8
alt + shift - 0x19 : yabai -m window --space 9
alt + shift - 0x1D : yabai -m window --space 10
#
# Displays:
#
# switch to displays
alt - a : yabai -m display --focus 1
alt - b : yabai -m display --focus 2
alt - c : yabai -m display --focus 3
# move to display and follow
alt + shift - a : yabai -m window --display 1; yabai -m display --focus 1
alt + shift - b : yabai -m window --display 2; yabai -m display --focus 2
alt + shift - c : yabai -m window --display 3; yabai -m display --focus 3
#
# Layout stuff:
#
# You can "split" the current object of your focus...
alt - b : yabai -m window --insert south
alt - v : yabai -m window --insert east
# Alternatively, set split with
alt + ctrl - h : yabai -m window --insert west
alt + ctrl - j : yabai -m window --insert south
alt + ctrl - k : yabai -m window --insert north
alt + ctrl - l : yabai -m window --insert east
# Make the current focus fullscreen
alt - f : yabai -m window --toggle zoom-fullscreen
# Toggle the current focus between tiling and floating mode
alt + shift - space : yabai -m window --toggle float; yabai -m window --grid 4:4:1:1:2:2
#
# Scratchpad:
#
#
# Resizing containers:
#
alt - r ; resize
resize < return ; default
resize < alt - r ; default
resize < escape ; default
resize < h : yabai -m window --resize left:-12:0; yabai -m window --resize right:-10:0
resize < j : yabai -m window --resize top:0:-12; yabai -m window --resize bottom:0:-10
resize < k : yabai -m window --resize top:0:12; yabai -m window --resize bottom:0:10
resize < l : yabai -m window --resize left:12:0; yabai -m window --resize right:10:0
resize < left : yabai -m window --resize left:-12:0; yabai -m window --resize right:-10:0
resize < down : yabai -m window --resize top:0:-12; yabai -m window --resize bottom:0:-10
resize < up : yabai -m window --resize top:0:12; yabai -m window --resize bottom:0:10
resize < right : yabai -m window --resize left:12:0; yabai -m window --resize right:10:0
#
# Custom largegaps mode
#
alt - g : yabai -m space --gap abs:36; yabai -m space --padding abs:60:60:60:60
alt + shift - g : yabai -m space --gap abs:12; yabai -m space --padding abs:20:20:20:20

View File

@ -101,30 +101,34 @@ input * {
# Workspaces:
#
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindcode $mod+10 workspace 1
bindcode $mod+11 workspace 2
bindcode $mod+12 workspace 3
bindcode $mod+13 workspace 4
bindcode $mod+14 workspace 5
bindcode $mod+15 workspace 6
bindcode $mod+16 workspace 7
bindcode $mod+17 workspace 8
bindcode $mod+18 workspace 9
bindcode $mod+19 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindcode $mod+Shift+10 move container to workspace 1
bindcode $mod+Shift+11 move container to workspace 2
bindcode $mod+Shift+12 move container to workspace 3
bindcode $mod+Shift+13 move container to workspace 4
bindcode $mod+Shift+14 move container to workspace 5
bindcode $mod+Shift+15 move container to workspace 6
bindcode $mod+Shift+16 move container to workspace 7
bindcode $mod+Shift+17 move container to workspace 8
bindcode $mod+Shift+18 move container to workspace 9
bindcode $mod+Shift+19 move container to workspace 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Displays:
#
# TODO
#
# Layout stuff:
#
# You can "split" the current object of your focus with
@ -169,16 +173,16 @@ mode "resize" {
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10 px or 10 ppt
bindsym $down resize grow height 10 px or 10 ppt
bindsym $up resize shrink height 10 px or 10 ppt
bindsym $right resize grow width 10 px or 10 ppt
bindsym $left resize shrink width 12 px or 12 ppt
bindsym $down resize grow height 12 px or 12 ppt
bindsym $up resize shrink height 12 px or 12 ppt
bindsym $right resize grow width 12 px or 12 ppt
# ditto, with arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 12 px or 12 ppt
bindsym Down resize grow height 12 px or 12 ppt
bindsym Up resize shrink height 12 px or 12 ppt
bindsym Right resize grow width 12 px or 12 ppt
# return to default mode
bindsym Return mode "default"
@ -186,6 +190,12 @@ mode "resize" {
}
bindsym $mod+r mode "resize"
#
# Custom largegaps mode
#
bindsym $mod+g gaps inner current set 36, gaps outer current set 60
bindsym $mod+Shift+g gaps inner current set 12, gaps outer current set 20
#
# Status Bar:
#
@ -223,7 +233,7 @@ font xft:'Ubuntu' bold 11
#for_window [class="^.*"] border pixel 1
smart_gaps on
gaps inner 12
gaps outer 8
gaps outer 20
#
# Force Xresources load

78
.config/yabai/yabairc Executable file
View File

@ -0,0 +1,78 @@
#!/usr/bin/env sh
#
# Bar
#
yabai -m config status_bar on
yabai -m config status_bar_text_font ".AppleSystemUIFont:Regular:12.0"
yabai -m config status_bar_icon_font "Font Awesome 5 Pro:Solid:12.0"
yabai -m config status_bar_background_color 0x00202020
yabai -m config status_bar_foreground_color 0xff999999
yabai -m config status_bar_space_icon_strip     
yabai -m config status_bar_power_icon_strip  
yabai -m config status_bar_space_icon 
yabai -m config status_bar_clock_icon 
#
# Cursor
#
yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse autoraise
#
# Styling
#
yabai -m config window_border on
yabai -m config window_border_width 2
yabai -m config active_window_border_color 0xbbcb4b16
yabai -m config normal_window_border_color 0x00cb4b16
yabai -m config insert_window_border_color 0xbbb58900
yabai -m config window_opacity off
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.90
yabai -m config window_opacity_duration 0.0
yabai -m config window_shadow off
#
# Desktop
#
yabai -m config window_placement second_child
yabai -m config window_topmost on
yabai -m config split_ratio 0.50
yabai -m config auto_balance off
yabai -m config mouse_modifier alt
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
yabai -m config layout bsp
yabai -m config top_padding 20
yabai -m config bottom_padding 20
yabai -m config left_padding 20
yabai -m config right_padding 20
yabai -m config window_gap 12
#
# App rules
#
yabai -m rule --add app=Spotify space=1
yabai -m rule --add app=Mail space=2
yabai -m rule --add app=Safari space=3
yabai -m rule --add app=Chrome space=3
yabai -m rule --add app=Firefox space=3
yabai -m rule --add app=Brave space=3
yabai -m rule --add app=iTerm space=4
yabai -m rule --add app=Discord space=5
yabai -m rule --add app=Telegram space=5
yabai -m rule --add app=Slack space=5
yabai -m rule --add app=Signal space=5
yabai -m rule --add app=Skype space=5
yabai -m rule --add app=Steam space=6
echo "yabai configuration loaded.."

View File

@ -7,4 +7,4 @@ echo
echo "Installing iTerm2 Profiles..."
echo
ln -s $HOME/.iterm2profiles.json Library/Application\ Support/iTerm2/DynamicProfiles/env.json
ln -s $HOME/.config/iterm2profiles.json Library/Application\ Support/iTerm2/DynamicProfiles/env.json

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
#!/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')
MODE_DEFAULT=('default.jpg' 'true' 'Solarized Matched' 'Dark Matched' 'df202020' 'ff999999')
MODE_DARK=('dark.png' 'true' 'Solarized Matched' 'Dark Matched' '00202020' 'ff999999')
MODE_LIGHT=('light.png' 'false' 'Solarized Light Matched' 'Light Matched' '00dfdfdf' 'ff666666')
evaluate() {
input="$1"
@ -18,9 +18,14 @@ evaluate() {
change_system_theme() {
mode=($@)
rm -f ~/Pictures/wallpapers/current/*
cp ~/.wallpaper/"${mode[1]}" ~/Pictures/wallpapers/current/"${mode[3]}${mode[1]}"
template="
tell application \"System Events\"
set picture of desktops to \"$HOME/{1}\"
tell desktops
set change interval to -1
set change interval to 1
end tell
tell appearance preferences
set dark mode to {2}
end tell
@ -60,6 +65,12 @@ iterm2.run_until_complete(main)
python3 $script
}
change_yabai_theme() {
mode=($@)
yabai -m config status_bar_background_color 0x${mode[5]}
yabai -m config status_bar_foreground_color 0x${mode[6]}
}
mode_name="MODE_$1:u"
mode=(${(P)mode_name})
@ -70,4 +81,4 @@ fi
change_system_theme $mode
change_iterm2_theme $mode
change_yabai_theme $mode

108
.skhdrc
View File

@ -1,108 +0,0 @@
#
# Resizing containers:
# See bottom
#
:: default : chunkc border::color 0xbbcb4b16
:: resize @ : chunkc border::color 0xffdc322f
#
# Basics:
#
# start a terminal
alt - return : ~/.local/bin/open-iterm
# kill focused window
alt + shift - q : chunkc tiling::window --close
# start your launcher
alt - d : osascript -e 'tell application "System Events" to keystroke space using {command down}'
# reload skhd configuration file
alt + shift - c : skhd reload
# reload chunkwm
alt + shift - e : ~/.chunkwmrc
#
# Moving around:
#
# Move your focus around
alt - h : chunkc tiling::window --focus west
alt - j : chunkc tiling::window --focus south
alt - k : chunkc tiling::window --focus north
alt - l : chunkc tiling::window --focus east
# or use $mod+[up|down|left|right]
alt - left : chunkc tiling::window --focus west
alt - down : chunkc tiling::window --focus south
alt - up : chunkc tiling::window --focus north
alt - right : chunkc tiling::window --focus east
# Move the focused window with the same, but add Shift
alt + shift - h : chunkc tiling::window --warp west
alt + shift - j : chunkc tiling::window --warp south
alt + shift - k : chunkc tiling::window --warp north
alt + shift - l : chunkc tiling::window --warp east
# ditto, with arrow keys
alt + shift - left : chunkc tiling::window --warp west
alt + shift - down : chunkc tiling::window --warp south
alt + shift - up : chunkc tiling::window --warp north
alt + shift - right : chunkc tiling::window --warp east
#
# Workspaces:
#
# TODO
#
# Layout stuff:
#
# You can "split" the current object of your focus...
alt - b : chunkc tiling::window --use-insertion-point south
alt - v : chunkc tiling::window --use-insertion-point east
# Alternatively, set split with
alt + ctrl - h : chunkc tiling::window --use-insertion-point west
alt + ctrl - j : chunkc tiling::window --use-insertion-point south
alt + ctrl - k : chunkc tiling::window --use-insertion-point north
alt + ctrl - l : chunkc tiling::window --use-insertion-point east
# Make the current focus fullscreen
alt - f : chunkc tiling::window --toggle fullscreen
# Toggle the current focus between tiling and floating mode
alt + shift - space : chunkc tiling::window --toggle float
#
# Scratchpad:
#
#
# Resizing containers:
#
alt - r ; resize
resize < return ; default
resize < escape ; default
resize < h : chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge west; chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge east
resize < j : chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge north; chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge south
resize < k : chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge north; chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge south
resize < l : chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge west; chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge east
resize < left : chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge west; chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge east
resize < down : chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge north; chunkc tiling::window --use-temporary-ratio -0.03 --adjust-window-edge south
resize < up : chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge north; chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge south
resize < right : chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge west; chunkc tiling::window --use-temporary-ratio 0.03 --adjust-window-edge east
#
# Custom largegaps mode
#
alt + shift - g : chunkc tiling::desktop --gap inc; chunkc tiling::desktop --padding inc
alt + shift + ctrl - g : chunkc tiling::desktop --gap dec; chunkc tiling::desktop --padding dec

View File

@ -10,6 +10,13 @@ Host goldenbarrel-wan-test
LocalForward 8080 localhost:8080
RemoteForward 8180 localhost:8180
#Host goldenbarrel-wan-gpg
# Hostname makerforce.io
# User ambrose
# Port 2222
# RemoteForward /home/ambrose/.gnupg/S.gpg-agent /Users/ambrose/.gnupg/S.gpg-agent.extra
# RemoteForward /home/ambrose/.gnupg/S.gpg-agent.ssh /Users/ambrose/.gnupg/S.gpg-agent.ssh
Host goldenbarrel-wan
Hostname makerforce.io
User ambrose

View File

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 422 B

View File

Before

Width:  |  Height:  |  Size: 22 MiB

After

Width:  |  Height:  |  Size: 22 MiB

View File

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 422 B