Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

36 lines
560 B

  1. #!/bin/sh
  2. for ((i=1;i<=$#;i++));
  3. do
  4. if [ ${!i} = "--getsavefilename" ]
  5. then ((i++))
  6. filename=${!i};
  7. fi
  8. if [ ${!i} = "--version" ]
  9. then
  10. echo "someversion"
  11. exit
  12. fi
  13. done;
  14. path=$( echo ${filename%/*} )
  15. file=$( echo ${filename##/*/} )
  16. rm /tmp/lf-chrome-choosed
  17. st -c lf -n lf -e $HOME/.local/bin/lf-ueberzug --selection-path=/tmp/lf-chrome-choosed
  18. selected=$(cat /tmp/lf-chrome-choosed 2> /dev/null)
  19. if [ ! $? = 0 ]
  20. then
  21. exit 1
  22. fi
  23. if [ -d $selected ]
  24. then
  25. echo "$selected$file"
  26. else
  27. echo $selected
  28. fi