Skip to content

Commit 5e9d070

Browse files
authored
Merge pull request #151 from unixorn/fix-bad-entitlement-link
Fix bad entitlement link
2 parents be369fa + 8e57554 commit 5e9d070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1136
-227
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The Tumult collection is Apache 2.0 licensed. Some scripts in the `bin` director
6767
| `disturb` | Re-enable notifications in Notification Center |
6868
| `dns-resolvers` | macOS doesn't respect `/etc/resolve.conf`, add a helper to print what it's actually using |
6969
| `do-not-disturb` | Stifle notifications in Notification Center |
70-
| `dump-entitlements` | Dumps the [entitlements](https://developer.apple.com/documentation/bundleresources/entitlements) a given macOS binary has assigned to it |
70+
| `dump-entitlements` | Dumps the [entitlements](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AboutEntitlements.html) a given macOS binary has assigned to it |
7171
| `eject-all` | Eject all removable disks |
7272
| `enable-bouncing-dock-icons` | Enable icons bouncing in your Dock |
7373
| `enable-crash-reports` | Re-enable crash report dialogs |

bin/720p

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ if [ "$(uname -a | grep -ci DARWIN)" != 1 ]; then
2121
exit 1
2222
fi
2323

24+
function check-dependency() {
25+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
26+
error "missing dependency: can't find $1"
27+
exit 1
28+
fi
29+
}
30+
check-dependency osascript
31+
2432
echo "Setting $1 bounds to 720p"
2533

2634
# 720p is 1280x720.

bin/ask-password

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
#
33
# Make it easy to ask for a password
4+
#
5+
# Copyright 2015-2025 Joe Block <[email protected]>
46

57
set -e
68

@@ -9,6 +11,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
911
exit 1
1012
fi
1113

14+
function check-dependency() {
15+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
16+
error "missing dependency: can't find $1 in your PATH"
17+
exit 1
18+
fi
19+
}
20+
check-dependency osascript
21+
1222
if [[ -z $1 ]]; then
1323
prompt="Password:"
1424
else

bin/autocorrect-disable

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
#
33
# Disable autocorrect
44
#
5-
# Copyright 2021, Joe Block <[email protected]>
5+
# Copyright 2021-2025, Joe Block <[email protected]>
6+
7+
function check-dependency() {
8+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
9+
error "missing dependency: can't find $1 in your PATH"
10+
exit 1
11+
fi
12+
}
13+
check-dependency defaults
614

715
exec defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

bin/autocorrect-enable

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
#
33
# Enable autocorrect
44
#
5-
# Copyright 2021, Joe Block <[email protected]>
5+
# Copyright 2021-2025, Joe Block <[email protected]>
6+
7+
function check-dependency() {
8+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
9+
error "missing dependency: can't find $1 in your PATH"
10+
exit 1
11+
fi
12+
}
13+
check-dependency defaults
614

715
exec defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true

bin/battery-percentage

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2015,2022 Joseph Block <[email protected]>
2+
# Copyright 2015-2025 Joseph Block <[email protected]>
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -20,6 +20,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
2020
exit 1
2121
fi
2222

23+
function check-dependency() {
24+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
25+
error "missing dependency: can't find $1 in your PATH"
26+
exit 1
27+
fi
28+
}
29+
check-dependency pmset
30+
2331
# Print battery percentage
2432
pmset -g batt | grep -E "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';'
2533
exit $?

bin/battery-time

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2015,2022 Joseph Block <[email protected]>
2+
# Copyright 2015-2025 Joseph Block <[email protected]>
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -20,6 +20,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
2020
exit 1
2121
fi
2222

23+
function check-dependency() {
24+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
25+
error "missing dependency: can't find $1 in your PATH"
26+
exit 1
27+
fi
28+
}
29+
check-dependency pmset
30+
2331
# Print system's estimate of battery time remaining
2432
pmset -g batt | grep -E "([0-9]+\%).*" -o --colour=auto | cut -f3 -d';'
2533
exit $?

bin/bundle-id

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
#
33
# Print the bundle ID of an application
44
#
5-
# Copyright 2022, Joe Block <[email protected]>
5+
# Copyright 2022-2025 Joe Block <[email protected]>
66
if [[ "$(uname -s)" != 'Darwin' ]]; then
77
echo 'Sorry, this script only works on macOS'
88
exit 1
99
fi
1010

11+
function check-dependency() {
12+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
13+
error "missing dependency: can't find $1 in your PATH"
14+
exit 1
15+
fi
16+
}
17+
check-dependency osascript
18+
1119
exec osascript -e "id of app \"$1\""

bin/change-wallpaper

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
#
33
# Force wallpaper to switch immediately
4+
#
5+
# Copyright 2016-2025 Joe Block <[email protected]>
46

57
set -e
68

@@ -9,6 +11,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
911
exit 1
1012
fi
1113

14+
function check-dependency() {
15+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
16+
error "missing dependency: can't find $1 in your PATH"
17+
exit 1
18+
fi
19+
}
20+
check-dependency osascript
21+
1222
exec osascript <<EOF
1323
tell application "System Events"
1424
tell current desktop

bin/charger-wattage

+18-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Show the wattage of your charger
44
#
5-
# Copyright 2021, Joe Block <[email protected]>
5+
# Copyright 2021-2025, Joe Block <[email protected]>
66

77
set -o pipefail
88
if [[ -n "$DEBUG" ]]; then
@@ -29,14 +29,21 @@ function charger-wattage() {
2929
pmset -g ac | awk '/Wattage/ {print $3}'
3030
}
3131

32-
if [[ "$(uname -s)" != 'Darwin' ]]; then
33-
echo 'Sorry, this script only works on macOS'
34-
exit 1
35-
fi
32+
function only-run-on() {
33+
if [[ "$(uname -s)" != "$1" ]]; then
34+
echo "This script only runs on $1"
35+
exit 1
36+
fi
37+
}
3638

37-
if has pmset; then
38-
charger-wattage
39-
else
40-
# shellcheck disable=SC2016
41-
fail 'Cannot find pmset in your $PATH'
42-
fi
39+
function check-dependency() {
40+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
41+
error "missing dependency: can't find $1 in your PATH"
42+
exit 1
43+
fi
44+
}
45+
46+
only-run-on Darwin
47+
check-dependency pmset
48+
49+
charger-wattage

bin/chrome-tabs

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ ts () {
1111
date +'%Fz%T'
1212
}
1313

14+
function check-dependency() {
15+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
16+
error "missing dependency: can't find $1 in your PATH"
17+
exit 1
18+
fi
19+
}
20+
check-dependency osascript
21+
1422
chrome_tabs () {
1523
# shellcheck disable=SC2046
1624
for win in $(seq 0 $(osascript -e 'tell application "Chrome" to get count every window'))

bin/clean-clipboard

+11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
#!/bin/bash
22
#
33
# Convert contents of clipboard to plain text.
4+
#
5+
# Copyright 2015-2025, Joe Block <[email protected]>
46

57
if [[ "$(uname -s)" != 'Darwin' ]]; then
68
echo 'Sorry, this script only works on macOS'
79
exit 1
810
fi
911

12+
function check-dependency() {
13+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
14+
error "missing dependency: can't find $1 in your PATH"
15+
exit 1
16+
fi
17+
}
18+
check-dependency pbpaste
19+
check-dependency textutil
20+
1021
pbpaste | textutil -convert txt -stdin -stdout -encoding 30 | pbcopy

bin/clean-xml-clip

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Clean up the XML in the clipboard
44
#
5-
# Copyright 2017, Joe Block <[email protected]>
5+
# Copyright 2017-2025, Joe Block <[email protected]>
66

77
set -o pipefail
88

@@ -11,15 +11,15 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
1111
exit 1
1212
fi
1313

14-
function has() {
15-
# Check if a command is in $PATH
16-
which "$@" > /dev/null 2>&1
14+
function check-dependency() {
15+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
16+
error "missing dependency: can't find $1 in your PATH"
17+
exit 13
18+
fi
1719
}
1820

19-
if ! has tidy; then
20-
echo 'tidy not found in $PATH!'
21-
exit 13
22-
fi
21+
check-dependency pbpaste
22+
check-dependency tidy
2323

2424
pbpaste | tidy -xml -wrap 0 | pbcopy
2525
exit $?

bin/clear-macos-font-cache

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
88
exit 1
99
fi
1010

11+
function check-dependency() {
12+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
13+
error "missing dependency: can't find $1 in your PATH"
14+
exit 1
15+
fi
16+
}
17+
check-dependency atsutil
18+
1119
atsutil databases -removeUser && \
1220
atsutil server -shutdown && \
1321
atsutil server -ping

bin/clear-osx-font-cache

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
88
exit 1
99
fi
1010

11+
function check-dependency() {
12+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
13+
error "missing dependency: can't find $1 in your PATH"
14+
exit 1
15+
fi
16+
}
17+
check-dependency atsutil
18+
1119
atsutil databases -removeUser && \
1220
atsutil server -shutdown && \
1321
atsutil server -ping

bin/clip

+9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
#!/bin/bash
22
#
33
# clipboard helper
4+
#
5+
# Copyright 2016-2025 Joe Block <[email protected]>
46

57
if [[ "$(uname -s)" != 'Darwin' ]]; then
68
echo 'Sorry, this script only works on macOS'
79
exit 1
810
fi
11+
function check-dependency() {
12+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
13+
error "missing dependency: can't find $1 in your PATH"
14+
exit 1
15+
fi
16+
}
17+
check-dependency pbcopy
918

1019
# shellcheck disable=SC2071
1120
if [[ $# > 0 ]]; then

bin/column-view

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright 2015 Joseph Block <[email protected]>
3+
# Copyright 2015-2025 Joseph Block <[email protected]>
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -21,6 +21,14 @@ if [[ "$(uname -s)" != 'Darwin' ]]; then
2121
exit 1
2222
fi
2323

24+
function check-dependency() {
25+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
26+
error "missing dependency: can't find $1 in your PATH"
27+
exit 1
28+
fi
29+
}
30+
check-dependency osascript
31+
2432
exec osascript <<EOT
2533
set cwd to do shell script "pwd"
2634
tell application "Finder"

bin/darktoggle

+18-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,28 @@ function fail() {
88
exit "${2-1}" ## Return a code specified by $2 or 1 by default.
99
}
1010

11-
if [[ "$(uname -s)" = "Darwin" ]]; then
12-
read -d '' darktoggle << EOR
11+
function only-run-on() {
12+
if [[ "$(uname -s)" != "$1" ]]; then
13+
echo "This script only runs on $1"
14+
exit 1
15+
fi
16+
}
17+
18+
function check-dependency() {
19+
if ! (builtin command -V "$1" >/dev/null 2>&1); then
20+
error "missing dependency: can't find $1 in your PATH"
21+
exit 1
22+
fi
23+
}
24+
25+
only-run-on Darwin
26+
check-dependency osascript
27+
28+
read -d '' darktoggle << EOR
1329
tell application "System Events"
1430
tell appearance preferences
1531
set dark mode to not dark mode
1632
end tell
1733
end tell
1834
EOR
1935
echo $darktoggle | osascript
20-
else
21-
myname=$(basename "$0")
22-
fail "darktoggle only works on macOS"
23-
fi

0 commit comments

Comments
 (0)