tag_preview 462 B

12345678910111213141516
  1. #!/bin/bash
  2. screenshot_dir="$HOME/.dwm/tag_previews/"
  3. if [ "$1" == "--hide" ]; then # If first argument is --hide execute
  4. killall feh # temp
  5. shift
  6. fi
  7. # add geometry logic here ( alignment of preview )
  8. if [ "$1" == "--show" ]; then # If first argument is --show execute
  9. file="${screenshot_dir}${2}.jpeg" # $2 is the tag which will be previewed
  10. [ -f $file ] || exit 1 # Exit if file doesnt exist
  11. feh -g 230x130+10+40 --scale-down $file
  12. fi