qubes-core-agent-thunar.postinst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # postinst script for core-agent-linux
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6. # The postinst script may be called in the following ways:
  7. # * <postinst> 'configure' <most-recently-configured-version>
  8. # * <old-postinst> 'abort-upgrade' <new version>
  9. # * <conflictor's-postinst> 'abort-remove' 'in-favour' <package>
  10. # <new-version>
  11. # * <postinst> 'abort-remove'
  12. # * <deconfigured's-postinst> 'abort-deconfigure' 'in-favour'
  13. # <failed-install-package> <version> 'removing'
  14. # <conflicting-package> <version>
  15. #
  16. # For details, see http://www.debian.org/doc/debian-policy/ or
  17. # https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
  18. # the debian-policy package
  19. case "${1}" in
  20. configure)
  21. # There is no system-wide Thunar custom actions. There is only a default
  22. # file and a user file created from the default one. Qubes actions need
  23. # to be placed after all already defined actions and before </actions>
  24. # the end of file.
  25. if [ -f /etc/xdg/Thunar/uca.xml ] ; then
  26. cp -p /etc/xdg/Thunar/uca.xml /etc/xdg/Thunar/uca.xml.bak
  27. #shellcheck disable=SC2016
  28. sed -i '$e cat /usr/lib/qubes/uca_qubes.xml' /etc/xdg/Thunar/uca.xml
  29. fi
  30. if [ -f /home/user/.config/Thunar/uca.xml ] ; then
  31. cp -p /home/user/.config/Thunar/uca.xml /home/user/.config/Thunar/uca.xml.bak
  32. #shellcheck disable=SC2016
  33. sed -i '$e cat /usr/lib/qubes/uca_qubes.xml' /home/user/.config/Thunar/uca.xml
  34. fi
  35. ;;
  36. abort-upgrade|abort-remove|abort-deconfigure)
  37. exit 0
  38. ;;
  39. *)
  40. echo "postinst called with unknown argument \`${1}'" >&2
  41. exit 1
  42. ;;
  43. esac
  44. # dh_installdeb will replace this with shell code automatically
  45. # generated by other debhelper scripts.
  46. #DEBHELPER#
  47. exit 0
  48. # vim: set ts=4 sw=4 sts=4 et :