Skip to content

Commit

Permalink
feat: Add Dock Orientation/Autohide (#933)
Browse files Browse the repository at this point in the history
* feat: Add Dock Orientation/Autohide

* Apply suggestions from code review

Co-authored-by: Thiago Holanda <[email protected]>

* Rename script

---------

Co-authored-by: Thiago Holanda <[email protected]>
  • Loading branch information
j3lte and unnamedd authored Apr 22, 2024
1 parent 7035516 commit ea44ba2
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
23 changes: 23 additions & 0 deletions commands/system/dock-autohide-toggle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Toggle Dock Autohide
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🤖
# @raycast.packageName System

# Documentation:
# @raycast.description Toggle the Dock Autohide
# @raycast.author Jelte Lagendijk
# @raycast.authorURL https://raycast.com/j3lte

autohide=$(defaults read com.apple.dock autohide)

if [[ $autohide == 1 ]]; then
defaults write com.apple.dock autohide -bool false; killall Dock
else
defaults write com.apple.dock autohide -bool true; killall Dock
fi
18 changes: 18 additions & 0 deletions commands/system/dock-set-autohide.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Dock Set Autohide
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🤖
# @raycast.argument1 { "type": "dropdown", "placeholder": "On/Off", "data": [{"title": "Off", "value": "false"}, {"title": "On", "value": "true"}] }
# @raycast.packageName System

# Documentation:
# @raycast.description Set the Dock autohide
# @raycast.author Jelte Lagendijk
# @raycast.authorURL https://raycast.com/j3lte

defaults write com.apple.dock autohide -bool $1; killall Dock
18 changes: 18 additions & 0 deletions commands/system/dock-set-position.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Dock Position
# @raycast.mode silent

# Optional parameters:
# @raycast.icon 🤖
# @raycast.argument1 { "type": "dropdown", "placeholder": "Position on Screen", "data": [{"title": "Left", "value": "left"}, {"title": "Right", "value": "right"}, {"title": "Bottom", "value": "bottom"}] }
# @raycast.packageName System

# Documentation:
# @raycast.description Set the position of the Dock in the screen
# @raycast.author Jelte Lagendijk
# @raycast.authorURL https://raycast.com/j3lte

defaults write com.apple.dock orientation -string $1; killall Dock

0 comments on commit ea44ba2

Please sign in to comment.