Skip to content

Instantly share code, notes, and snippets.

@tyjak
Last active September 18, 2022 10:17
Show Gist options
  • Save tyjak/4c6b8326117e9aad86300bc67b8429db to your computer and use it in GitHub Desktop.
Save tyjak/4c6b8326117e9aad86300bc67b8429db to your computer and use it in GitHub Desktop.
#!/bin/sh
# simple timer for i3
# depend on monitor_width and timer
# GistID: 4c6b8326117e9aad86300bc67b8429db
CMD="sh -c 'timer "$1"; echo -n "$1" time elapsed !'"
t_width=$(($(monitor_width)/2))
t_height=50 #TODO calculate minimal height with height line, font size to adpat any screen resolution
p_v=$(($(monitor_height)-$t_height-2))
p_h=$(($(monitor_width)/2-${t_width}/2))
echo $p_v
echo $p_h
popup -p ${p_v}x${p_h} -f -s ${t_width}x${t_height} $CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment