A Simple X Image Viewer
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.0 KiB

  1. #!/bin/sh
  2. # Example for ~/.sxiv/exec/key-handler
  3. # Called by sxiv(1) whenever an unbound key combo is used,
  4. # with the key combo as its first argument and the path of the current image
  5. # as its second argument.
  6. # sxiv(1) blocks until this script terminates. It then checks if the image
  7. # has been modified and reloads it.
  8. # The key combo argument has the following form: "[C-][M-][S-]KEY",
  9. # where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
  10. # keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
  11. case "$1" in
  12. "C-c")
  13. echo -n "$2" | xsel -i ;;
  14. "C-e")
  15. urxvt -bg "#444" -fg "#eee" -sl 0 -title "$2" -e sh -c "exiv2 pr -q -pa '$2' | less" & ;;
  16. "C-g")
  17. gimp "$2" & ;;
  18. "C-comma")
  19. exec jpegtran -rotate 270 -copy all -outfile "$2" "$2" ;;
  20. "C-period")
  21. exec jpegtran -rotate 90 -copy all -outfile "$2" "$2" ;;
  22. "C-slash")
  23. exec jpegtran -rotate 180 -copy all -outfile "$2" "$2" ;;
  24. "C-less")
  25. exec mogrify -rotate -90 "$2" ;;
  26. "C-greater")
  27. exec mogrify -rotate +90 "$2" ;;
  28. "C-question")
  29. exec mogrify -rotate 180 "$2" ;;
  30. esac