Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions .config/aerospace/aerospace.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# after-startup-command = ['exec-and-forget sketchybar']

# Notify Sketchybar about workspace change
exec-on-workspace-change = ['/bin/bash', '-c',
# 'sketchybar --trigger aerospace_workspace_change FOCUSED_WORKSPACE=$AEROSPACE_FOCUSED_WORKSPACE',
'exec-and-forget borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=5.0'
]

# Start AeroSpace at login
start-at-login = true

# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true

# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
# The 'accordion-padding' specifies the size of accordion padding
# You can set 0 to disable the padding feature
accordion-padding = 300

# Possible values: tiles|accordion
default-root-container-layout = 'tiles'

# Possible values: horizontal|vertical|auto
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
# tall monitor (anything higher than wide) gets vertical orientation
default-root-container-orientation = 'auto'

# Mouse follows focus when focused monitor changes
# Drop it from your config, if you don't like this behavior
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
# Fallback value (if you omit the key): on-focused-monitor-changed = []
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']

# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
# Also see: https://nikitabobko.github.io/AeroSpace/goodness#disable-hide-app
automatically-unhide-macos-hidden-apps = false

# [[on-window-detected]]
# if.app-id = 'com.apple.systempreferences'
# if.app-name-regex-substring = 'settings'
# if.window-title-regex-substring = 'substring'
# if.workspace = 'workspace-name'
# if.during-aerospace-startup = true
# check-further-callbacks = true
# run = ['layout floating', 'move-node-to-workspace S'] # The callback itself

[[on-window-detected]]
if.app-name-regex-substring = 'telegram'
run = 'layout floating'

[[on-window-detected]]
if.app-name-regex-substring = 'finder'
run = 'layout floating'

# Possible values: (qwerty|dvorak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'

# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant: gaps.outer.top = 8
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
# In this example, 24 is a default value when there is no match.
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
[gaps]
inner.horizontal = 18
inner.vertical = 18
outer.left = 18
outer.bottom = 18
outer.top = 18
outer.right = 18

# 'main' binding mode declaration
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
# 'main' binding mode must be always presented
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]

# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, backtick,
# leftSquareBracket, rightSquareBracket, space, enter, esc, backspace, tab
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right

# All possible modifiers: cmd, alt, ctrl, shift

# All possible commands: https://nikitabobko.github.io/AeroSpace/commands

# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# You can uncomment the following lines to open up terminal with alt + enter shortcut (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''

alt-ctrl-shift-f = 'fullscreen'
alt-ctrl-f = 'layout floating'

alt-shift-left = 'join-with left'
alt-shift-down = 'join-with down'
alt-shift-up = 'join-with up'
alt-shift-right = 'join-with right'

# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'

# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'

# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'

# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-shift-minus = 'resize smart -50'
alt-shift-equal = 'resize smart +50'

# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'

#See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = 'move-node-to-workspace 1 --focus-follows-window'
alt-shift-2 = 'move-node-to-workspace 2 --focus-follows-window'
alt-shift-3 = 'move-node-to-workspace 3 --focus-follows-window'
alt-shift-4 = 'move-node-to-workspace 4 --focus-follows-window'
alt-shift-5 = 'move-node-to-workspace 5 --focus-follows-window'

alt-tab = 'workspace-back-and-forth'
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'

# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = 'mode service'
alt-shift-enter = 'mode apps'

alt-s = 'exec-and-forget open -a /Applications/Safari.app'
alt-p = 'exec-and-forget open -a /Applications/Launchpad.app'

# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']

[mode.apps.binding]
# alt-q = ['exec-and-forget open -a /Applications/Kitty.app', 'mode main']
1 change: 1 addition & 0 deletions .config/sketchybar/sketchybarrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO bb
121 changes: 121 additions & 0 deletions .config/skhd/skhdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# toggle yabai
hyper - u : ~/.config/skhd/CustomScripts/ToggleWM.sh 1
hyper - y : ~/.config/skhd/CustomScripts/ToggleWM.sh 0

hyper - b : brew services restart sketchybar

# open apps
# terminal window
hyper - t : alacritty msg create-window

# finder
hyper - e : open ~/

# floating window
hyper - g : yabai -m window --toggle float --grid 5:5:1:1:3:3

# rotate tree
hyper - r : yabai -m space --rotate 90

# flip The tree vertically
hyper - w : yabai -m space --mirror y-axis

# fill screen
hyper - return : yabai -m window --toggle zoom-fullscreen
hyper - o : yabai -m window --grid 1:1:0:0:1:1

