Add the dock autohide command

This commit is contained in:
Yann Bertrand 2020-09-05 21:28:16 +02:00
parent 4aff5623df
commit ab9c53e295
No known key found for this signature in database
GPG key ID: F87B5B748AB00DAE
3 changed files with 53 additions and 0 deletions

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

26
record/dock/readme.js Normal file
View 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` }
}
}