mirror of
https://github.com/yannbertrand/macos-defaults
synced 2024-11-14 23:57:07 +00:00
✨ Add the dock autohide command
This commit is contained in:
parent
4aff5623df
commit
ab9c53e295
3 changed files with 53 additions and 0 deletions
27
defaults.yml
27
defaults.yml
|
@ -2,6 +2,33 @@
|
|||
|
||||
categories:
|
||||
|
||||
- folder: dock
|
||||
name: Dock
|
||||
description:
|
||||
The Dock is a prominent feature of macOS.
|
||||
It is used to launch applications and to switch between running applications.
|
||||
By default you can find it on the bottom of your screen.<br><br>
|
||||
You can customize it as you like.
|
||||
image:
|
||||
filename: "dock.png"
|
||||
width: 740
|
||||
height: 41
|
||||
keys:
|
||||
- key: autohide
|
||||
domain: com.apple.dock
|
||||
title: Autohide
|
||||
description: Autohides the Dock. You can toggle the Dock using `⌥ alt`+`⌘ cmd`+`d`.
|
||||
param:
|
||||
type: bool
|
||||
examples:
|
||||
- value: false
|
||||
default: true
|
||||
text: Always display the Dock
|
||||
- value: true
|
||||
text: Autohide the Dock when the mouse is out
|
||||
versions: [Big Sur, Catalina]
|
||||
after: killall Dock
|
||||
|
||||
- folder: screenshots
|
||||
name: Screenshots
|
||||
description:
|
||||
|
|
BIN
images/dock/dock.png
Normal file
BIN
images/dock/dock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
26
record/dock/readme.js
Normal file
26
record/dock/readme.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
const delay = require('delay')
|
||||
const robot = require('robotjs')
|
||||
const { captureImage, compressPngImage } = require('../utils')
|
||||
|
||||
module.exports = {
|
||||
run: async (outputPath) => {
|
||||
console.log('> Recording dock readme screenshot')
|
||||
|
||||
// Preparation
|
||||
const { width, height } = robot.getScreenSize()
|
||||
const screenshot = `${outputPath}/dock-tmp.png`
|
||||
|
||||
await delay(2000)
|
||||
|
||||
// Screenshot
|
||||
captureImage(0, height - 80, width, 80).write(screenshot)
|
||||
|
||||
try {
|
||||
await compressPngImage(screenshot, outputPath, 'dock')
|
||||
} catch (compressPngImageError) {
|
||||
throw new Error(compressPngImageError)
|
||||
}
|
||||
|
||||
return { filepath: `${outputPath}/dock` }
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue