diff --git a/config/skhd/skhdrc b/config/skhd/skhdrc new file mode 100644 index 0000000..490fd09 --- /dev/null +++ b/config/skhd/skhdrc @@ -0,0 +1,96 @@ +# skhd configuration file +# https://github.com/koekeishiya/skhd + +# Reserved keys +# --------------------------- +# shift + cmd +# m = restart yabai +# q = quit yabai +# = open wezterm +# alt +# h = focus west +# j = focus south +# k = focus north +# l = focus east +# e = toggle split +# y = toggle float, center window medium size +# u = move window to left +# i = move window to center +# o = move window to right +# ctrl + alt +# h = resize window left +# j = resize window down +# k = resize window up +# l = resize window right +# alt + shift +# t = toggle float, center window medium size +# y = toggle float, center window large size +# h = swap window left +# j = swap window down +# k = swap window up +# l = swap window right + +# Control applications +## Yabai +shift + cmd - m : yabai --restart-service # restart yabai +shift + cmd - q : yabai --quit # quit yabai + +## wezterm +shift + cmd - return : wezterm + +# Floating windows + +# float / unfloat window and center on screen medium size +alt - t : yabai -m window --toggle float;\ + yabai -m window --grid 9:16:1:1:14:7 + +# float / unfloat window and center on screen large size +shift + alt - t : yabai -m window --toggle float;\ + yabai -m window --grid 90:160:5:5:150:80 + +# make floating window fill screen +alt - y : yabai -m window --toggle float;\ + yabai -m window --grid 1:1:0:0:1:1 + +# toggle float window and center on screen medium size +shift + alt - y : yabai -m window --toggle float \ + && yabai -m window --resize \ + abs:$(($(yabai -m query --displays --display | jq .frame.w) / 2)):$(($(yabai -m query --displays --display | jq .frame.h) * 4 / 5)) \ + && yabai -m window --move \ + abs:$(($(yabai -m query --displays --display | jq .frame.x) + $(($(yabai -m query --displays --display | jq .frame.w) / 4)))):$(($(yabai -m query --displays --display | jq .frame.y) + $(($(yabai -m query --displays --display | jq .frame.h) / 10)))) + +# toggle window split type +alt - e : yabai -m window --toggle split + + +# Focusing, resizing and moving windows + +## focus window +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 + +## move windows to predefined places +alt - y : yabai -m window --grid 1:4:1:0:2:1 # 2/4 centered +alt - u : yabai -m window --grid 1:3:0:0:1:1 # 1/3 left +alt - i : yabai -m window --grid 1:3:1:0:1:1 # 1/3 center +alt - o : yabai -m window --grid 1:3:2:0:1:1 # 1/3 right +ctrl + alt - h : yabai -m window --grid 1:2:0:0:1:1 # 1/2 left +ctrl + alt - l : yabai -m window --grid 1:2:1:0:1:1 # 1/2 right + +## swap windows +shift + alt - h : yabai -m window --swap west +shift + alt - j : yabai -m window --swap south +shift + alt - k : yabai -m window --swap north +shift + alt - l : yabai -m window --swap east + +## resize windows +ctrl + alt - h : yabai -m window --resize left:-50:0; \ + yabai -m window --resize right:-50:0 +ctrl + alt - j : yabai -m window --resize bottom:0:50; \ + yabai -m window --resize top:0:50 +ctrl + alt - k : yabai -m window --resize top:0:-50; \ + yabai -m window --resize bottom:0:-50 +ctrl + alt - l : yabai -m window --resize right:50:0; \ + yabai -m window --resize left:50:0 diff --git a/config/yabai/yabairc b/config/yabai/yabairc new file mode 100755 index 0000000..6143641 --- /dev/null +++ b/config/yabai/yabairc @@ -0,0 +1,33 @@ +#!/usr/bin/env sh +# yabai configuration file +# https://github.com/koekeishiya/yabai + +## load scripting additions +# sudo yabai --load-sa +# yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" + +# automatically balance windows when they are created or destroyed +yabai -m config auto_balance on + +# layout to use, default is bsp (binary space partitioning) +# bsp or float (default: float) +yabai -m config layout bsp + +# padding between windows and screen edge +yabai -m config top_padding 0 +yabai -m config bottom_padding 0 +yabai -m config left_padding 0 +yabai -m config right_padding 0 +yabai -m config window_gap 4 + +# apps to not manage (ignore) +# TODO: add apps from aerospace config to here +yabai -m rule --add app="System Settings" manage=off +yabai -m rule --add app="^Logi Options$" manage=off +yabai -m rule --add app="^Slack$" manage=off +yabai -m rule --add app="1Password" manage=off +yabai -m rule --add app="Fork" manage=off +yabai -m rule --add app="^Microsoft Teams$" manage=off + +# apply rules +yabai -m rule --apply diff --git a/local/bin/yabai b/local/bin/yabai new file mode 100755 index 0000000..bdf47f0 Binary files /dev/null and b/local/bin/yabai differ diff --git a/local/man/yabai.1 b/local/man/yabai.1 new file mode 100644 index 0000000..89f5229 --- /dev/null +++ b/local/man/yabai.1 @@ -0,0 +1,1313 @@ +'\" t +.\" Title: yabai +.\" Author: [see the "AUTHOR(S)" section] +.\" Generator: Asciidoctor 2.0.23 +.\" Date: 2025-02-14 +.\" Manual: Yabai Manual +.\" Source: Yabai +.\" Language: English +.\" +.TH "YABAI" "1" "2025-02-14" "Yabai" "Yabai Manual" +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.ss \n[.ss] 0 +.nh +.ad l +.de URL +\fI\\$2\fP <\\$1>\\$3 +.. +.als MTO URL +.if \n[.g] \{\ +. mso www.tmac +. am URL +. ad l +. . +. am MTO +. ad l +. . +. LINKSTYLE blue R < > +.\} +.SH "NAME" +yabai \- window manager +.SH "SYNOPSIS" +.sp +\fByabai\fP [\fB\-\-load\-sa\fP|\fB\-\-uninstall\-sa\fP|\fB\-\-install\-service\fP|\fB\-\-uninstall\-service\fP|\fB\-\-start\-service\fP|\fB\-\-restart\-service\fP|\fB\-\-stop\-service\fP|\fB\-\-message\fP,\fB\-m\fP \fImsg\fP|\fB\-\-config\fP,\fB\-c\fP \fIconfig_file\fP|\fB\-\-verbose\fP,\fB\-V\fP|\fB\-\-version\fP,\fB\-v\fP|\fB\-\-help\fP,\fB\-h\fP] +.SH "DESCRIPTION" +.sp +\fByabai\fP is a tiling window manager for macOS based on binary space partitioning. +.SH "OPTIONS" +.sp +\fB\-\-load\-sa\fP +.RS 4 +Load the scripting\-addition into Dock.app. +.br +Installs and updates the scripting\-addition when necessary. +.br +Path is /Library/ScriptingAdditions/yabai.osax. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fB\-\-uninstall\-sa\fP +.RS 4 +Uninstall the scripting\-addition. Must be run as root. +.br +Path is /Library/ScriptingAdditions/yabai.osax. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fB\-\-install\-service\fP +.RS 4 +Writes a launchd service file to disk. +.br +Path is ~/Library/LaunchAgents/com.koekeishiya.yabai.plist. +.RE +.sp +\fB\-\-uninstall\-service\fP +.RS 4 +Removes a launchd service file from disk. +.br +Path is ~/Library/LaunchAgents/com.koekeishiya.yabai.plist. +.RE +.sp +\fB\-\-start\-service\fP +.RS 4 +Enables, loads, and starts the launchd service. +.br +Will install service file if it does not exist. +.RE +.sp +\fB\-\-restart\-service\fP +.RS 4 +Attempts to restart the service instance. +.RE +.sp +\fB\-\-stop\-service\fP +.RS 4 +Stops a running instance of the service and unloads it. +.RE +.sp +\fB\-\-message\fP, \fB\-m\fP \fI\fP +.RS 4 +Send message to a running instance of yabai. +.RE +.sp +\fB\-\-config\fP, \fB\-c\fP \fI\fP +.RS 4 +Use the specified configuration file. +.br +Executes using \f(CR/usr/bin/env sh \-c \fP if the exec\-bit is set. +.br +Interpreted using \f(CR/usr/bin/env sh \fP if the exec\-bit is unset. +.RE +.sp +\fB\-\-verbose\fP, \fB\-V\fP +.RS 4 +Output debug information to stdout. +.RE +.sp +\fB\-\-version\fP, \fB\-v\fP +.RS 4 +Print version to stdout and exit. +.RE +.sp +\fB\-\-help\fP, \fB\-h\fP +.RS 4 +Print options to stdout and exit. +.RE +.SH "DEFINITIONS" +.sp +.if n .RS 4 +.nf +.fam C +REGEX\& := \c +.URL "https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended\-regular\-expression\-syntax.html" "POSIX extended regular expression syntax" "" + +LABEL\& := arbitrary string/text used as an identifier + +LAYER\& := below | normal | above | auto + +BOOL_SEL\& := on | off + +FLOAT_SEL\& := 0 < <= 1.0 + +RULE_SEL\& := | LABEL + +SIGNAL_SEL\& := | LABEL + +DIR_SEL\& := north | east | south | west + +STACK_SEL\& := stack.prev | stack.next | stack.first | stack.last | stack.recent | stack. + +WINDOW_SEL\& := prev | next | first | last | recent | mouse | largest | smallest | sibling | first_nephew | second_nephew | uncle | first_cousin | second_cousin | STACK_SEL | DIR_SEL | + +DISPLAY_SEL := prev | next | first | last | recent | mouse | DIR_SEL | | LABEL + +SPACE_SEL\& := prev | next | first | last | recent | mouse | | LABEL + +EASING\& := ease_in_sine\& | ease_out_sine\& | ease_in_out_sine\& | + ease_in_quad\& | ease_out_quad\& | ease_in_out_quad\& | + ease_in_cubic | ease_out_cubic | ease_in_out_cubic | + ease_in_quart | ease_out_quart | ease_in_out_quart | + ease_in_quint | ease_out_quint | ease_in_out_quint | + ease_in_expo\& | ease_out_expo\& | ease_in_out_expo\& | + ease_in_circ\& | ease_out_circ\& | ease_in_out_circ +.fam +.fi +.if n .RE +.SH "DOMAINS" +.SS "Config" +.SS "General Syntax" +.sp +yabai \-m config +.RS 4 +Get or set the value of . +.RE +.sp +yabai \-m config [\-\-space \fI\fP] +.RS 4 +Get or set the value of . +.RE +.SS "Global Settings" +.sp +\fBdebug_output\fP [\fI\fP] +.RS 4 +Enable output of debug information to stdout. +.RE +.sp +\fBexternal_bar\fP [\fI::\fP] +.RS 4 +Specify top and bottom padding for a potential custom bar that you may be running. +.br +\fImain\fP: Apply the given padding only to spaces located on the main display. +.br +\fIall\fP: Apply the given padding to all spaces regardless of their display. +.br +\fIoff\fP: Do not apply any special padding. +.RE +.sp +\fBmenubar_opacity\fP [\fI\fP] +.RS 4 +Changes the transparency of the macOS menubar. +.br +If the value is 0.0, the menubar will no longer respond to mouse\-events, effectively hiding the menubar permanently. +.br +The menubar will automatically become fully opaque upon entering a native\-fullscreen space, and adjusted down afterwards. +.RE +.sp +\fBmouse_follows_focus\fP [\fI\fP] +.RS 4 +When focusing a window, put the mouse at its center. +.RE +.sp +\fBfocus_follows_mouse\fP [\fIautofocus|autoraise|off\fP] +.RS 4 +Automatically focus the window under the mouse. +.RE +.sp +\fBdisplay_arrangement_order\fP [\fIdefault|vertical|horizontal\fP] +.RS 4 +Specify how displays are ordered (determined by center point). +.br +\fIdefault\fP: Native macOS ordering. +.br +\fIvertical\fP: Order by y\-coordinate (followed by x\-coordinate when equal). +.br +\fIhorizontal\fP: Order by x\-coordinate (followed by y\-coordinate when equal). +.RE +.sp +\fBwindow_origin_display\fP [\fIdefault|focused|cursor\fP] +.RS 4 +Specify which display a newly created window should be managed in. +.br +\fIdefault\fP: The display in which the window is created (standard macOS behaviour). +.br +\fIfocused\fP: The display that has focus when the window is created. +.br +\fIcursor\fP: The display that currently holds the mouse cursor. +.RE +.sp +\fBwindow_placement\fP [\fIfirst_child|second_child\fP] +.RS 4 +Specify whether managed windows should become the first or second leaf\-node. +.RE +.sp +\fBwindow_insertion_point\fP [\fIfocused|first|last\fP] +.RS 4 +Specify where new managed windows will be inserted. +.RE +.sp +\fBwindow_zoom_persist\fP [\fI\fP] +.RS 4 +Windows will keep their zoom\-state through layout changes. +.RE +.sp +\fBwindow_shadow\fP [\fI|float\fP] +.RS 4 +Draw shadow for windows. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBwindow_opacity\fP [\fI\fP] +.RS 4 +Enable opacity for windows. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBwindow_opacity_duration\fP [\fI\fP] +.RS 4 +Duration of transition between active / normal opacity. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBactive_window_opacity\fP [\fI\fP] +.RS 4 +Opacity of the focused window. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBnormal_window_opacity\fP [\fI\fP] +.RS 4 +Opacity of an unfocused window. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBwindow_animation_duration\fP [\fI\fP] +.RS 4 +Duration of window frame animation. +.br +If 0.0, the change in dimension is not animated. +.br +Requires Screen Recording permissions. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fBwindow_animation_easing\fP [\fI\fP] +.RS 4 +Easing function to use for window animations. +.br +See \c +.URL "https://easings.net" "" "" +for details. +.RE +.sp +\fBinsert_feedback_color\fP [\fI0xAARRGGBB\fP] +.RS 4 +Color of the \fBwindow \-\-insert\fP message and mouse_drag selection. +.br +The purpose is to provide a visual preview of the new window frame. +.RE +.sp +\fBsplit_ratio\fP [\fI\fP] +.RS 4 +Specify the size distribution when a window is split. +.RE +.sp +\fBmouse_modifier\fP [\fIcmd|alt|shift|ctrl|fn\fP] +.RS 4 +Keyboard modifier used for moving and resizing windows. +.RE +.sp +\fBmouse_action1\fP [\fImove|resize\fP] +.RS 4 +Action performed when pressing \fImouse_modifier\fP + \fIbutton1\fP. +.RE +.sp +\fBmouse_action2\fP [\fImove|resize\fP] +.RS 4 +Action performed when pressing \fImouse_modifier\fP + \fIbutton2\fP. +.RE +.sp +\fBmouse_drop_action\fP [\fIswap|stack\fP] +.RS 4 +Action performed when a bsp\-managed window is dropped in the center of some other bsp\-managed window. +.RE +.SS "Space Settings" +.sp +\fBlayout\fP [\fIbsp|stack|float\fP] +.RS 4 +Set the layout of the selected space. +.RE +.sp +\fBsplit_type\fP [\fIvertical|horizontal|auto\fP] +.RS 4 +Specify how a window should be split. +.br +\fIvertical\fP: The window is split along the y\-axis. +.br +\fIhorizontal\fP: The window is split along the x\-axis. +.br +\fIauto\fP: The axis is determined based on width/height ratio. +.RE +.sp +\fBtop_padding\fP [\fI\fP] +.RS 4 +Padding added at the upper side of the selected space. +.RE +.sp +\fBbottom_padding\fP [\fI\fP] +.RS 4 +Padding added at the lower side of the selected space. +.RE +.sp +\fBleft_padding\fP [\fI\fP] +.RS 4 +Padding added at the left side of the selected space. +.RE +.sp +\fBright_padding\fP [\fI\fP] +.RS 4 +Padding added at the right side of the selected space. +.RE +.sp +\fBwindow_gap\fP [\fI\fP] +.RS 4 +Size of the gap that separates windows for the selected space. +.RE +.sp +\fBauto_balance\fP [\fI|x\-axis|y\-axis\fP] +.RS 4 +Balance the window tree upon change, so that all windows occupy an equally sized area. +.RE +.SS "Display" +.SS "General Syntax" +.sp +yabai \-m display [\fI] \fI\fP +.SS "COMMAND" +.sp +\fB\-\-focus\fP \fI\fP +.RS 4 +Focus the given display. +.RE +.sp +\fB\-\-space\fP \fI\fP +.RS 4 +The given space will become visible on the selected display, without changing focus. +.br +The given space must belong to the selected display. +.br +System Integrity Protection must be partially disabled. +.RE +.sp +\fB\-\-label\fP [\fI