From f3c8a50dba72e5a3d26ed454e2aa0956c737f6f7 Mon Sep 17 00:00:00 2001 From: Correl Date: Sat, 18 Jul 2020 19:34:23 -0400 Subject: [PATCH] [provisioning] Add org-protocol linux setup --- recipes/org-protocol | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 recipes/org-protocol diff --git a/recipes/org-protocol b/recipes/org-protocol new file mode 100644 index 0000000..42cded1 --- /dev/null +++ b/recipes/org-protocol @@ -0,0 +1,24 @@ +#!/bin/bash +# Description: Emacs org-protocol +set -e + +__disable_chrome_external_protocol_dialog_linux () { + sudo mkdir -p /etc/{opt/chrome,chromium-browser}/policies/managed/ + sudo tee /etc/{opt/chrome,chromium-browser}/policies/managed/external_protocol_dialog.json >/dev/null <<'EOF' +{ + "ExternalProtocolDialogShowAlwaysOpenCheckbox": true +} +EOF + sudo chmod 644 /etc/{opt/chrome,chromium-browser}/policies/managed/external_protocol_dialog.json +} + +case $_PLATFORM in + linux) + _recipe _link + mkdir -p ~/.local/share/applications + _link ${HOME}/dotfiles/applications/org-protocol.desktop \ + ${HOME}/.local/share/applications/org-protocol.desktop + _run "Install org-protocol handler" xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol + _run "Disable chrome external protocol dialog" __disable_chrome_external_protocol_dialog_linux + ;; +esac