1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/bash
set -e
export GSETTINGS_SCHEMA_DIR=_build/data/
function print_current()
{
local app_id="$1"
local munged_id="$2"
echo -n "Scale-to-fit for $app_id: "
G_MESSAGES_DEBUG='' gsettings get sm.puri.phoc.application:/sm/puri/phoc/application/"$munged_id"/ scale-to-fit
}
if [ -z "$1" ]; then
echo "Usage: $0 APP-ID [VALUE]"
exit 0
fi
APP_ID="$1"
MUNGED_ID=$(echo "$1" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]')
if [ -z "$2" ]; then
print_current "$APP_ID" "$MUNGED_ID"
exit 0
fi
case "$2" in
""|on|1|ON|true)
val=true
;;
*)
val=false
;;
esac
G_MESSAGES_DEBUG='' gsettings set sm.puri.phoc.application:/sm/puri/phoc/application/"$MUNGED_ID"/ scale-to-fit "$val"
print_current "$APP_ID" "$MUNGED_ID"
|