aerospace: create script to toggle tiling
This commit is contained in:
parent
0d75b9d258
commit
63cad61e35
2 changed files with 47 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ alt-shift-f = 'exec-and-forget open ~'
|
||||||
alt-shift-b = 'exec-and-forget /opt/homebrew/bin/firefox --new-window'
|
alt-shift-b = 'exec-and-forget /opt/homebrew/bin/firefox --new-window'
|
||||||
alt-s = 'exec-and-forget screencapture -i -c'
|
alt-s = 'exec-and-forget screencapture -i -c'
|
||||||
|
|
||||||
|
alt-shift-w = 'exec-and-forget $HOME/.config/aerospace/toggle-tiling.sh off'
|
||||||
|
|
||||||
# Layout
|
# Layout
|
||||||
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
|
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
|
||||||
alt-c = 'layout tiles horizontal vertical'
|
alt-c = 'layout tiles horizontal vertical'
|
||||||
|
|
|
||||||
45
stow/.config/aerospace/toggle-tiling.sh
Executable file
45
stow/.config/aerospace/toggle-tiling.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
disableTiling () {
|
||||||
|
defaults write com.apple.dock orientation bottom
|
||||||
|
defaults write com.apple.dock autohide -bool FALSE
|
||||||
|
defaults write com.apple.finder CreateDesktop true
|
||||||
|
|
||||||
|
killall Finder Dock sketchybar borders
|
||||||
|
|
||||||
|
aerospace enable off # fails when script called from aerospace directly, bin not in path
|
||||||
|
/run/current-system/sw/bin/aerospace enable off
|
||||||
|
|
||||||
|
osascript -e 'tell application "System Events"
|
||||||
|
tell dock preferences
|
||||||
|
set properties to {autohide menu bar:false, autohide:false}
|
||||||
|
end tell
|
||||||
|
end tell' -e 'tell application "System Events" to set visible of (every application process whose visible is true and name is not "Finder") to false'
|
||||||
|
}
|
||||||
|
|
||||||
|
enableTiling () {
|
||||||
|
aerospace enable on
|
||||||
|
sketchybar & disown
|
||||||
|
sh ~/.cache/matugen-jankyborders.sh & disown
|
||||||
|
|
||||||
|
defaults write com.apple.dock orientation right
|
||||||
|
defaults write com.apple.dock autohide -bool FALSE
|
||||||
|
defaults write com.apple.finder CreateDesktop false
|
||||||
|
killall Dock Finder
|
||||||
|
|
||||||
|
osascript -e '
|
||||||
|
tell application "System Events"
|
||||||
|
tell dock preferences
|
||||||
|
set properties to {autohide menu bar:true, autohide:true}
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "on" ]; then
|
||||||
|
enableTiling
|
||||||
|
elif [ "$1" = "off" ]; then
|
||||||
|
disableTiling
|
||||||
|
else
|
||||||
|
echo "$0: [on|off]"
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue