Added: Darwin Config
This commit is contained in:
165
darwin/yabari.nix
Normal file
165
darwin/yabari.nix
Normal file
@@ -0,0 +1,165 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.yabai = {
|
||||
enable = true;
|
||||
enableScriptingAddition = true;
|
||||
config = {
|
||||
focus_follows_mouse = "autoraise";
|
||||
mouse_follows_focus = "on";
|
||||
window_placement = "second_child";
|
||||
window_opacity = "off";
|
||||
window_opacity_duration = "0.0";
|
||||
active_window_opacity = "1.0";
|
||||
normal_window_opacity = "1.0";
|
||||
split_ratio = "0.50";
|
||||
auto_balance = "off";
|
||||
mouse_modifier = "fn";
|
||||
mouse_action1 = "move";
|
||||
mouse_action2 = "resize";
|
||||
layout = "bsp";
|
||||
top_padding = 5;
|
||||
bottom_padding = 5;
|
||||
left_padding = 5;
|
||||
right_padding = 5;
|
||||
window_gap = 5;
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
yabai -m space 1 --label main
|
||||
yabai -m space 2 --label browser
|
||||
yabai -m space 3 --label terminal
|
||||
'';
|
||||
};
|
||||
|
||||
services.skhd = {
|
||||
enable = true;
|
||||
skhdConfig = ''
|
||||
# Focus workspace 1-9 with alt + number
|
||||
alt - 1 : yabai -m space --focus main
|
||||
alt - 2 : yabai -m space --focus browser
|
||||
alt - 3 : yabai -m space --focus terminal
|
||||
alt - 4 : yabai -m space --focus 4
|
||||
alt - 5 : yabai -m space --focus 5
|
||||
alt - 6 : yabai -m space --focus 6
|
||||
alt - 7 : yabai -m space --focus 7
|
||||
alt - 8 : yabai -m space --focus 8
|
||||
alt - 9 : yabai -m space --focus 9
|
||||
|
||||
# Move focused window to workspace 1-9 with alt + shift + number
|
||||
alt + shift - 1 : yabai -m window --space 1
|
||||
alt + shift - 2 : yabai -m window --space 2
|
||||
alt + shift - 3 : yabai -m window --space 3
|
||||
alt + shift - 4 : yabai -m window --space 4
|
||||
alt + shift - 5 : yabai -m window --space 5
|
||||
alt + shift - 6 : yabai -m window --space 6
|
||||
alt + shift - 7 : yabai -m window --space 7
|
||||
alt + shift - 8 : yabai -m window --space 8
|
||||
alt + shift - 9 : yabai -m window --space 9
|
||||
|
||||
# Focus windows alt + arrow keys
|
||||
alt - left : yabai -m window --focus west
|
||||
alt - right : yabai -m window --focus east
|
||||
|
||||
# Close focused window with alt + c
|
||||
alt - c : yabai -m window --close
|
||||
|
||||
# App Shortcuts
|
||||
ctrl - q : open -a kitty --args --directory="~"
|
||||
'';
|
||||
};
|
||||
|
||||
services.sketchybar = {
|
||||
enable = true;
|
||||
config = ''
|
||||
# Bar configuration (batched together for efficiency)
|
||||
sketchybar --bar color=0x1e1e2e \
|
||||
border_color=0xffff9e2e \
|
||||
position=top \
|
||||
height=25 \
|
||||
notch_display_height=0 \
|
||||
margin=0 \
|
||||
y_offset=0 \
|
||||
corner_radius=0 \
|
||||
border_width=2 \
|
||||
blur_radius=0 \
|
||||
padding_left=0 \
|
||||
padding_right=2 \
|
||||
notch_width=200 \
|
||||
notch_offset=0 \
|
||||
display=all \
|
||||
hidden=off \
|
||||
topmost=off \
|
||||
sticky=on \
|
||||
font_smoothing=off \
|
||||
shadow=off
|
||||
|
||||
# Default item properties
|
||||
sketchybar --default updates=when_shown \
|
||||
icon.font="Hack Nerd Font:Bold:14.0" \
|
||||
icon.color=0xffcdd6f4 \
|
||||
label.font="Hack Nerd Font:Regular:12.0" \
|
||||
label.color=0xffcdd6f4
|
||||
|
||||
# Left items - Date and time
|
||||
sketchybar --add item date left \
|
||||
--set date icon= \
|
||||
label="$(date '+%a %d %b')" \
|
||||
script='while true; do sketchybar --set date label="$(date "+%a %d %b")"; sleep 300; done' \
|
||||
update_freq=300
|
||||
|
||||
sketchybar --add item time left \
|
||||
--set time icon= \
|
||||
label="$(date '+%H:%M')" \
|
||||
script='while true; do sketchybar --set time label="$(date "+%H:%M")"; sleep 60; done' \
|
||||
update_freq=60
|
||||
|
||||
# Center items - Active window title
|
||||
sketchybar --add item title center \
|
||||
--set title label="Desktop" \
|
||||
script='sketchybar --set title label="$INFO"'
|
||||
|
||||
# Right items - System info
|
||||
sketchybar --add item cpu right \
|
||||
--set cpu icon= \
|
||||
label="?" \
|
||||
script='~/.config/sketchybar/plugins/cpu.sh' \
|
||||
update_freq=5
|
||||
|
||||
sketchybar --add item ram right \
|
||||
--set ram icon= \
|
||||
label="?" \
|
||||
script='~/.config/sketchybar/plugins/ram.sh' \
|
||||
update_freq=5
|
||||
|
||||
sketchybar --add item battery right \
|
||||
--set battery icon= \
|
||||
label="?" \
|
||||
script='~/.config/sketchybar/plugins/battery.sh' \
|
||||
update_freq=10
|
||||
|
||||
sketchybar --add item volume right \
|
||||
--set volume icon= \
|
||||
label="?" \
|
||||
script='~/.config/sketchybar/plugins/volume.sh' \
|
||||
update_freq=1
|
||||
|
||||
sketchybar --add item wifi right \
|
||||
--set wifi icon= \
|
||||
label="?" \
|
||||
script='~/.config/sketchybar/plugins/wifi.sh' \
|
||||
update_freq=10
|
||||
|
||||
# Spacing items
|
||||
sketchybar --add item spacer_left left \
|
||||
--set spacer_left width=10
|
||||
|
||||
sketchybar --add item spacer_right right \
|
||||
--set spacer_right width=10
|
||||
|
||||
# Subscribe to events
|
||||
sketchybar --subscribe title front_app_switched \
|
||||
volume volume_change \
|
||||
battery power_source_change system_woke
|
||||
'';
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user