Skip to content

Instantly share code, notes, and snippets.

@gxfxyz
gxfxyz / karabiner_capslock_control_tab.json
Created May 19, 2019 15:49
Karabiner-Elements config: CapsLock / Control / Tab
{
"title": "CapsLock / Control / Tab",
"rules": [
{
"description": "Tap CapsLock (⇪) → Escape (⎋); Hold CapsLock (⇪) → Control (⌃)",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@gxfxyz
gxfxyz / karabiner_switch_input_source.json
Created May 19, 2019 05:22
Karabiner-Elements config: switch input source | 输入法切换
{
"title": "Switch input source | 输入法切换",
"rules": [
{
"description": "Tap Command_L (⌘) → Switch input source to English | 短按左 Command (⌘) → 切换到英文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
function replaceAll(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
}
function dec2hex(dec, padding){
return parseInt(dec, 10).toString(16).padStart(padding, '0');
}
function utf8StringToUtf16String(str) {
var utf16 = [];
@Luoyayu
Luoyayu / bear_autosave.scpt
Last active May 12, 2021 16:17
Bear writer: autosave to icloud
tell application "System Events"
-- 前提/premiss:
-- 1. 在iCloud云盘下新建Bear文件夹/Create a new folder "Bear" under the iCloud
-- 脚本做的事:/What the script does:
-- 1. 自动化点击/Automated click