Skip to content

Instantly share code, notes, and snippets.

@eze-kiel
eze-kiel / Makefile
Last active March 22, 2024 02:18
Makefile with enhanced help command
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
.PHONY: all build clean
all: help
## Build:
@eze-kiel
eze-kiel / activity-logger.sh
Created October 19, 2023 09:55
Script to detect activity on the computer (keyboard/mouse)
#!/bin/bash
state="active"
threshold=10000
while true; do
sleep 1
idle=$(xprintidle)
if [[ "$idle" -lt "$threshold" && "$state" != "active" ]] ; then
state="active"