A Simple X Image Viewer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

key-handler 1.1 KiB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # Example for $XDG_CONFIG_HOME/sxiv/exec/key-handler
  3. # Called by sxiv(1) after the external prefix key (C-x by default) is pressed.
  4. # The next key combo is passed as its first argument and the path of the
  5. # current image 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