-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate reloading display configuration (#122)
This allows Frame to handle display reconfiguration without a restart. Features: 1. If there is no `display` option set, then when Frame runs it is set to a default 2. When the `display` option is set: 2.1. With Miral < 3.8 Frame is restarted and will load the new display configuration 2.2. With Miral 3.8 Frame is not restarted and will attempt to reload 3. When the display option is unset, the configuration is cleared and Frame restarted Note: there is (still) no validation of the configuration being set Fixes: #20
- Loading branch information
1 parent
ae5a6a9
commit f0e4565
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
wait_for() | ||
{ | ||
until | ||
until | ||
inotifywait --event create "$(dirname "$1")"& | ||
inotify_pid=$! | ||
[ -e "$1" ] || sleep 2 && [ -e "$1" ] | ||
do | ||
wait "${inotify_pid}" | ||
done | ||
kill "${inotify_pid}" | ||
[ -O "$1" ] | ||
do | ||
sleep 1 | ||
done | ||
} | ||
|
||
display_file="$SNAP_DATA/frame.display" | ||
|
||
wait_for "${display_file}" | ||
|
||
if [ -z "$(snapctl get display)" ] && ! grep "DO NOT EDIT THIS FILE BY HAND" "${display_file}" | ||
then | ||
snapctl set display="$(cat "${display_file}")" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#!/bin/sh | ||
set -eux | ||
|
||
display_file="$SNAP_DATA/frame.display" | ||
if [ -z "$(snapctl get display)" ] | ||
then | ||
initialise-display-config& | ||
fi | ||
|
||
exec nohup "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters