Skip to content

Instantly share code, notes, and snippets.

View confluencepoint's full-sized avatar
🏳️
Focusing

confluencepoint confluencepoint

🏳️
Focusing
View GitHub Profile
@confluencepoint
confluencepoint / generate_json.sh
Created September 14, 2022 09:22 — forked from QuestionDriven/generate_json.sh
Generate Karabiner-Elements' json file for import from Goku edn file
#! /usr/bin/env bash
set -e -u -o pipefail
#Usage
usage="Usage: ./generate_json.sh [options] <edn_config_file> <rule_title>"
show_help() {
cat << EOF
$usage
{:layers {:homerow {:key :caps_lock :alone {:key :escape}}
:symbols {:key :tab}}
:main [{:des "multitouch"
:rules [:multitouch_extension_finger_count_total
[:spacebar :button1]
[:f :button1]
[:d :button2]
[:s :button3]
[:z [:button1 :!Cz]]
@confluencepoint
confluencepoint / Add shadow to window screenshow.applescript
Created August 29, 2022 16:17 — forked from tempelmann/Add shadow to window screenshow.applescript
An Acorn (macOS) script to add a drop shadow to screenshots of shadow-less windows
-- This script uses Acorn (tested with version 6.6.4)
-- to add a light border around a window screenshot.
--
-- Screenshots (without the huge macOS shadows) are made by shift-cmd-4, then space bar,
-- then option-click on window (see https://apple.stackexchange.com/a/120017/17533)
--
-- Before use, you need to create a Preset Filter for this, once:
-- With an image opened, use from menu: Filter / Stylize / Drop Shadow…
-- Set its options as you prefer (e.g. X/Y offset 0, Blur Radius 2, Opacity 80%),
-- then save it by clicking the gear icon, choose "Save Filter Preset…" and
@confluencepoint
confluencepoint / karabiner.edn
Created July 17, 2022 15:41 — forked from kaushikgopal/karabiner.edn
My source Karabiner file in Goku's edn format
{
;; :!Ca is keycode :a and prefix a with !C
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
;; Q | right_command
;; W | right_control
function saveWindowsLayout(args)
local layout = {}
for _, w in pairs(hs.window.allWindows()) do
layout[tostring(w:id())] = {
frame = w:frame().table,
title = w:title(),
}
end
hs.settings.set("zWindowsLayout", hs.json.encode(layout))
end
@confluencepoint
confluencepoint / apple-news.sh
Created April 14, 2022 05:39 — forked from remi/apple-news.sh
Extract canonical URL from Apple News URL
#!/bin/bash
# Usage:
#
# 1. Create a `apple-news` file somewhere in your $PATH with the content of this file
# 2. That’s it! You can now use the `apple-news` utility:
#
# ```
# $ apple-news https://apple.news/AKoDCWtVEQP2w7Ld657lgIg
# https://www.theguardian.com/technology/2022/mar/30/dyson-launches-zone-air-purifying-bluetooth-headphones-with-visor
local qStartTime = 0.0
local qDuration = 1.5
hs.hotkey.bind({"cmd"}, "Q", function()
qStartTime = hs.timer.secondsSinceEpoch()
end, function()
local qEndTime = hs.timer.secondsSinceEpoch()
local duration = qEndTime - qStartTime
if duration >= qDuration then hs.application.frontmostApplication():kill() end
end)
@confluencepoint
confluencepoint / resize.scpt
Created March 20, 2022 10:56 — forked from selfire1/resize.scpt
An Applescript to resize windows from the command line
on run argv
-- Variables
set _cmd to (item 1 of argv)
tell application "Finder" to set _bounds to bounds of window of desktop
set _xPos to (item 1 of _bounds)
set _yPos to (item 2 of _bounds)
set _ySize to (item 3 of _bounds)
set _xSize to (item 4 of _bounds)
-- get bounds
-- do split: app1, app2, set split
@confluencepoint
confluencepoint / delete_all_from_sender.scpt
Created March 20, 2022 09:52 — forked from xunker/delete_all_from_sender.scpt
Delete all from sender - an Applescript for the Mail.app in Mac OS X that will search for all messages set by the sender of the email message currently open and allow you to delete them all at once.
-- Delete all from sender - https://gist.github.com/xunker/44fa4404c882c27e0ad25857e9470552
-- For the Mail.app in Mac OS X. It will search for all messages set by the sender of the email message currently open,
-- highlight them all and ask if you want to delete them. If you choose "yes" it will delete them for you and then clear
-- the search.
--
-- Important notes:
-- You can load this in Script Editor and then save it as an application so you can run it without Script Editor being open.
-- This does not work when Mail.app is in fullscreen mode; it must be in windowed mode.
-- You will need to enable "Assistive Devices" support for Script Editor (if run there) or for the .app you saved if you converted it to a standalone app.
@confluencepoint
confluencepoint / kill_menu.lua
Created March 11, 2022 14:31 — forked from knu/kill_menu.lua
Add a "Kill" menu bar item using Hammerspoon
do
killMenu = hs.menubar.new()
local killer = function (appName)
return function ()
hs.execute("killall " .. appName)
end
end
killMenu:setTitle("☠️")
killMenu:setMenu{