Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
980 B

  1. #! /bin/sh
  2. WIDTH=${WIDTH:-200}
  3. HEIGHT=${HEIGHT:-200}
  4. DATEFMT=${DATEFMT:-"+%a %d.%m.%Y %H:%M:%S"}
  5. SHORTFMT=${SHORTFMT:-"+%H:%M:%S"}
  6. OPTIND=1
  7. while getopts ":f:W:H:" opt; do
  8. case $opt in
  9. f) DATEFMT="$OPTARG" ;;
  10. W) WIDTH="$OPTARG" ;;
  11. H) HEIGHT="$OPTARG" ;;
  12. \?)
  13. echo "Invalid option: -$OPTARG" >&2
  14. exit 1
  15. ;;
  16. :)
  17. echo "Option -$OPTARG requires an argument." >&2
  18. exit 1
  19. ;;
  20. esac
  21. done
  22. case "$BLOCK_BUTTON" in
  23. 1|2|3)
  24. # the position of the upper left corner of the popup
  25. posX=$(($BLOCK_X - $WIDTH / 2))
  26. posY=$(($BLOCK_Y - $HEIGHT))
  27. i3-msg -q "exec yad --calendar \
  28. --width=$WIDTH --height=$HEIGHT \
  29. --undecorated --fixed \
  30. --no-buttons \
  31. --posx=$posX --posy=$posY \
  32. > /dev/null"
  33. # --close-on-unfocus \
  34. esac
  35. . "/home/kevin/.cache/wal/colors.sh"
  36. echo "$LABEL$(date "$DATEFMT")"
  37. echo "$LABEL$(date "$SHORTFMT")"
  38. echo "$color7"