Dotfiles for different machines on different branches.
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.

13 lines
637 B

  1. #!/usr/bin/env bash
  2. [ -z "$FIFO_UEBERZUG" ] && exit
  3. readonly ID_PREVIEW="preview"
  4. if [ "$1" = "draw" ]; then
  5. declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="${PWD}/$6") > "$FIFO_UEBERZUG"
  6. elif [ "$1" = "videopreview" ]; then
  7. [ ! -f "/tmp/$6.png" ] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp/$6.png" -s 0 -q 10 &&
  8. declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="/tmp/$6.png") > "$FIFO_UEBERZUG"
  9. else
  10. declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") > "$FIFO_UEBERZUG"
  11. fi