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.

44 lines
1021 B

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