My build of nnn with minor changes
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.
 
 
 
 
 
 

21 lines
492 B

  1. #!/usr/bin/env sh
  2. # Description: Toggles executable mode for selection
  3. #
  4. # Dependencies: chmod
  5. #
  6. # Note: Works _only_ with selection (nnn can toggle the mode for the hovered file)
  7. #
  8. # Shell: POSIX compliant
  9. # Author: Arun Prakash Jana
  10. selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
  11. if [ ! -s "$selection" ]; then
  12. printf "0 selected "
  13. read -r _
  14. exit
  15. fi
  16. xargs -0 -I {} sh -c 'if [ -x "{}" ] ; then chmod -x "{}" ; else chmod +x "{}" ; fi' < "$selection"