SHARE
TWEET

Untitled

a guest Oct 14th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/zsh
  2.  
  3. cd /home/lulu/
  4. directory=$(pwd)
  5. files=$(fzf -m)
  6. cd -
  7.  
  8. pdfs=""
  9. multiple_pdfs=""
  10.  
  11. while read -r file; do
  12.     file="$directory/$file"
  13.  
  14.     if [ "$(head -c 4 "$file")" = "%PDF" ]; then
  15.         if [ -z "$pdfs" ]; then
  16.             pdfs="$file"
  17.         else
  18.             pdfs="$pdfs $file"
  19.             multiple_pdfs="true"
  20.         fi
  21.     else
  22.         i3-msg exec xdg-open "$file"
  23.     fi
  24. done <<< "$files"
  25.  
  26. if ! [ -z "$pdfs" ]; then
  27.     if [ -z "$multiple_pdfs" ]; then
  28.         i3-msg exec zathura $pdfs
  29.     else
  30.         i3-msg exec "tabbed -c zathura "$pdfs" -e"
  31.     fi
  32. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top