Skip to content
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

Merged
merged 5 commits into from Sep 28, 2018
Merged

display-config #12

merged 5 commits into from Sep 28, 2018

Conversation

AlanGriffiths
Copy link
Contributor

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.

@AlanGriffiths
Copy link
Contributor Author

Oops. Sorry broke the logic.

@AlanGriffiths AlanGriffiths reopened this Sep 26, 2018
Copy link
Contributor

@Saviq Saviq left a 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

@@ -12,6 +12,27 @@ EOT
let changes+=1
fi

# display-config
display_config=$(snapctl get display-config)
if [ -n "${display_config}" ]; then
Copy link
Contributor

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?

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~"
Copy link
Contributor

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?

Copy link
Contributor

@Saviq Saviq left a 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.

@Saviq Saviq merged commit b79152f into master Sep 28, 2018
@AlanGriffiths AlanGriffiths deleted the display-config branch January 24, 2019 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants