tag_preview 424 B

1234567891011121314
  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. if [ "$1" == "--show" ]; then # If first argument is --show execute
  8. file="${screenshot_dir}${2}.jpeg" # $2 is the tag which will be previewed
  9. [ -f $file ] || exit 1 # Exit if file doesnt exist
  10. feh -g 281x158+10+50 --image-bg "#2E3440" -Z -. $file
  11. fi