# media controls p [ ] keys
hyper - 0x23 : osascript -e 'tell application "Music" to previous track'
hyper - 0x21 : osascript -e 'tell application "Music" to playpause'
hyper - 0x1E : osascript -e 'tell application "Music" to next track'

# focus desktop
# shift + rcmd + rctrl + ralt - z : ~/.config/skhd/CustomScripts/SwitchSpace.sh 1
# shift + rcmd + rctrl + ralt - a : ~/.config/skhd/CustomScripts/SwitchSpace.sh 2
# shift + rcmd + rctrl + ralt - s : ~/.config/skhd/CustomScripts/SwitchSpace.sh 3
# shift + rcmd + rctrl + ralt - d : ~/.config/skhd/CustomScripts/SwitchSpace.sh 4
# shift + rcmd + rctrl + ralt - f : ~/.config/skhd/CustomScripts/SwitchSpace.sh 5
# shift + rcmd + rctrl + ralt - 1 : ~/.config/skhd/CustomScripts/SwitchSpace.sh 6
# shift + rcmd + rctrl + ralt - 2 : ~/.config/skhd/CustomScripts/SwitchSpace.sh 7
# shift + rcmd + rctrl + ralt - 3 : ~/.config/skhd/CustomScripts/SwitchSpace.sh 8
# shift + rcmd + rctrl + ralt - 4 : ~/.config/skhd/CustomScripts/SwitchSpace.sh 9
shift + rcmd + rctrl + ralt - z : yabai -m space --focus 1
shift + rcmd + rctrl + ralt - a : yabai -m space --focus 2
shift + rcmd + rctrl + ralt - s : yabai -m space --focus 3
shift + rcmd + rctrl + ralt - d : yabai -m space --focus 4
shift + rcmd + rctrl + ralt - f : yabai -m space --focus 5
shift + rcmd + rctrl + ralt - 1 : yabai -m space --focus 6
shift + rcmd + rctrl + ralt - 2 : yabai -m space --focus 7
shift + rcmd + rctrl + ralt - 3 : yabai -m space --focus 8
shift + rcmd + rctrl + ralt - 4 : yabai -m space --focus 9
shift + rcmd + rctrl + ralt - 5 : yabai -m space --focus 10
shift + rcmd + rctrl + ralt - 6 : yabai -m space --focus 11
shift + rcmd + rctrl + ralt - 7 : yabai -m space --focus 12
shift + rcmd + rctrl + ralt - 8 : yabai -m space --focus 13
shift + rcmd + rctrl + ralt - 9 : yabai -m space --focus 14
shift + rcmd + rctrl + ralt - 0 : yabai -m space --focus 15

# spotlight
# lcmd - space : ~/Developer/Other/Rofi-macOS/ApplicationPicker.sh

# stacking
shift + rcmd + rctrl + ralt - left : window=$(yabai -m query --windows --window | jq -r '.id') && yabai -m window west --stack $window || (yabai -m window $window --toggle float && yabai -m window $window --toggle float)
shift + rcmd + rctrl + ralt - right : window=$(yabai -m query --windows --window | jq -r '.id') && yabai -m window east --stack $window || (yabai -m window $window --toggle float && yabai -m window $window --toggle float)
shift + rcmd + rctrl + ralt - up : window=$(yabai -m query --windows --window | jq -r '.id') && yabai -m window north --stack $window || (yabai -m window $window --toggle float && yabai -m window $window --toggle float)
shift + rcmd + rctrl + ralt - down : window=$(yabai -m query --windows --window | jq -r '.id') && yabai -m window south --stack $window || (yabai -m window $window --toggle float && yabai -m window $window --toggle float)

# scroll through stack
lalt - 0x30 : yabai -m window --focus stack.next || yabai -m window --focus stack.first
lalt + lshift - 0x30 : yabai -m window --focus stack.prev || yabai -m window --focus stack.last

# modes
# :: default : sketchybar --set island drawing=off
# :: window @ : sketchybar --set island drawing=on
:: default
:: window @
hyper - n ; window
window < escape ; default

# focus window (use f16 - f19)
window < h : yabai -m window --focus west || \
yabai -m window --focus $(yabai -m query --spaces --display west | jq '.[] | select(."is-visible" == true) | ."last-window"')
window < l : yabai -m window --focus east || \
yabai -m window --focus $(yabai -m query --spaces --display east | jq '.[] | select(."is-visible" == true) | ."first-window"')
window < j : yabai -m window --focus south
window < k : yabai -m window --focus north

# move window
# same as shift + rcmd + rctrl + ralt+ lcmd - key
window < shift - h : yabai -m window --warp west || \
~/.config/skhd/CustomScripts/MoveWindowLeftAndFocus.sh
window < shift - l : yabai -m window --warp east || \
~/.config/skhd/CustomScripts/MoveWindowLeftAndFocus.sh
window < shift - k : yabai -m window --warp north
window < shift - j : yabai -m window --warp south

