A command-line tool to view, set, and clear custom keyboard mappings on macOS using hidutil.
# View current mapping
./macos_keys.py| #!/bin/bash | |
| set -e | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: $0 backup|backup-and-delete|restore" | |
| exit 1 | |
| fi | |
| CMD=$1 | |
| SELF=$0 |
| #!/bin/sh | |
| # A script version of the instructions here: https://remove.codes/01-dynamic-wallpaper | |
| set -e | |
| # Helper functions. | |
| verbose() { | |
| echo >&2 | |
| echo $ "$@" >&2 |
| #!/bin/bash | |
| set -e | |
| echo "==> Formulae" && brew leaves | xargs brew deps --tree --formula | sed '/^$/d' && echo && echo "==> Casks" && brew list --cask | xargs brew deps --tree --cask | sed '/^$/d' |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| // Converts a size string (e.g., "20g", "500m", "1024") into bytes. | |
| off_t parse_size(const char *sizeStr) { | |
| char *end; |
| -- ~/.hammerspoon/init.lua | |
| ---@diagnostic disable-next-line: undefined-global | |
| local hs = hs | |
| hs.window.animationDuration = 0 | |
| -- https://github.com/Hammerspoon/hammerspoon/issues/3224#issuecomment-1294971600 | |
| local function axHotfix(win, fn) | |
| local axApp = hs.axuielement.applicationElement(win:application()) | |
| local wasEnhanced = axApp.AXEnhancedUserInterface |
| #!/usr/bin/env deno run --allow-env --allow-read --allow-run | |
| // Was this file modified in any PR? | |
| import { readline } from "https://deno.land/x/[email protected]/mod.ts"; | |
| declare global { | |
| export const Deno: any; | |
| export interface ArrayConstructor { | |
| fromAsync<T>(asyncIterable: AsyncIterable<T>): Promise<T[]>; | |
| } |
Update!
I just found rclone, which seems to do what my script does, and more:
The only drawback is that it takes a bit longer to setup.
| type ItemInfo = | |
| | { | |
| type: "element"; | |
| key: string | undefined; | |
| } | |
| | { type: "other" }; | |
| function getItemInfo(item: unknown): ItemInfo { | |
| if (typeof item === "object" && item != null) { | |
| if ("key" in item) { |
| #!/opt/homebrew/bin/bun run | |
| // <xbar.title>CPU Usage, Kill process</xbar.title> | |
| // <xbar.version>v1.0</xbar.version> | |
| // <xbar.author>Sean Zhu</xbar.author> | |
| // <xbar.author.github>szhu</xbar.author.github> | |
| // <xbar.desc>Shows the top 5 highest-CPU processes. Select a process to kill it.</xbar.desc> | |
| // <xbar.image>https://raw.githubusercontent.com/Aleksandern/devman/master/images/BitBarCpuUsageKill.png</xbar.image> | |
| // <xbar.dependencies>deno</xbar.dependencies> | |
| // Based on: https://xbarapp.com/docs/plugins/System/cpu-usage-kill.5s.sh.html |