Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Created July 18, 2020 08:52
Show Gist options
  • Save MatejLach/e3a81c58193078fb9b005959ecff358f to your computer and use it in GitHub Desktop.
Save MatejLach/e3a81c58193078fb9b005959ecff358f to your computer and use it in GitHub Desktop.
Scale Wayland applications on phosh via gsettings to fit the device screen
#!/bin/bash
set -e
export GSETTINGS_SCHEMA_DIR=_build/data/
if [ -z "$1" ]; then
echo "Usage: $0 APP-ID VALUE"
exit 0
fi
case "$2" in
on|1|ON|true)
val=true
;;
*)
val=false
;;
esac
APP_ID="$(echo $1 | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]')"
gsettings set sm.puri.phoc.application:/sm/puri/phoc/application/"$APP_ID"/ scale-to-fit "${val}"
echo -n "Scale-to-fit for $1 is now "
G_MESSAGES_DEBUG= gsettings get sm.puri.phoc.application:/sm/puri/phoc/application/"$APP_ID"/ scale-to-fit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment