The extensions that were in Toolshed's own repository, a folder each: brreg, dashboard-icons, databricks, docker, github, homebrew, norway, projects, scripts, secrets, wikipedia and yr. Toolshed installs them from here, in Settings → Extensions → From a repository, and the README says how
This commit is contained in:
44 files changed
+7978
-1
No files matched your search
@@ -0,0 +1,41 @@
|
||||
-- Scripts: your own small commands (fixes, cleanups, other jobs), each a tool of its own, so it
|
||||
-- can be found by name ("bluetooth") and given a hotkey. Add one as another tool below; when a
|
||||
-- theme grows, it can move to an extension of its own.
|
||||
|
||||
-- The Magic Keyboard and Trackpad sometimes only work with the cable in, and forgetting and
|
||||
-- re-pairing them doesn't help. Restarting bluetoothd does, and macOS starts it again within
|
||||
-- seconds. That takes root, so macOS asks for an administrator password.
|
||||
local function restart_bluetooth()
|
||||
local ok, err = pcall(toolshed.exec, {
|
||||
"/usr/bin/osascript", "-e",
|
||||
'do shell script "/usr/bin/pkill bluetoothd" with administrator privileges',
|
||||
})
|
||||
if ok then return toolshed.t("restarted") end
|
||||
-- -128 is the password dialog being cancelled, which needs no message.
|
||||
if tostring(err):find("-128", 1, true) then return nil end
|
||||
error(toolshed.t("failed", { error = tostring(err) }))
|
||||
end
|
||||
|
||||
return toolshed.toolbox {
|
||||
key = "scripts",
|
||||
title = "i18n:toolbox.title",
|
||||
description = "i18n:toolbox.description",
|
||||
icon = "wrench",
|
||||
tint = "orange",
|
||||
tools = {
|
||||
{
|
||||
key = "restart-bluetooth",
|
||||
title = "i18n:tool.restart-bluetooth.title",
|
||||
icon = "bluetooth",
|
||||
keywords = { "bluetooth", "keyboard", "trackpad", "mouse", "fix", "reconnect", "tastatur", "mus", "fiks", "koble til" },
|
||||
actions = {
|
||||
{
|
||||
key = "restart",
|
||||
title = "i18n:action.restart-bluetooth.restart",
|
||||
confirm = "i18n:confirm.restart-bluetooth",
|
||||
run = restart_bluetooth,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user