screen-lock: the operator's lock screen is kept, i3lock-color with its blur, ring and clock
The first version swapped the colour build for the distribution's plain i3lock and locked to black; adopting means keeping what the operator had. Plain i3lock remains the fallback, with a blurred screenshot of its own.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// screen-lock's shape (novox/hq ADR 0208, research 026/04): it claims node-lock-screen serving lock,
|
||||
// requires the X display on its own machine, installs the watcher and the distribution's locker,
|
||||
// declares the colour build and xscreensaver absent, places its locker, and starts the watcher and
|
||||
// keeps the colour build where it is found (the operator's look), declares xscreensaver absent, places its locker, and starts the watcher and
|
||||
// the timeouts once, from the session's start. The lock key is the window manager's.
|
||||
|
||||
func TestItClaimsTheLockScreenSeatServingLockAndRequiresTheXDisplay(t *testing.T) {
|
||||
@@ -24,10 +24,10 @@ func TestItClaimsTheLockScreenSeatServingLockAndRequiresTheXDisplay(t *testing.T
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheDistributionsLockerReplacesTheColourBuildAndXscreensaverGoes(t *testing.T) {
|
||||
func TestTheColourBuildIsKeptWithAFallbackAndXscreensaverGoes(t *testing.T) {
|
||||
m := readManifest(t)
|
||||
present, absent := m.packages()
|
||||
if !reflect.DeepEqual(present, []string{"xss-lock", "i3lock"}) || !reflect.DeepEqual(absent, []string{"i3lock-color", "xscreensaver"}) {
|
||||
if !reflect.DeepEqual(present, []string{"xss-lock", "i3lock"}) || !reflect.DeepEqual(absent, []string{"xscreensaver"}) {
|
||||
t.Fatalf("packages: %v, absent %v", present, absent)
|
||||
}
|
||||
m.sameAsSource(t, "wrapper", "files/bin/screen-lock")
|
||||
@@ -36,9 +36,14 @@ func TestTheDistributionsLockerReplacesTheColourBuildAndXscreensaverGoes(t *test
|
||||
t.Fatalf("the locker: %v", wrapper)
|
||||
}
|
||||
c := wrapper["content"].(string)
|
||||
// The colour build's options only once it has said it is the colour build: the distribution's
|
||||
// i3lock refuses an option it does not know, and the screen would not lock at all.
|
||||
check := strings.Index(c, "i3lock --version 2>&1 | grep -qi color")
|
||||
fallback := strings.Index(c, "\nelse\n")
|
||||
for _, colourOnly := range []string{"--ring-color", "--blur", "--clock", "--indicator", "--time-str"} {
|
||||
if strings.Contains(c, colourOnly) {
|
||||
t.Errorf("the wrapper passes %s, which only the colour build knows", colourOnly)
|
||||
at := strings.Index(c, colourOnly)
|
||||
if at < 0 || check < 0 || at < check || at > fallback {
|
||||
t.Errorf("%s is passed outside the colour build's branch", colourOnly)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(c, "XSS_SLEEP_LOCK_FD}<&-") {
|
||||
|
||||
Reference in New Issue
Block a user