feat!(limontozu): add config
This commit is contained in:
parent
80ec62084d
commit
c5c43e9fc5
15 changed files with 789 additions and 49 deletions
|
@ -78,11 +78,11 @@ in
|
|||
# enabled = true;
|
||||
# };
|
||||
|
||||
# dunst on wayland
|
||||
services.wired = {
|
||||
enable = true;
|
||||
config = ./wired.ron;
|
||||
};
|
||||
# # dunst on wayland
|
||||
# services.wired = {
|
||||
# enable = true;
|
||||
# config = ./wired.ron;
|
||||
# };
|
||||
};
|
||||
|
||||
meta = {
|
||||
|
|
|
@ -100,12 +100,12 @@ in
|
|||
}
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
file = "F-Sy-H.plugin.zsh";
|
||||
file = "fast-syntax-highlighting.plugin.zsh";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zdharma";
|
||||
owner = "zdharma-continuum";
|
||||
repo = "fast-syntax-highlighting";
|
||||
rev = "285d6ce8e1d9c7a70b427c46a4030d43e7a6406b";
|
||||
sha256 = "4kma7Sx2RGWa9J4gr+U89ArxpM2/b8H9ytQ2pNCv6is=";
|
||||
rev = "13d7b4e63468307b6dcb2dadf6150818f242cbff";
|
||||
sha256 = "sha256-AmsexwVombgVmRvl4O9Kd/WbnVJHPTXETxBv18PDHz4=";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
|
@ -40,10 +40,10 @@ M.freetype_render_target = "Light"
|
|||
--------------------
|
||||
-- Window options --
|
||||
--------------------
|
||||
-- M.window_background_opacity = 0.2
|
||||
-- M.text_background_opacity = 1.0
|
||||
M.window_background_opacity = 0.8
|
||||
M.text_background_opacity = 1.0
|
||||
-- M.window_background_image = "/home/reo101/.local/share/bg/ide_bg.jpeg"
|
||||
M.window_decorations = "NONE"
|
||||
-- M.window_decorations = "NONE"
|
||||
M.window_close_confirmation = "NeverPrompt"
|
||||
M.use_resize_increments = false
|
||||
M.enable_scroll_bar = false
|
||||
|
|
74
modules/nix-darwin/brew/default.nix
Normal file
74
modules/nix-darwin/brew/default.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.reo101.brew;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
|
||||
options = {
|
||||
reo101.brew = {
|
||||
enable = mkEnableOption "reo101 brew config";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Requires Homebrew to be installed
|
||||
system.activationScripts.preUserActivation.text = ''
|
||||
if ! xcode-select --version 2>/dev/null; then
|
||||
$DRY_RUN_CMD xcode-select --install
|
||||
fi
|
||||
if ! /usr/local/bin/brew --version 2>/dev/null; then
|
||||
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
fi
|
||||
'';
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
onActivation = {
|
||||
autoUpdate = false; # Don't update during rebuild
|
||||
upgrade = true;
|
||||
cleanup = "zap"; # Uninstall all programs not declared
|
||||
};
|
||||
global = {
|
||||
brewfile = true; # Run brew bundle from anywhere
|
||||
lockfiles = false; # Don't save lockfile (since running from anywhere)
|
||||
};
|
||||
taps = [
|
||||
"homebrew/core"
|
||||
"homebrew/cask"
|
||||
"homebrew/cask-fonts"
|
||||
"homebrew/cask-drivers"
|
||||
"homebrew/services"
|
||||
"cmacrae/formulae"
|
||||
"FelixKratz/formulae"
|
||||
];
|
||||
brews = [
|
||||
"libusb"
|
||||
"sketchybar"
|
||||
"switchaudio-osx"
|
||||
];
|
||||
casks = [
|
||||
"android-platform-tools"
|
||||
"discord"
|
||||
"docker"
|
||||
"font-fira-code-nerd-font"
|
||||
"karabiner-elements"
|
||||
"scroll-reverser"
|
||||
"sf-symbols"
|
||||
# "slack"
|
||||
"spotify"
|
||||
];
|
||||
extraConfig = ''
|
||||
# brew "xorpse/formulae/brew", args: ["HEAD"]
|
||||
cask_args appdir: "~/Applications"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ reo101 ];
|
||||
};
|
||||
}
|
|
@ -4,4 +4,7 @@
|
|||
{
|
||||
# List your module files here
|
||||
# my-module = import ./my-module.nix;
|
||||
brew = import ./brew;
|
||||
yabai = import ./yabai;
|
||||
system = import ./system;
|
||||
}
|
||||
|
|
257
modules/nix-darwin/system/default.nix
Normal file
257
modules/nix-darwin/system/default.nix
Normal file
|
@ -0,0 +1,257 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.reo101.system;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
|
||||
options = {
|
||||
reo101.system = {
|
||||
enable = mkEnableOption "reo101 MacOS system config";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.nix-daemon.enable = true;
|
||||
|
||||
environment.shells = [ pkgs.zsh ];
|
||||
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
system = {
|
||||
|
||||
keyboard = {
|
||||
remapCapsLockToControl = true;
|
||||
enableKeyMapping = true; # Allows for skhd
|
||||
};
|
||||
|
||||
defaults = {
|
||||
NSGlobalDomain = {
|
||||
|
||||
# Set to dark mode
|
||||
AppleInterfaceStyle = "Dark";
|
||||
|
||||
# Don't change from dark to light automatically
|
||||
# AppleInterfaceSwitchesAutomatically = false;
|
||||
|
||||
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
|
||||
AppleKeyboardUIMode = 3;
|
||||
|
||||
# Automatically show and hide the menu bar
|
||||
_HIHideMenuBar = true;
|
||||
|
||||
# Expand save panel by default
|
||||
NSNavPanelExpandedStateForSaveMode = true;
|
||||
|
||||
# Expand print panel by default
|
||||
PMPrintingExpandedStateForPrint = true;
|
||||
|
||||
# Replace press-and-hold with key repeat
|
||||
ApplePressAndHoldEnabled = false;
|
||||
|
||||
# Set a fast key repeat rate
|
||||
KeyRepeat = 2;
|
||||
|
||||
# Shorten delay before key repeat begins
|
||||
InitialKeyRepeat = 12;
|
||||
|
||||
# Save to local disk by default, not iCloud
|
||||
NSDocumentSaveNewDocumentsToCloud = false;
|
||||
|
||||
# Disable autocorrect capitalization
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
|
||||
# Disable autocorrect smart dashes
|
||||
NSAutomaticDashSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect adding periods
|
||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect smart quotation marks
|
||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect spellcheck
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
|
||||
# (Effectively) disable resize animations
|
||||
NSWindowResizeTime = 0.003;
|
||||
|
||||
# Disable scrollbar animations
|
||||
NSScrollAnimationEnabled = false;
|
||||
|
||||
# Disable automatic window animations
|
||||
NSAutomaticWindowAnimationsEnabled = false;
|
||||
};
|
||||
|
||||
dock = {
|
||||
|
||||
# Automatically show and hide the dock
|
||||
autohide = true;
|
||||
|
||||
# Add translucency in dock for hidden applications
|
||||
showhidden = true;
|
||||
|
||||
# Enable spring loading on all dock items
|
||||
enable-spring-load-actions-on-all-items = true;
|
||||
|
||||
# Highlight hover effect in dock stack grid view
|
||||
mouse-over-hilite-stack = true;
|
||||
|
||||
mineffect = "genie";
|
||||
orientation = "bottom";
|
||||
show-recents = false;
|
||||
tilesize = 44;
|
||||
};
|
||||
|
||||
finder = {
|
||||
|
||||
# Default Finder window set to column view
|
||||
FXPreferredViewStyle = "clmv";
|
||||
|
||||
# Finder search in current folder by default
|
||||
FXDefaultSearchScope = "SCcf";
|
||||
|
||||
# Disable warning when changing file extension
|
||||
FXEnableExtensionChangeWarning = false;
|
||||
|
||||
# Allow quitting of Finder application
|
||||
QuitMenuItem = true;
|
||||
};
|
||||
|
||||
# Disable "Are you sure you want to open" dialog
|
||||
LaunchServices.LSQuarantine = false;
|
||||
|
||||
# Disable trackpad tap to click
|
||||
trackpad.Clicking = false;
|
||||
|
||||
# universalaccess = {
|
||||
# # Zoom in with Control + Scroll Wheel
|
||||
# closeViewScrollWheelToggle = true;
|
||||
# closeViewZoomFollowsFocus = true;
|
||||
# };
|
||||
|
||||
# Where to save screenshots
|
||||
screencapture.location = "~/Downloads";
|
||||
};
|
||||
|
||||
# Settings that don't have an option in nix-darwin
|
||||
activationScripts.postActivation.text = ''
|
||||
echo "Disable disk image verification"
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
|
||||
echo "Avoid creating .DS_Store files on network volumes"
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
|
||||
echo "Disable the warning before emptying the Trash"
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
|
||||
echo "Require password immediately after sleep or screen saver begins"
|
||||
defaults write com.apple.screensaver askForPassword -int 1
|
||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
||||
|
||||
echo "Allow apps from anywhere"
|
||||
SPCTL="$(spctl --status)"
|
||||
if ! [ "$\{SPCTL}" = "assessments disabled" ]; then
|
||||
sudo spctl --master-disable
|
||||
fi
|
||||
'';
|
||||
|
||||
# User-level settings
|
||||
activationScripts.postUserActivation.text = ''
|
||||
echo "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library
|
||||
|
||||
echo "Enable dock magnification"
|
||||
defaults write com.apple.dock magnification -bool true
|
||||
|
||||
echo "Set dock magnification size"
|
||||
defaults write com.apple.dock largesize -int 48
|
||||
|
||||
echo "Set dock autohide delays (0)"
|
||||
defaults write com.apple.dock autohide-time-modifier -float 0
|
||||
defaults write com.apple.dock autohide-delay -float 0
|
||||
defaults write com.apple.dock expose-animation-duration -float 0
|
||||
defaults write com.apple.dock springboard-show-duration -float 0
|
||||
defaults write com.apple.dock springboard-hide-duration -float 0
|
||||
defaults write com.apple.dock springboard-page-duration -float 0
|
||||
|
||||
echo "Disable Finder animations"
|
||||
defaults write com.apple.finder DisableAllAnimations -bool true
|
||||
|
||||
echo "Disable Mail animations"
|
||||
defaults write com.apple.Mail DisableSendAnimations -bool true
|
||||
defaults write com.apple.Mail DisableReplyAnimations -bool true
|
||||
|
||||
echo "Define dock icon function"
|
||||
__dock_item() {
|
||||
echo "${
|
||||
lib.pipe
|
||||
''
|
||||
<dict>
|
||||
<key>
|
||||
tile-data
|
||||
</key>
|
||||
<dict>
|
||||
<key>
|
||||
file-data
|
||||
</key>
|
||||
<dict>
|
||||
<key>
|
||||
_CFURLString
|
||||
</key>
|
||||
<string>
|
||||
$\{1}
|
||||
</string>
|
||||
<key>
|
||||
_CFURLStringType
|
||||
</key>
|
||||
<integer>
|
||||
0
|
||||
</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
''
|
||||
[
|
||||
(lib.splitString "\n")
|
||||
(map
|
||||
(lib.flip lib.pipe
|
||||
[
|
||||
(builtins.match "[[:space:]]*(.*)")
|
||||
head
|
||||
]))
|
||||
lib.concatStrings
|
||||
]
|
||||
}"
|
||||
}
|
||||
|
||||
echo "Choose and order dock icons"
|
||||
defaults write com.apple.dock persistent-apps -array \
|
||||
"$(__dock_item "/System/Applications/System Settings.app")"
|
||||
'';
|
||||
# defaults write com.apple.dock persistent-apps -array \
|
||||
# "$(__dock_item /Applications/1Password.app)" \
|
||||
# "$(__dock_item ${pkgs.slack}/Applications/Slack.app)" \
|
||||
# "$(__dock_item /System/Applications/Calendar.app)" \
|
||||
# "$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
|
||||
# "$(__dock_item /System/Applications/Messages.app)" \
|
||||
# "$(__dock_item /System/Applications/Mail.app)" \
|
||||
# "$(__dock_item /Applications/Mimestream.app)" \
|
||||
# "$(__dock_item /Applications/zoom.us.app)" \
|
||||
# "$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
|
||||
# "$(__dock_item /Applications/Obsidian.app)" \
|
||||
# "$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
|
||||
# "$(__dock_item /System/Applications/System\ Settings.app)"
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ reo101 ];
|
||||
};
|
||||
}
|
42
modules/nix-darwin/yabai/default.nix
Normal file
42
modules/nix-darwin/yabai/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.reo101.yabai;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
|
||||
options = {
|
||||
reo101.yabai = {
|
||||
enable = mkEnableOption "reo101 yabai config";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services= {
|
||||
yabai = {
|
||||
enable = true;
|
||||
package = pkgs.yabai;
|
||||
enableScriptingAddition = true;
|
||||
extraConfig = (builtins.readFile ./yabairc);
|
||||
};
|
||||
|
||||
skhd = {
|
||||
enable = true;
|
||||
package = pkgs.skhd;
|
||||
skhdConfig = (builtins.readFile ./skhdrc);
|
||||
};
|
||||
|
||||
# sketchybar = {
|
||||
# enable = true;
|
||||
# package = pkgs.sketchybar;
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ reo101 ];
|
||||
};
|
||||
}
|
106
modules/nix-darwin/yabai/skhdrc
Normal file
106
modules/nix-darwin/yabai/skhdrc
Normal file
|
@ -0,0 +1,106 @@
|
|||
# Open WezTerm
|
||||
cmd - return : wezterm
|
||||
|
||||
# Close window
|
||||
cmd - q : yabai -m window --close
|
||||
|
||||
# Navigation
|
||||
alt - h : yabai -m window --focus west || yabai -m display --focus west
|
||||
alt - j : yabai -m window --focus south || yabai -m display --focus south
|
||||
alt - k : yabai -m window --focus north || yabai -m display --focus north
|
||||
alt - l : yabai -m window --focus east || yabai -m display --focus east
|
||||
alt - n : yabai -m window --focus next
|
||||
alt - p : yabai -m window --focus last
|
||||
|
||||
# Focus workspace
|
||||
cmd - 1 : yabai -m space --focus 1
|
||||
cmd - 2 : yabai -m space --focus 2
|
||||
cmd - 3 : yabai -m space --focus 3
|
||||
cmd - 4 : yabai -m space --focus 4
|
||||
cmd - 5 : yabai -m space --focus 5
|
||||
cmd - 6 : yabai -m space --focus 6
|
||||
cmd - 7 : yabai -m space --focus 7
|
||||
cmd - 8 : yabai -m space --focus 8
|
||||
cmd - 9 : yabai -m space --focus 9
|
||||
cmd - tab : yabai -m space --focus recent
|
||||
# cmd - ; : yabai -m space --focus next
|
||||
|
||||
# Moving windows
|
||||
shift + alt - h : yabai -m window --warp west
|
||||
shift + alt - j : yabai -m window --warp south
|
||||
shift + alt - k : yabai -m window --warp north
|
||||
shift + alt - l : yabai -m window --warp east
|
||||
|
||||
# Move container to workspace
|
||||
shift + cmd - m : yabai -m window --space last; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - p : yabai -m window --space prev; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - n : yabai -m window --space next; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 1 : yabai -m window --space 1; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 2 : yabai -m window --space 2; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 3 : yabai -m window --space 3; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 4 : yabai -m window --space 4; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 5 : yabai -m window --space 5; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 6 : yabai -m window --space 6; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 7 : yabai -m window --space 7; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 8 : yabai -m window --space 8; sketchybar --trigger windows_on_spaces
|
||||
shift + cmd - 9 : yabai -m window --space 9; sketchybar --trigger windows_on_spaces
|
||||
|
||||
# Move focus container to workspace
|
||||
shift + alt - m : yabai -m window --space last; yabai -m space --focus last; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - p : yabai -m window --space prev; yabai -m space --focus prev; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - n : yabai -m window --space next; yabai -m space --focus next; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 6 : yabai -m window --space 6; yabai -m space --focus 6; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 7 : yabai -m window --space 7; yabai -m space --focus 7; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 8 : yabai -m window --space 8; yabai -m space --focus 8; sketchybar --trigger windows_on_spaces
|
||||
shift + alt - 9 : yabai -m window --space 9; yabai -m space --focus 9; sketchybar --trigger windows_on_spaces
|
||||
|
||||
# Resize windows
|
||||
lctrl + alt - h : yabai -m window --resize left:-50:0; \
|
||||
yabai -m window --resize right:-50:0
|
||||
lctrl + alt - j : yabai -m window --resize bottom:0:50; \
|
||||
yabai -m window --resize top:0:50
|
||||
lctrl + alt - k : yabai -m window --resize top:0:-50; \
|
||||
yabai -m window --resize bottom:0:-50
|
||||
lctrl + alt - l : yabai -m window --resize right:50:0; \
|
||||
yabai -m window --resize left:50:0
|
||||
|
||||
# Equalize size of windows
|
||||
lctrl + alt - e : yabai -m space --balance
|
||||
|
||||
# Enable / Disable gaps in current workspace
|
||||
lctrl + alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
|
||||
|
||||
# Rotate windows clockwise and anticlockwise
|
||||
alt - r : yabai -m space --rotate 270
|
||||
shift + alt - r : yabai -m space --rotate 90
|
||||
|
||||
# Rotate on X and Y Axis
|
||||
shift + alt - x : yabai -m space --mirror x-axis
|
||||
shift + alt - y : yabai -m space --mirror y-axis
|
||||
|
||||
# Set insertion point for focused container
|
||||
shift + lctrl + alt - h : yabai -m window --insert west
|
||||
shift + lctrl + alt - j : yabai -m window --insert south
|
||||
shift + lctrl + alt - k : yabai -m window --insert north
|
||||
shift + lctrl + alt - l : yabai -m window --insert east
|
||||
|
||||
# Float / Unfloat window
|
||||
shift + cmd - space : \
|
||||
yabai -m window --toggle float; \
|
||||
yabai -m window --toggle border; \
|
||||
sketchybar --trigger window_focus
|
||||
|
||||
# Restart Yabai
|
||||
shift + lctrl + alt - r : \
|
||||
/usr/bin/env osascript <<< \
|
||||
"display notification \"Restarting Yabai\" with title \"Yabai\""; \
|
||||
launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"
|
||||
|
||||
# Make window native fullscreen
|
||||
alt - f : yabai -m window --toggle zoom-fullscreen; sketchybar --trigger window_focus
|
||||
shift + alt - f : yabai -m window --toggle native-fullscreen
|
85
modules/nix-darwin/yabai/yabairc
Normal file
85
modules/nix-darwin/yabai/yabairc
Normal file
|
@ -0,0 +1,85 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
# Unload the macOS WindowManager process
|
||||
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=window_focused action="sketchybar --trigger window_focus"
|
||||
yabai -m signal --add event=display_added action="sleep 2 && ${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_destroyed action="sketchybar --trigger windows_on_spaces"
|
||||
yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
|
||||
yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
|
||||
|
||||
{
|
||||
DESIRED_SPACES_PER_DISPLAY=4
|
||||
CURRENT_SPACES="$(yabai -m query --displays | jq -r '.[].spaces | @sh')"
|
||||
|
||||
DELTA=0
|
||||
while read -r line
|
||||
do
|
||||
LAST_SPACE="$(echo "${line##* }")"
|
||||
LAST_SPACE=$((${LAST_SPACE}+${DELTA}))
|
||||
EXISTING_SPACE_COUNT="$(echo "${line}" | wc -w)"
|
||||
MISSING_SPACES=$((${DESIRED_SPACES_PER_DISPLAY} - ${EXISTING_SPACE_COUNT}))
|
||||
if [ "${MISSING_SPACES}" -gt 0 ]; then
|
||||
for i in $(seq 1 ${MISSING_SPACES}); do
|
||||
yabai -m space --create "${LAST_SPACE}"
|
||||
LAST_SPACE=$((${LAST_SPACE}+1))
|
||||
done
|
||||
elif [ "${MISSING_SPACES}" -lt 0 ]; then
|
||||
for i in $(seq 1 $((-${MISSING_SPACES}))); do
|
||||
yabai -m space --destroy "${LAST_SPACE}"
|
||||
LAST_SPACE=$((${LAST_SPACE}-1))
|
||||
done
|
||||
fi
|
||||
DELTA=$((${DELTA}+${MISSING_SPACES}))
|
||||
done <<< "${CURRENT_SPACES}"
|
||||
|
||||
sketchybar --trigger space_change --trigger windows_on_spaces
|
||||
}
|
||||
|
||||
yabai -m config "external_bar" "all:49:0" \
|
||||
"window_border" "on" \
|
||||
"mouse_follows_focus" "off" \
|
||||
"focus_follows_mouse" "autoraise" \
|
||||
"window_zoom_persist" "off" \
|
||||
"window_placement" "second_child" \
|
||||
"window_topmost" "off" \
|
||||
"window_shadow" "float" \
|
||||
"window_opacity" "on" \
|
||||
"window_opacity_duration" "0.15" \
|
||||
"active_window_opacity" "1.0" \
|
||||
"normal_window_opacity" "0.95" \
|
||||
"window_border_width" "2" \
|
||||
"window_border_hidpi" "off" \
|
||||
"window_border_radius" "11" \
|
||||
"window_animation_duration" "0.22" \
|
||||
"active_window_border_color" "0xffe1e3e4" \
|
||||
"normal_window_border_color" "0xff2a2f38" \
|
||||
"insert_feedback_color" "0xff9dd274" \
|
||||
"split_ratio" "0.50" \
|
||||
"auto_balance" "off" \
|
||||
"mouse_modifier" "cmd" \
|
||||
"mouse_action1" "move" \
|
||||
"mouse_action2" "resize" \
|
||||
"mouse_drop_action" "swap" \
|
||||
\
|
||||
"top_padding" "10" \
|
||||
"bottom_padding" "10" \
|
||||
"left_padding" "10" \
|
||||
"right_padding" "10" \
|
||||
"window_gap" "8"
|
||||
|
||||
# Exclude problematic apps from being managed:
|
||||
yabai -m rule --add app="^(LuLu|Vimac|Calculator|Software Update|Dictionary|VLC|System Preferences|System Settings|zoom.us|Photo Booth|Archive Utility|Python|LibreOffice|App Store|Steam|Alfred|Activity Monitor)$" manage=off
|
||||
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" 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="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 config layout bsp
|
||||
|
||||
echo "yabai configuration loaded.."
|
Loading…
Add table
Add a link
Reference in a new issue