# move window to desktop
window < z : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 1
window < a : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 2
window < s : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 3
window < d : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 4
window < f : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 5
window < 1 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 6
window < 2 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 7
window < 3 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 8
window < 4 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 9
window < 5 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 10
window < 6 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 11
window < 7 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 12
window < 8 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 13
window < 9 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 14
window < 0 : skhd -k "escape"; ~/.config/skhd/CustomScripts/MoveWindow.sh 15

# resize window
window < ctrl - h : yabai -m window --resize left:-20:0 || \
yabai -m window --resize right:-20:0
window < ctrl - l : yabai -m window --resize left:20:0 || \
yabai -m window --resize right:20:0
window < ctrl - j : yabai -m window --resize top:0:20 || \
yabai -m window --resize bottom:0:20
window < ctrl - k : yabai -m window --resize top:0:-20 || \
yabai -m window --resize bottom:0:-20
72 changes: 72 additions & 0 deletions .config/yabai/yabairc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env sh

launchctl unload -F /System/Library/LaunchAgents/com.apple.WindowManager.plist > /dev/null 2>&1 &

sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
yabai -m signal --add event=display_added action="sleep 1 && $HOME/.config/yabai/create_spaces.sh"
yabai -m signal --add event=display_removed action="sleep 1 && $HOME/.config/yabai/create_spaces.sh"
# yabai -m signal --add event=window_created action="sketchybar --trigger windows_on_spaces"
# yabai -m signal --add event=window_focused action="sketchybar --trigger windows_on_spaces"
# yabai -m signal --add event=window_destroyed action="sketchybar --trigger windows_on_spaces"
# yabai -m signal --add event=window_moved action="sketchybar --trigger windows_on_spaces"

yabai -m config external_bar all:32:0
yabai -m config window_border on # enabling this option will also enable blur
yabai -m config window_border_blur off
yabai -m config mouse_follows_focus off
yabai -m config focus_follows_mouse off
yabai -m config window_placement second_child
yabai -m config window_topmost off
yabai -m config window_shadow float
yabai -m config window_opacity on
yabai -m config window_opacity_duration 0.1
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 1.0
yabai -m config window_border_width 3
yabai -m config window_border_hidpi off
yabai -m config window_border_radius 3
yabai -m config window_animation_duration 0.0
yabai -m config active_window_border_color 0xffcdd6f4
yabai -m config normal_window_border_color 0xff313244
yabai -m config insert_feedback_color 0xfffab387
yabai -m config split_ratio 0.50
yabai -m config auto_balance off

yabai -m config layout bsp
yabai -m config top_padding 8
yabai -m config bottom_padding 8
yabai -m config left_padding 8
yabai -m config right_padding 8
yabai -m config window_gap 6
# Do not manage some apps which are not resizable
yabai -m rule --add app="^(LuLu|Vimac|Calculator|VLC|System Settings|zoom.us|Photo Booth|Archive Utility|Python|LibreOffice)$" manage=off

# ===== Rules ==================================

yabai -m rule --add app="^Finder$" sticky=on layer=above manage=off
yabai -m rule --add app="^choose$" layer=above manage=off
yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
yabai -m rule --add label="System Settings" app="^System Preferences$" manage=off
yabai -m rule --add label="App Store" app="^App Store$" manage=off
yabai -m rule --add label="Activity Monitor" app="^Activity Monitor$" manage=off
yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
yabai -m rule --add label="Software Update" title="Software Update" manage=off
yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
yabai -m rule --add label="Select file to save to" app="^Inkscape$" title="Select file to save to" manage=off
yabai -m rule --add label="AppCleaner" app="^AppCleaner$" layer=above manage=off

yabai -m space 1 --label one
yabai -m space 2 --label two
yabai -m space 3 --label three
yabai -m space 4 --label four
yabai -m space 5 --label five
yabai -m space 6 --label six
yabai -m space 7 --label seven
yabai -m space 8 --label eight
yabai -m space 9 --label nine
yabai -m space 10 --label ten

# yabai -m signal --add event=window_destroyed action="bash ./CustomScripts/window-focus-on-destroy.sh"
yabai -m signal --add event=window_focused action="sketchybar --trigger window_focus"
1 change: 1 addition & 0 deletions nix-darwin/home-modules/languages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
./latex.nix
./nix.nix
./python.nix
./toml.nix
./yaml.nix
./jsts.nix
];
Expand Down
Loading
Loading