unveil_enable_directories_in_chromium.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/ksh
  2. file=/etc/chromium/unveil.content
  3. if [ ! -f "$file" ]; then
  4. doas mkdir -p /etc/chromium
  5. # Add directories to unveil.content
  6. {
  7. echo ""
  8. echo "# access to home directories"
  9. echo "~/unnamed/ rwc"
  10. echo "~/pictures/ rwc"
  11. echo "~/Documentos/ rwc"
  12. echo "~/Sync/ rwc"
  13. echo "~/games/ rwc"
  14. echo "~/isos/ rwc"
  15. echo "~/music/ rwc"
  16. } | doas tee -a "$file"
  17. fi
  18. file=/etc/chromium/unveil.main
  19. if [ ! -f "$file" ]; then
  20. doas mkdir -p /etc/chromium
  21. # Add directories to unveil.main
  22. {
  23. echo ""
  24. echo "# access to home directories"
  25. echo "~/unnamed/ rwc"
  26. echo "~/pictures/ rwc"
  27. echo "~/Documentos/ rwc"
  28. echo "~/Sync/ rwc"
  29. echo "~/games/ rwc"
  30. echo "~/isos/ rwc"
  31. echo "~/music/ rwc"
  32. } | doas tee -a "$file"
  33. fi
  34. file=$HOME/.config/gtk-3.0/bookmarks
  35. if [ ! -f "$file" ]; then
  36. username=$(echo $USER)
  37. {
  38. echo "file:///home/$username/unnamed"
  39. echo "file:///home/$username/pictures"
  40. echo "file:///home/$username/Documentos"
  41. echo "file:///home/$username/Sync"
  42. echo "file:///home/$username/games"
  43. echo "file:///home/$username/isos"
  44. echo "file:///home/$username/music"
  45. echo "file:///home/$username/videos"
  46. } >>$file
  47. fi
  48. # Apply policy file
  49. file=/etc/chromium/policies/managed/openbsd.json
  50. if [ ! -f "$file" ]; then
  51. doas mkdir -p /etc/chromium/policies/managed/
  52. {
  53. echo "{"
  54. echo " \"BackgroundModeEnabled\": false,"
  55. echo " \"NewTabPageLocation\": \"about:blank\""
  56. echo "}"
  57. } | doas tee -a "$file"
  58. fi