Skip to content

Instantly share code, notes, and snippets.

View get_mouse_monitor.sh
#!/usr/bin/env bash
IFS=$'\n'
eval $(xdotool getmouselocation --shell --prefix "MOUSE_")
for monitor in $(herbstclient list_monitors)
do
eval $(awk '{
print "ID=" $1
View get_focus_monitor_vars.sh
#!/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
}'
@dangle
dangle / toggle-input.py
Last active Feb 14, 2021
A short script to switch between monitor inputs on evdev input swap
View toggle-input.py
#!/usr/bin/python3
import platform
import subprocess
from pynput import keyboard
def toggle_input():
if platform.system() == 'Windows':
View etch.c
#include <curses.h>
#include <signal.h>
#define RED_RED 9
#define WHITE_BLACK 10
#define WHITE_WHITE 11
void done();
void rszf();
void drwc();
View container-demo.sh
#!/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
View keybase.md

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: