Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Konoplev kodopik

View GitHub Profile
View header.bash
#!/usr/bin/env bash
# https://habr.com/post/413117/
if test "$BASH" = "" || "$BASH" -uc "a=();true \"\${a[@]}\"" 2>/dev/null; then
# Bash 4.4, Zsh
set -euo pipefail
else
# Bash 4.3 and older chokes on empty arrays with set -u.
set -eo pipefail
fi
shopt -s nullglob globstar
@kodopik
kodopik / g_hack.service
Created Nov 22, 2017
Systemd service for MX1100 mouse hack
View g_hack.service
[Unit]
Description=g_hack: Additional mouse buttons
[Service]
Type=oneshot
ExecStart=/home/anton/bin/g_hack /dev/usb/hiddev0 0
StandardOutput=null
@kodopik
kodopik / g_hack.timer
Last active Aug 25, 2019
Systemd timer for MX1100 mouse hack
View g_hack.timer
[Unit]
Description=g_hack: Timer for g_hack.service
[Timer]
OnUnitActiveSec=60s
OnBootSec=60s
#Unit=g_hack.service
[Install]
#WantedBy=multi-user.target