-
Notifications
You must be signed in to change notification settings - Fork 0
/
yabairc
executable file
·72 lines (65 loc) · 2.89 KB
/
yabairc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env sh
# bar settings
yabai -m config status_bar on
yabai -m config status_bar_text_font "Helvetica Neue:Bold:12.0"
yabai -m config status_bar_icon_font "FontAwesome:Regular:12.0"
yabai -m config status_bar_background_color 0xff202020
yabai -m config status_bar_foreground_color 0xffa8a8a8
yabai -m config status_bar_space_icon_strip 1 2 3 4 5 6 7 8 9 10
yabai -m config status_bar_power_icon_strip
yabai -m config status_bar_space_icon
yabai -m config status_bar_clock_icon time
# global settings
yabai -m config mouse_follows_focus off
yabai -m config focus_follows_mouse autofocus
yabai -m config window_placement second_child
yabai -m config window_topmost off
yabai -m config window_opacity off
yabai -m config window_opacity_duration 0.0
yabai -m config window_shadow on
yabai -m config window_border on
yabai -m config window_border_placement exterior
yabai -m config window_border_width 2
yabai -m config window_border_radius -1.0
yabai -m config active_window_border_topmost on
yabai -m config active_window_border_color 0xffFF8500
yabai -m config normal_window_border_color 0x00505050 # alpha is 0
yabai -m config insert_window_border_color 0xffd75f5f # insert means selected but focused
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.90
yabai -m config split_ratio 0.50
yabai -m config auto_balance off
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
# general space settings
yabai -m config layout bsp
yabai -m config top_padding 10
yabai -m config bottom_padding 10
yabai -m config left_padding 10
yabai -m config right_padding 10
yabai -m config window_gap 10
# update battery loop from wiki
# https://github.com/koekeishiya/yabai/wiki/Tips-and-tricks#updating-battery-icon-in-status-bar-based-on-battery-level
function update_battery_loop() {
while true; do
# Get the current battery percentage.
battery=$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)
if [ $battery -gt 84 ]; then
yabai -m config status_bar_power_icon_strip battery-full plug
elif [ $battery -gt 60 ]; then
yabai -m config status_bar_power_icon_strip battery-three-quarters plug
elif [ $battery -gt 39 ]; then
yabai -m config status_bar_power_icon_strip battery-half plug
elif [ $battery -gt 14 ]; then
yabai -m config status_bar_power_icon_strip battery-quarter plug
else
yabai -m config status_bar_power_icon_strip battery-empty plug
fi
# wait 5 seconds
sleep 5
done
}
# run the function async
update_battery_loop &
echo "yabai configuration loaded.."