AM-SAMPLE-Firefox-webapp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/env bash
  2. APP=ffwa-SAMPLE
  3. APPNAME="GIVEMEANAME"
  4. ICONURL="YOURICONURL"
  5. # CREATING THE FOLDER
  6. mkdir /opt/"$APP"
  7. cd /opt/"$APP"
  8. # ADD THE REMOVER
  9. echo '#!/bin/sh' >> /opt/"$APP"/remove
  10. echo "rm -R -f /usr/local/share/applications/$APP-AM.desktop /opt/$APP /usr/local/bin/$APP" >> /opt/$APP/remove
  11. chmod a+x /opt/"$APP"/remove
  12. # LINK
  13. cat >> /usr/local/bin/"$APP" << 'EOF'
  14. #!/bin/sh
  15. sh -c 'XAPP_FORCE_GTKWINDOW_ICON=/opt/ffwa-SAMPLE/icons/ffwa-SAMPLE firefox --class WebApp-SAMPLE --profile /opt/ffwa-SAMPLE --no-remote -url 'MYWEBSITE''
  16. EOF
  17. chmod a+x /usr/local/bin/"$APP"
  18. # LAUNCHER
  19. echo "[Desktop Entry]
  20. Name=$APPNAME
  21. Exec=$APP
  22. Icon=/opt/$APP/icons/$APP
  23. Type=Application
  24. Terminal=false
  25. Categories=YOURCATEGORY;
  26. Comment=Web Application & Firefox Profile for $APPNAME" > /usr/local/share/applications/"$APP"-AM.desktop
  27. # ICON
  28. mkdir /opt/"$APP"/icons
  29. wget "$ICONURL" -O /opt/"$APP"/icons/"$APP"
  30. # ADD PREFERENCES
  31. cat >> /opt/"$APP"/prefs.js << 'EOF'
  32. // Mozilla User Preferences
  33. // DO NOT EDIT THIS FILE.
  34. //
  35. // If you make changes to this file while the application is running,
  36. // the changes will be overwritten when the application exits.
  37. //
  38. // To change a preference value, you can either:
  39. // - modify it via the UI (e.g. via about:config in the browser); or
  40. // - set it within a user.js file in your profile.
  41. user_pref("app.normandy.first_run", false);
  42. user_pref("browser.bookmarks.addedImportButton", true);
  43. user_pref("browser.bookmarks.restore_default_bookmarks", false);
  44. user_pref("browser.laterrun.enabled", true);
  45. user_pref("browser.shell.checkDefaultBrowser", false);
  46. user_pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
  47. user_pref("browser.startup.couldRestoreSession.count", 2);
  48. user_pref("browser.tabs.inTitlebar", 1);
  49. user_pref("browser.toolbars.bookmarks.visibility", "never");
  50. user_pref("browser.uiCustomization.state", "{\"placements\":{\"widget-overflow-fixed-list\":[],\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"customizableui-special-spring1\",\"urlbar-container\",\"customizableui-special-spring2\",\"save-to-pocket-button\",\"downloads-button\",\"fxa-toolbar-menu-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"PersonalToolbar\":[\"import-button\",\"personal-bookmarks\"]},\"seen\":[\"save-to-pocket-button\",\"developer-button\"],\"dirtyAreaCache\":[\"nav-bar\",\"PersonalToolbar\",\"toolbar-menubar\",\"TabsToolbar\"],\"currentVersion\":17,\"newElementCount\":2}");
  51. user_pref("browser.urlbar.placeholderName", "DuckDuckGo");
  52. user_pref("doh-rollout.doneFirstRun", true);
  53. user_pref("extensions.pendingOperations", false);
  54. EOF