mirror of
https://github.com/yannbertrand/macos-defaults
synced 2025-03-05 07:17:19 +00:00
✨ Add finder showWindowTitlebarIcons screenshots and record script
This commit is contained in:
parent
dc49a8b14b
commit
f2a1d848d6
5 changed files with 100 additions and 0 deletions
|
@ -510,9 +510,17 @@ categories:
|
|||
examples:
|
||||
- text: Show icon in the title bar
|
||||
value: true
|
||||
image:
|
||||
filename: "true.png"
|
||||
width: 740
|
||||
height: 451
|
||||
- text: Hide icon from the title bar
|
||||
default: true
|
||||
value: false
|
||||
image:
|
||||
filename: "false.png"
|
||||
width: 740
|
||||
height: 451
|
||||
versions: [Monterey]
|
||||
after: killall Finder
|
||||
- key: NSToolbarTitleViewRolloverDelay
|
||||
|
|
BIN
images/finder/showWindowTitlebarIcons/false.png
Normal file
BIN
images/finder/showWindowTitlebarIcons/false.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
images/finder/showWindowTitlebarIcons/true.png
Normal file
BIN
images/finder/showWindowTitlebarIcons/true.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
46
record/finder/showWindowTitlebarIcons/false.js
Normal file
46
record/finder/showWindowTitlebarIcons/false.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
const MacRunner = require('../../mac-runner')
|
||||
const { compressPngImage } = require('../../utils')
|
||||
|
||||
module.exports = {
|
||||
run: async (outputPath) => {
|
||||
console.log('> Recording finder show window title bar icons to false')
|
||||
|
||||
try {
|
||||
const runner = new MacRunner()
|
||||
await runner
|
||||
.setDefault(
|
||||
'com.apple.universalaccess',
|
||||
'showWindowTitlebarIcons',
|
||||
'-bool false',
|
||||
'0'
|
||||
)
|
||||
.killApp('Finder')
|
||||
.openApp('Finder', '~')
|
||||
.captureApp('Finder', `${outputPath}/false.png`)
|
||||
.deleteDefault('com.apple.universalaccess', 'showWindowTitlebarIcons')
|
||||
.killApp('Finder')
|
||||
.run()
|
||||
} catch (runnerError) {
|
||||
logRollbackInfo()
|
||||
throw new Error(runnerError)
|
||||
}
|
||||
|
||||
try {
|
||||
await compressPngImage(`${outputPath}/false.png`, outputPath, 'false')
|
||||
} catch (compressPngImageError) {
|
||||
logRollbackInfo()
|
||||
throw new Error(compressPngImageError)
|
||||
}
|
||||
|
||||
return { filepath: `${outputPath}/false` }
|
||||
},
|
||||
}
|
||||
|
||||
function logRollbackInfo() {
|
||||
console.info(
|
||||
'Please manually run this command to make sure everything is properly reset:'
|
||||
)
|
||||
console.info(
|
||||
'defaults delete com.apple.universalaccess showWindowTitlebarIcons && killall Finder'
|
||||
)
|
||||
}
|
46
record/finder/showWindowTitlebarIcons/true.js
Normal file
46
record/finder/showWindowTitlebarIcons/true.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
const MacRunner = require('../../mac-runner')
|
||||
const { compressPngImage } = require('../../utils')
|
||||
|
||||
module.exports = {
|
||||
run: async (outputPath) => {
|
||||
console.log('> Recording finder showWindowTitlebarIcons to true')
|
||||
|
||||
try {
|
||||
const runner = new MacRunner()
|
||||
await runner
|
||||
.setDefault(
|
||||
'com.apple.universalaccess',
|
||||
'showWindowTitlebarIcons',
|
||||
'-bool true',
|
||||
'1'
|
||||
)
|
||||
.killApp('Finder')
|
||||
.openApp('Finder', '~')
|
||||
.captureApp('Finder', `${outputPath}/true.png`)
|
||||
.deleteDefault('com.apple.universalaccess', 'showWindowTitlebarIcons')
|
||||
.killApp('Finder')
|
||||
.run()
|
||||
} catch (runnerError) {
|
||||
logRollbackInfo()
|
||||
throw new Error(runnerError)
|
||||
}
|
||||
|
||||
try {
|
||||
await compressPngImage(`${outputPath}/true.png`, outputPath, 'true')
|
||||
} catch (compressPngImageError) {
|
||||
logRollbackInfo()
|
||||
throw new Error(compressPngImageError)
|
||||
}
|
||||
|
||||
return { filepath: `${outputPath}/true` }
|
||||
},
|
||||
}
|
||||
|
||||
function logRollbackInfo() {
|
||||
console.info(
|
||||
'Please manually run this command to make sure everything is properly reset:'
|
||||
)
|
||||
console.info(
|
||||
'defaults delete com.apple.universalaccess showWindowTitlebarIcons && killall Finder'
|
||||
)
|
||||
}
|
Loading…
Add table
Reference in a new issue