This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
export XDG_RUNTIME_DIR=/run/user/1000 | |
readonly SOUND_DIR="/home/lexs/stuff" | |
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME dunst)/environ)" | |
echo "DBUS_SESSION_BUS_ADDRESS: $DBUS_SESSION_BUS_ADDRESS" | |
usage() { | |
cat <<EOF | |
Usage: $0 <action> [args..] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xi_dev_id() { | |
xinput | sed -n "s/.*$1.*id=\\([0-9]\\+\\).*/\1/p" | |
} | |
xi_prop_id() { | |
xinput list-props $1 | sed -n "s/.*$2.*(\\([0-9]\\+\\).*/\1/p" | |
} | |
xi_prop_get() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ -f "/etc/DIR_COLORS" ] && eval `dircolors /etc/DIR_COLORS` | |
cut_term=${TERM#__} | |
[[ "$cut_term" == rxvt-unicode-256color && "$cut_term" == "$TERM" || -n "$TMUX" ]] && { | |
precmd () { | |
print -Pn "\e]0;%n@%M: %~\a" | |
} | |
} || { | |
export TERM=$cut_term | |
} | |
unset cut_term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ -f "/etc/DIR_COLORS" ] && eval `dircolors /etc/DIR_COLORS` | |
cut_term=${TERM#__} | |
[[ "$cut_term" == rxvt-unicode-256color && "$cut_term" == "$TERM" || -n "$TMUX" ]] && { | |
precmd () { | |
print -Pn "\e]0;%n@%M: %~\a" | |
} | |
} || { | |
export TERM=$cut_term | |
} | |
unset cut_term |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
BROWSER=${BROWSER:-firefox} | |
MAX_DL_SIZE=$((20*1024*1024)) | |
say() { | |
[[ -t 0 ]] && echo "$@" || notify-lexs "Open" "$@" | |
} | |
debug() { :; } | |
[[ -n "$DEBUG" ]] && { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from youtube_dl.extractor import gen_extractor_classes | |
url = sys.argv[1] | |
suitable = [x.IE_NAME for x in gen_extractor_classes() if x.IE_NAME != 'generic' and x.suitable(url)] | |
if not suitable: | |
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "adc.h" | |
#ifdef ADC_TABLE | |
#include "gpio.h" | |
#include "settings.h" | |
// configure all channels for 239.5 cycles per sample | |
#define SAMPLE_TIME 1 | |
#define VREF 2500L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
File: printf.c | |
Copyright (C) 2004 Kustaa Nyholm | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "application.h" | |
#include "settings.h" | |
#define ARTNET_PORT ((uint16_t)0x1936) | |
enum { | |
OpPoll = 0x2000, | |
OpPollReply = 0x2100, | |
OpDiagData = 0x2300, | |
OpCommand = 0x2400, | |
OpOutput = 0x5000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gpio.h" | |
#define XGPIO X | |
#define X(name, port, pin, flags) { port, pin, flags }, | |
gpio_pindef_t gpio_pins[] = { | |
GPIO_TABLE | |
BOARD_COIL_TABLE | |
BOARD_IN_TABLE | |
}; | |
#undef X |
NewerOlder