auto-terminal-profile 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/update-profile.js +6 -2
- package/changelog.md +7 -1
- package/cli.js +5 -5
- package/package.json +5 -4
- package/readme.md +9 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import darkMode from 'dark-mode';
|
|
2
|
-
import {setTerminalProfile} from 'terminal-profile';
|
|
2
|
+
import {setTerminalProfile, setTerminalDefaultProfile} from 'terminal-profile';
|
|
3
3
|
import {config} from '../config.js';
|
|
4
4
|
|
|
5
5
|
export async function updateProfile() {
|
|
@@ -12,6 +12,10 @@ export async function updateProfile() {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const mode = (await darkMode.isEnabled()) ? 'dark' : 'light';
|
|
15
|
+
const profile = config[`${mode}Profile`];
|
|
15
16
|
|
|
16
|
-
await
|
|
17
|
+
await Promise.all([
|
|
18
|
+
setTerminalProfile(profile),
|
|
19
|
+
setTerminalDefaultProfile(profile),
|
|
20
|
+
]);
|
|
17
21
|
}
|
package/changelog.md
CHANGED
|
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [1.2.0](https://github.com/patrik-csak/auto-terminal-profile/compare/v1.0.1...v1.2.0) – 2023-03-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Update Terminal’s default profile on appearance mode switch so that Terminal will use the correct profile when opened after appearance mode switch.
|
|
13
|
+
|
|
14
|
+
## [1.0.1](https://github.com/patrik-csak/auto-terminal-profile/compare/v1.0.0...v1.0.1) – 2022-12-03
|
|
9
15
|
|
|
10
16
|
### Added
|
|
11
17
|
|
package/cli.js
CHANGED
|
@@ -18,14 +18,14 @@ program
|
|
|
18
18
|
program
|
|
19
19
|
.command('disable')
|
|
20
20
|
.description(
|
|
21
|
-
'
|
|
21
|
+
'disable automatic macOS Terminal profile switching based on system dark / light mode',
|
|
22
22
|
)
|
|
23
23
|
.action(disable);
|
|
24
24
|
|
|
25
25
|
program
|
|
26
26
|
.command('enable')
|
|
27
27
|
.description(
|
|
28
|
-
'
|
|
28
|
+
'enable automatic macOS Terminal profile switching based on system dark / light mode',
|
|
29
29
|
)
|
|
30
30
|
.option(
|
|
31
31
|
'--dark-profile <profile>',
|
|
@@ -40,20 +40,20 @@ program
|
|
|
40
40
|
for (const mode of ['dark', 'light']) {
|
|
41
41
|
program
|
|
42
42
|
.command(`set-${mode}-profile`)
|
|
43
|
-
.description(`
|
|
43
|
+
.description(`set the Terminal profile to use in ${mode} mode`)
|
|
44
44
|
.argument('<profile>')
|
|
45
45
|
.action((profile) => setModeProfile({mode, profile}));
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
program
|
|
49
49
|
.command('status')
|
|
50
|
-
.description('
|
|
50
|
+
.description('show status and configuration')
|
|
51
51
|
.action(status);
|
|
52
52
|
|
|
53
53
|
program
|
|
54
54
|
.command('update-profile')
|
|
55
55
|
.description(
|
|
56
|
-
'
|
|
56
|
+
'update the profile of currently running Terminal windows / tabs',
|
|
57
57
|
)
|
|
58
58
|
.action(updateProfile);
|
|
59
59
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auto-terminal-profile",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Automatically switch the macOS Terminal profile based on the system-wide dark / light appearance mode",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"macos",
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": "Patrik Csak <p@trikcsak.com>",
|
|
14
|
+
"funding": "https://www.buymeacoffee.com/patrikcsak",
|
|
14
15
|
"bin": "./cli.js",
|
|
15
|
-
"repository": "github:
|
|
16
|
+
"repository": "github:patrik-csak/auto-terminal-profile",
|
|
16
17
|
"scripts": {
|
|
17
18
|
"format": "xo --fix",
|
|
18
19
|
"test": "xo"
|
|
@@ -25,14 +26,14 @@
|
|
|
25
26
|
"execa": "^6.1.0",
|
|
26
27
|
"pupa": "^3.1.0",
|
|
27
28
|
"read-pkg-up": "^9.1.0",
|
|
28
|
-
"terminal-profile": "^1.0
|
|
29
|
+
"terminal-profile": "^1.2.0",
|
|
29
30
|
"untildify": "^4.0.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"xo": "^0.53.1"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
35
|
-
"node": "14
|
|
36
|
+
"node": ">=14 <=19"
|
|
36
37
|
},
|
|
37
38
|
"os": [
|
|
38
39
|
"darwin"
|
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@ Automatically switch the macOS Terminal profile based on the system-wide dark /
|
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
|
-
- [Node.js](https://nodejs.org/en/) 14
|
|
9
|
+
- [Node.js](https://nodejs.org/en/) 14–19
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -16,27 +16,18 @@ npm install --global auto-terminal-profile
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
+
To get started, enable automatic profile switching and set your preferred dark and light mode profiles:
|
|
20
|
+
|
|
19
21
|
```sh
|
|
20
|
-
auto-terminal-profile
|
|
22
|
+
auto-terminal-profile enable \
|
|
23
|
+
--dark-profile='One Dark' \
|
|
24
|
+
--light-profile='One Light'
|
|
21
25
|
```
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
Usage: auto-terminal-profile [options] [command]
|
|
27
|
+
For more information view the help output:
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Options:
|
|
29
|
-
-V, --version output the version number
|
|
30
|
-
-h, --help display help for command
|
|
31
|
-
|
|
32
|
-
Commands:
|
|
33
|
-
disable Disable automatic macOS Terminal profile switching based on system dark / light mode
|
|
34
|
-
enable [options] Enable automatic macOS Terminal profile switching based on system dark / light mode
|
|
35
|
-
set-dark-profile <profile> Set the Terminal profile to use in dark mode
|
|
36
|
-
set-light-profile <profile> Set the Terminal profile to use in light mode
|
|
37
|
-
status Show status and configuration
|
|
38
|
-
update-profile Update the profile of currently running Terminal windows / tabs
|
|
39
|
-
help [command] display help for command
|
|
29
|
+
```sh
|
|
30
|
+
auto-terminal-profile --help
|
|
40
31
|
```
|
|
41
32
|
|
|
42
33
|
## Acknowledgements
|