set_bg 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. #100704 this was originally in Nathan's Wallpaper package.
  3. # called by 'pwallpaper' wallpaper setter.
  4. # Determine the path to this application.
  5. CURDIR="`pwd`"
  6. APPDIR=`dirname "$0"`
  7. cd "${APPDIR}"
  8. APPDIR="`pwd`"
  9. cd "${CURDIR}"
  10. if [ "$1" = "-clear" ];then
  11. grep -v '<backdrop' $HOME/.config/rox.sourceforge.net/ROX-Filer/pb_default > $HOME/.config/wallpaper/pb
  12. mv -f $HOME/.config/wallpaper/pb $HOME/.config/rox.sourceforge.net/ROX-Filer/pb_default
  13. rox -p=default
  14. echo "[none]" > $HOME/.config/wallpaper/bg_img
  15. exit
  16. fi
  17. MODE="`cat $HOME/.config/wallpaper/backgroundmode`"
  18. [ "$MODE" = "" ] && MODE="Scale"
  19. [ "$MODE" = "Centred" ] && MODE="Centre"
  20. [ "$MODE" = "Scaled" ] && MODE="Scale"
  21. #w482 BK now have script that truncates an image vertically so that it has the right dimensions
  22. #for a widescreen...
  23. if [ "$MODE" = "Stretch" ];then
  24. /usr/sbin/background_reshape ${1}
  25. fi
  26. rox --RPC << EOF
  27. <?xml version="1.0"?>
  28. <env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
  29. <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
  30. <SetBackdrop>
  31. <Filename>$1</Filename>
  32. <Style>$MODE</Style>
  33. </SetBackdrop>
  34. </env:Body>
  35. </env:Envelope>
  36. EOF