Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dangle on github.
  • I am dangle (https://keybase.io/dangle) on keybase.
  • I have a public key ASBIzkGHkpG7Qlu4eQXJ7uMPnsp8fEDtw7I-eLWK3hal4wo

To claim this, I am signing this object:

#!/usr/bin/env bash
# This script creates and activates a container when run as root.
# The file names used are from Ubuntu 18.04.
# Create the filesystem.
# It will only contain bash, ls, and the libraries to run them.
mkdir -p container-demo/{bin,lib,lib64,sys}
# Mount /sys into the filesystem to control cgroups.
mount --rbind /sys container-demo/sys
#!/usr/bin/env bash
herbstclient list_monitors | awk -F '[:+x\" ]' '/\[FOCUS\]/{
print "ID=" $1
print "WIDTH=" $3
print "HEIGHT=" $4
print "XOFFSET=" $5
print "YOFFSET=" $6
print "TAG=" $10
}'
#!/usr/bin/env bash
IFS=$'\n'
eval $(xdotool getmouselocation --shell --prefix "MOUSE_")
for monitor in $(herbstclient list_monitors)
do
eval $(awk '{
print "ID=" $1
#include <curses.h>
#include <signal.h>
#define RED_RED 9
#define WHITE_BLACK 10
#define WHITE_WHITE 11
void done();
void rszf();
void drwc();
@dangle
dangle / toggle-input.py
Last active February 14, 2021 20:33
A short script to switch between monitor inputs on evdev input swap
#!/usr/bin/python3
import platform
import subprocess
from pynput import keyboard
def toggle_input():
if platform.system() == 'Windows':
@dangle
dangle / Obsidian Todoist Script.md
Last active February 7, 2024 20:11
Script for use with Obsidian to pull in a snapshot of a day from Todoist

Obsidian Todoist Script

Description

This takes a day in YYYY-MM-DD format and can be called using the CustomJS plugin with either the Dataview plugin or the Templater plugin.

Styling

In order to get nicer styling, copy the todoist.css file to .obsidian/snippets and enable it under Settings → Appearance.