Skip to content

Commit

Permalink
refactor(yabai): use array for app rules
Browse files Browse the repository at this point in the history
style(zsh): modify name style of git clone for github repo

Signed-off-by: tizee <33030965+tizee@users.noreply.github.com>
  • Loading branch information
tizee committed May 22, 2024
1 parent 1f0e091 commit 2788ddc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
63 changes: 33 additions & 30 deletions yabai/yabairc
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,40 @@ yabai -m config normal_window_opacity 0.9
# ====================
# App
# ====================
# rules {{{
yabai -m rule --add app="^Mail$" space=2

# yeah, you all are free.
yabai -m rule --add app="^System Settings$" manage=off sub-layer=above
yabai -m rule --add app="^Music$" manage=off sub-layer=above
yabai -m rule --add app="^Finder$" manage=off sub-layer=above
yabai -m rule --add app="^Dictionary$" manage=off sub-layer=above
yabai -m rule --add app="^Stickies$" manage=off
yabai -m rule --add app="^Android Studio$" manage=off
yabai -m rule --add app="^DingTalk Lite$" manage=off
yabai -m rule --add app="^WeChat$" manage=off
# screenshot
yabai -m rule --add app="^OBS$" manage=off
# Spotlight alternative
yabai -m rule --add app="^Raycast$" manage=off sub-layer=above
# Microsoft Remote Desktop
yabai -m rule --add app="^Microsoft Remote Desktop$" manage=off sub-layer=above
yabai -m rule --add app="^LookAway$" manage=off sub-layer=above
yabai -m rule --add app="^Hammerspoon$" manage=off sub-layer=above
yabai -m rule --add app="^Karabiner-Elements$" manage=off sub-layer=above
yabai -m rule --add app="^Reeder$" manage=off sub-layer=above
yabai -m rule --add app="^Neat$" manage=off sub-layer=above
yabai -m rule --add app="^Bruno$" manage=off sub-layer=above
yabai -m rule --add app="^DeepL$" manage=off sub-layer=above

# }}}
apps=(
"Mail"
"Books"
"calibre"
"E-book Viewer"
"Reeder"
"System Settings"
"Music"
"Finder"
"Dictionary"
"Stickies"
"Android Studio"
"DingTalk Lite"
"WeChat"
# screenshot
"OBS"
# Spotlight alternative
"Raycast"
# Microsoft Remote Desktop
"Microsoft Remote Desktop"
"Hammerspoon"
"Karabiner-Elements"
"Reeder"
"Bruno"
"DeepL"
)

# disable management
for item in "${apps[@]}"; do
yabai -m rule --add app="^${item}$" manage=off sub-layer=above
done

# --verbose to display
echo "yabai configuration loaded.."
# ====================
# JankyBorders
# ====================
Expand All @@ -145,8 +150,6 @@ borders_options=(
width=6.0
)

borders "${borders_options[@]}" &

echo "yabai configuration loaded.."
# borders "${borders_options[@]}" &

# vim marker
4 changes: 2 additions & 2 deletions zsh/plugins/yogit.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ function yogit::shallowclone_github() {
local repo_name=$(echo $1 | sed -nE 's#(https?://github.com/|git@github.com:)([^/]+)/([^/]+)(\.git)?$#\3#p' | sed -nE 's/\.git$//p')
print "clone with --depth 1 --recurse-submodules -j8 --shallow-submodules"
if [[ $# > 1 ]]; then
git clone $@ --depth 1 --recurse-submodules -j8 --shallow-submodules "${organ}-${repo_name}"
git clone $@ --depth 1 --recurse-submodules -j8 --shallow-submodules "${organ}.${repo_name}"
else
git clone $1 --depth 1 --recurse-submodules -j8 --shallow-submodules "${organ}-${repo_name}"
git clone $1 --depth 1 --recurse-submodules -j8 --shallow-submodules "${organ}.${repo_name}"
fi
}

Expand Down

0 comments on commit 2788ddc

Please sign in to comment.