Skip to content

Instantly share code, notes, and snippets.

@datMaffin
datMaffin / ReloadSkim.bash
Created December 4, 2017 22:40
Script to reload the PDF-viewer *Skim* in macOS
#!/bin/bash
# the first argument should be the tex file, either with or without extension
file="$1"
[ "${file:0:1}" == "/" ] || file="${PWD}/${file}"
pdffile="${file%.tex}.pdf"
/usr/bin/osascript << EOF
set theFile to POSIX file "${pdffile}" as alias
tell application "Skim"
@datMaffin
datMaffin / OpenTerminalHere.applescript
Last active January 15, 2019 14:10
AppleScript for opening a single new Terminal.app window at the location `input`
set posix_input to POSIX path of input
if application "Terminal" is running then
tell application "Terminal"
open posix_input
activate
end tell
else
tell application "Terminal"
if not (exists window 1) then reopen
activate
@datMaffin
datMaffin / karabiner-config.json
Created April 2, 2020 19:17
Karabiner configuration for better keyboard shortcuts accessing special characters needed for programming
{
"description": "Meine Sonderzeichen",
"manipulators": [
{
"from": {
"key_code": "grave_accent_and_tilde",
"modifiers": {
"optional": [
"any"
]
@datMaffin
datMaffin / special-keys.ahk
Created April 2, 2020 19:20
AHK configuration for better keyboard shortcuts accessing special characters needed for programming
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#If GetKeyState("<", "P")
<::return
7::\
8::[
9::]
@datMaffin
datMaffin / xmodmap
Last active September 8, 2020 13:53
Xmodmap configuration for better keyboard shortcuts accessing special characters needed for programming (for german qwertz keyboard layout)
keycode 94 = Mode_switch
keycode 16 = 7 slash backslash slash braceleft seveneighths braceleft seveneighths
keycode 17 = 8 parenleft bracketleft parenleft bracketleft trademark bracketleft trademark
keycode 18 = 9 parenright bracketright parenright bracketright plusminus bracketright plusminus
keycode 30 = u U less U downarrow uparrow downarrow
keycode 43 = h H bar H hstroke Hstroke hstroke Hstroke
keycode 31 = i I greater I rightarrow idotless rightarrow idotless
keycode 44 = j J braceleft J dead_belowdot dead_abovedot dead_belowdot
keycode 45 = k K braceright K ampersand kra ampersand
keycode 46 = l L at L lstroke Lstroke lstroke Lstroke
@datMaffin
datMaffin / OkularWrapper.applescript
Created September 20, 2020 11:53
When installing Okular with brew it is not possible to "open with" on macOS. This script can be used for "open with" on macOS.
on run {input, parameters}
if (count of input) > 0 then
repeat with f in input
set p to POSIX path of f
do shell script "open -a okular -n --args \"" & p & "\""
end repeat
else
do shell script "open -a okular -n"
end if
@datMaffin
datMaffin / de-lsgtmod
Last active May 21, 2024 18:32
xkbd keyboard layout configuration for better keyboard shortcuts accessing special characters needed for programming (for german qwertz keyboard layout)
partial alphanumeric_keys modifier_keys keypad_keys
xkb_symbols "de-lsgtmod" {
include "latin(type4)"
name[Group1]="German (less-than as modifier)";
key.type[Group1] = "EIGHT_LEVEL";
key <TLDE> {[dead_circumflex, degree, U2032, U2033 ]}; // ′ ″
key <AE02> {[ 2, quotedbl, twosuperior, oneeighth ]};
key <AE03> {[ 3, section, threesuperior, sterling ]};
key <AE04> {[ 4, dollar, onequarter, currency ]};
key <AE07> {[ 7, slash, braceleft, seveneighths, backslash, backslash ]};
@datMaffin
datMaffin / template.org
Last active November 18, 2021 12:13
a file template for org mode

Template Org-File

Startup Options