#!/bin/sh
TITLE="Give Maps Access to Your Location?"
SUBTITLE="Allows your location to be shown on the map and travel directions for your current location."
BODY="Location access can be changed at any time from the privacy settings."
#OPTIONS="{'icon': <'find-location-symbolic'>,
#          'choices': <[('42','Let it rain',@a(ss) [],'true')]>}"
OPTIONS="{'icon': <'find-location-symbolic'>}"

gdbus call --session --dest org.freedesktop.impl.portal.desktop.gnome \
           --object-path /org/freedesktop/portal/desktop \
           --method org.freedesktop.impl.portal.Access.AccessDialog \
           /org/gnome/Shell/Access org.gnome.Shell '' \
           "$TITLE" "$SUBTITLE" "$BODY" "$OPTIONS"


TITLE="Give Firefox Camera Access?"
SUBTITLE="Firefox wants to use your camera and microphone."
BODY="Access to your camera can be changed at any time from the privacy settings."
OPTIONS="{'icon': <'camera-web-symbolic'>,
          'deny_label': <'Cancel'>}"

gdbus call --session --dest org.freedesktop.impl.portal.desktop.gnome \
           --object-path /org/freedesktop/portal/desktop \
           --method org.freedesktop.impl.portal.Access.AccessDialog \
           /org/gnome/Shell/Access org.gnome.Shell '' \
           "$TITLE" "$SUBTITLE" "$BODY" "$OPTIONS"


TITLE="Give Firefox Microphone Access?"
SUBTITLE="Firefox wants to use your microphone."
BODY="Access to your microphone can be changed at any time from the privacy settings."
OPTIONS="{'icon': <'audio-input-microphone-symbolic'>,
          'deny_label': <'Cancel'>,
          'grant_label': <'Turn On'>}"

gdbus call --session --dest org.freedesktop.impl.portal.desktop.gnome \
           --object-path /org/freedesktop/portal/desktop \
           --method org.freedesktop.impl.portal.Access.AccessDialog \
           /org/gnome/Shell/Access org.gnome.Shell '' \
           "$TITLE" "$SUBTITLE" "$BODY" "$OPTIONS"
