├── remind └── README.md /remind: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | show_usage() { 4 | echo "Usage: remind " 5 | } 6 | 7 | get_current_window_id() { 8 | i3-msg -t get_tree \ 9 | | grep -o '{[^{]*"focused":true[^}]*}' \ 10 | | sed 's/.*"id":\([^,]*\),.*/\1/' 11 | } 12 | 13 | remind() { 14 | TARGET_WINDOW="${1}" 15 | shift 16 | eval "${@}" 17 | i3-nagbar -m "[${?}] ${*}" -b "Go" "i3-msg [con_id=\"${TARGET_WINDOW}\"] focus" >/dev/null 2>&1 & 18 | echo -e "\a" 19 | } 20 | 21 | if [ "${BASH_SOURCE}" = "${0}" ]; then 22 | if [ "$#" -eq 0 ]; then 23 | show_usage >&2 24 | exit 1 25 | fi 26 | remind "$(get_current_window_id)" "${@}" 27 | fi 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Has this ever happened to you? 2 | You start a long-running command that you know will take several minutes to 3 | finsh. So in the mean time you switch away to check email/facebook/whatever. 4 | Hours later you realize that the command you started has been finished for ages 5 | but you forgot to switch back. 6 | 7 | This was literally happening to me almost every day, often several times a day. 8 | I could probably have solved world hunger with all that lost productivity. 9 | 10 | # If you use the i3 window manager, now there's a solution! 11 | This simple script might just be the solution to your problem. When you know a 12 | command you're about to run is going to take a while, prefix it with 'remind' 13 | and get notified when it terminates. Better yet, a handy 'Go' button will take 14 | you right back to the window where you ran the command. 15 | 16 | # Usage 17 | adam@brigantine:/usr/src/linux$ remind make 18 | 19 | --------------------------------------------------------------------------------