New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display-config #12
display-config #12
Conversation
Oops. Sorry broke the logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple nits
snap/hooks/configure
Outdated
@@ -12,6 +12,27 @@ EOT | |||
let changes+=1 | |||
fi | |||
|
|||
# display-config | |||
display_config=$(snapctl get display-config) | |||
if [ -n "${display_config}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm so if we set it to empty, the file will remain, along with the "DO NOT EDIT" header... Maybe we could check if the file was written by us (i.e. has the # DO NOT EDIT
header) and remove it if that's the case?
snap/hooks/configure
Outdated
echo "# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN" > "$SNAP_DATA/miral-kiosk.display~" | ||
echo "# USE 'snap set mir-kiosk display-config=...' INSTEAD" >> "$SNAP_DATA/miral-kiosk.display~" | ||
echo "" >> "$SNAP_DATA/miral-kiosk.display~" | ||
echo "${display_config}" >> "$SNAP_DATA/miral-kiosk.display~" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose $SNAP_DATA/miral-kiosk.display
deserves a variable of its own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is fine, although screams for refactoring.
Add logic for an optional "display-config" setting.
If "snapctl get display-config" is set we compare with the
.display
file (if it exists) and unless they are the same overwrite and restart.