Skip to content

Instantly share code, notes, and snippets.

@thorntonrose
Created March 27, 2016 00:05
Show Gist options
  • Save thorntonrose/ba733f8962404df1421c to your computer and use it in GitHub Desktop.
Save thorntonrose/ba733f8962404df1421c to your computer and use it in GitHub Desktop.
Breathe
import java.awt.*
import javax.swing.*
if (args.length < 1) {
println "Usage: Breathe minutes"
System.exit(0)
}
minutes = args[0] as int
dim = Toolkit.getDefaultToolkit().getScreenSize();
optionPane = new JOptionPane("Breathe.");
dialog = optionPane.createDialog(null, "Reminder");
dialog.setLocation((dim.width - 275) as int, 35);
while (true) {
dialog.setVisible(true);
Thread.sleep(minutes * 60 * 1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment