Skip to content

Instantly share code, notes, and snippets.

View DerBunman's full-sized avatar
🍌
Focusing

DerBunman

🍌
Focusing
View GitHub Profile
@DerBunman
DerBunman / gist:1b0d6d163008faebddfb0caf6b235c30
Last active June 10, 2019 15:43
zsh: cleanup mktemp files on script exit/term
#!/usr/bin/env zsh
MKTEMP_BIN="$(which mktemp)"
tempfiles="$(mktemp)"
function mktemp(){
local filename="$($MKTEMP_BIN "${@}")"
echo "$filename" >> "$tempfiles"
echo "$filename"
}
function on_exit() {
test -f "$tempfiles" && {
@DerBunman
DerBunman / setup-tv.desktop
Last active June 10, 2019 02:27
setup environment based on a connected display
# place in /usr/share/gdm/greeter/autostart/setup-tv.desktop
[Desktop Entry]
Type=Application
Name=Setup TV
Exec=/home/ichi/bin/setup_tv.zsh
NoDisplay=true
X-GNOME-AutoRestart=true