appear-cli 1.0.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.
Files changed (8) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +37 -0
  4. data/Rakefile +17 -0
  5. data/bin/appear +5 -0
  6. data/lib/appear.rb +27 -0
  7. data/man/appear.1 +23 -0
  8. metadata +53 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ed07f5eb3e068c1d1f4caec76e6cf9cbe6678c3cbe10f28565b965f497a15aca
4
+ data.tar.gz: 9f69261844e8ee5186e5a11523502b699028a0b04b3537b9b84dcef2b80126cb
5
+ SHA512:
6
+ metadata.gz: 68682964dc5aedcc3acc6673dfdde203adafdf0931c651276907dbe50d0a50e18e731c42ccee82e550f927ec5595b2fc143f96b5d9247a50c469108b963b47bf
7
+ data.tar.gz: d6e31d187ff0d6fabb4ac47311c65d3a7d0a6d5ada238460716ec3688b977b83973089242b2d2d8f103a789a5484eaba42068753ce356cf95611f515c6483129
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 David Blue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # appear
2
+
3
+ `appear` is a simple command line tool that allows you to change the macOS system appearance between light and dark modes.
4
+
5
+ ## Installation
6
+
7
+ To install the `appear` script and man page:
8
+
9
+ `rake install`
10
+
11
+ ---
12
+
13
+ ```man
14
+ .TH APPEAR 1 "2024" "appear 1.0" "User Commands"
15
+ .SH NAME
16
+ appear \- change macOS system appearance between light and dark mode
17
+ .SH SYNOPSIS
18
+ .B appear
19
+ [\fIlight|dark\fR]
20
+ .SH DESCRIPTION
21
+ The \fBappear\fR command changes the macOS system appearance between light and dark mode.
22
+
23
+ Use the command with one of the following arguments:
24
+ .TP
25
+ \fBlight\fR
26
+ Switch system appearance to light mode.
27
+ .TP
28
+ \fBdark\fR
29
+ Switch system appearance to dark mode.
30
+
31
+ .SH OPTIONS
32
+ .TP
33
+ \fB-h\fR, \fB--help\fR
34
+ Display this help message.
35
+ .SH AUTHOR
36
+ David Blue
37
+ ```
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require 'rake/clean'
2
+
3
+ CLEAN.include('appear.o')
4
+
5
+ desc 'Install the appear script and man page'
6
+ task :install do
7
+ sh 'cp bin/appear /usr/local/bin/appear'
8
+ sh 'chmod +x /usr/local/bin/appear'
9
+ sh 'mkdir -p /usr/local/share/man/man1'
10
+ sh 'cp man/appear.1 /usr/local/share/man/man1/appear.1'
11
+ end
12
+
13
+ desc 'Uninstall appear'
14
+ task :uninstall do
15
+ sh 'rm /usr/local/bin/appear'
16
+ sh 'rm /usr/local/share/man/man1/appear.1'
17
+ end
data/bin/appear ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/appear'
3
+
4
+ # Run the command with arguments
5
+ Appear.run(ARGV)
data/lib/appear.rb ADDED
@@ -0,0 +1,27 @@
1
+ require 'optparse'
2
+
3
+ class Appear
4
+ def self.run(args)
5
+ options = {}
6
+ OptionParser.new do |opts|
7
+ opts.banner = "Usage: appear [light|dark]"
8
+
9
+ opts.on('-h', '--help', 'Display this help') do
10
+ puts opts
11
+ exit
12
+ end
13
+ end.parse!(args)
14
+
15
+ mode = args[0]
16
+ case mode
17
+ when 'light'
18
+ system("osascript -e 'tell app \"System Events\" to tell appearance preferences to set dark mode to false'")
19
+ puts 'System appearance changed to light mode.'
20
+ when 'dark'
21
+ system("osascript -e 'tell app \"System Events\" to tell appearance preferences to set dark mode to true'")
22
+ puts 'System appearance changed to dark mode.'
23
+ else
24
+ puts 'Invalid mode. Use `light` or `dark`.'
25
+ end
26
+ end
27
+ end
data/man/appear.1 ADDED
@@ -0,0 +1,23 @@
1
+ .TH APPEAR 1 "2024" "appear 1.0" "User Commands"
2
+ .SH NAME
3
+ appear \- change macOS system appearance between light and dark mode
4
+ .SH SYNOPSIS
5
+ .B appear
6
+ [\fIlight|dark\fR]
7
+ .SH DESCRIPTION
8
+ The \fBappear\fR command changes the macOS system appearance between light and dark mode.
9
+
10
+ Use the command with one of the following arguments:
11
+ .TP
12
+ \fBlight\fR
13
+ Switch system appearance to light mode.
14
+ .TP
15
+ \fBdark\fR
16
+ Switch system appearance to dark mode.
17
+
18
+ .SH OPTIONS
19
+ .TP
20
+ \fB-h\fR, \fB--help\fR
21
+ Display this help message.
22
+ .SH AUTHOR
23
+ David Blue
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: appear-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - David Blue
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-09-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple command line tool that allows users to switch between light
14
+ and dark modes on macOS by running a command.
15
+ email:
16
+ - davidblue@extratone.com
17
+ executables:
18
+ - appear
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - LICENSE.txt
23
+ - README.md
24
+ - Rakefile
25
+ - bin/appear
26
+ - lib/appear.rb
27
+ - man/appear.1
28
+ homepage: https://github.com/extratone/appear
29
+ licenses:
30
+ - MIT
31
+ metadata:
32
+ allowed_push_host: https://rubygems.org
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 2.3.0
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubygems_version: 3.0.3.1
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: A command line tool to change macOS system appearance between light and dark
52
+ mode.
53
+ test_files: []