Skip to content

Instantly share code, notes, and snippets.

@taeber
Last active January 4, 2018 18:07
Show Gist options
  • Save taeber/a5e0fd23fcbfbbea42ead8cbe091962c to your computer and use it in GitHub Desktop.
Save taeber/a5e0fd23fcbfbbea42ead8cbe091962c to your computer and use it in GitHub Desktop.
Stand up every thirty minutes reminder via i3-nagbar
#!/bin/bash
# Copyright 2017 Taeber Rapczak
# Reminds the user to stand up or sit down on the hour and half-hour
# Uses timer from https://gist.github.com/taeber/20d6b000ae68f5f623f3467233017f34
seconds=$(date +%T | cut -d: -f3)
minutes=$(date +%T | cut -d: -f2)
if [[ $minutes -ne 0 ]] || [[ $seconds -ne 0 ]]
then
timer "$(( (59 - $minutes) % 30 ))m $(( (60 - $seconds) % 60 ))"
fi
while true
do
i3-nagbar -m 'Stand up!' -t warning &
timer 30m # sleep for 30 minutes
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment