File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "flag"
5
+
4
6
"fyne.io/fyne/v2/app"
5
7
6
8
"github.com/FyshOS/saver"
@@ -9,10 +11,14 @@ import (
9
11
func main () {
10
12
a := app .NewWithID ("com.fyshos.fyshsaver" )
11
13
14
+ lock := flag .Bool ("lock" , false , "Lock the screen" )
15
+ label := flag .String ("label" , "(clock)" , "Label to display" )
16
+ flag .Parse ()
17
+
12
18
s := saver .NewScreenSaver (a .Quit )
13
19
s .ClockFormat = a .Preferences ().StringWithFallback ("clockformatting" , "12h" )
14
- s .Label = a . Preferences (). StringWithFallback ( "fysh. label" , "FyshOS" )
15
- s .Lock = true
20
+ s .Label = * label
21
+ s .Lock = * lock
16
22
17
23
s .ShowWindow ()
18
24
a .Run ()
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ func (s *ScreenSaver) startedInput(w fyne.Window) {
187
187
if s .started .After (time .Now ().Add (time .Millisecond * - 200 )) {
188
188
return // something flickering as we start
189
189
}
190
- if ! s .Lock && s .started .After (time .Now ().Add (time .Second * - 3 )) {
190
+ if ! s .Lock || s .started .After (time .Now ().Add (time .Second * - 3 )) {
191
191
showCursor (w )
192
192
s .unlock ()
193
193
return
You can’t perform that action at this time.
0 commit comments