File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 66 "os"
77 "os/signal"
88 "path/filepath"
9+ "regexp"
910 "sync"
1011 "syscall"
1112 "time"
3132 keyboard uinput.Keyboard
3233 shutdown = make (chan error )
3334
35+ invalidChars = regexp .MustCompile ("[[:^graph:]]+" )
36+
3437 pa * PulseAudio
3538 xorg * Xorg
3639 recentWindows []Window
@@ -69,6 +72,10 @@ func verboseLog(format string, a ...interface{}) {
6972 }
7073}
7174
75+ func strip (s string ) string {
76+ return invalidChars .ReplaceAllString (s , "" )
77+ }
78+
7279func expandPath (base , path string ) (string , error ) {
7380 var err error
7481 path , err = homedir .Expand (path )
@@ -254,7 +261,7 @@ func initDevice() (*streamdeck.Device, error) {
254261 return & dev , err
255262 }
256263 verboseLog ("Found device with serial %s (%d buttons, firmware %s)" ,
257- dev .Serial , dev .Keys , ver )
264+ dev .Serial , dev .Keys , strip ( ver ) )
258265
259266 if err := dev .Reset (); err != nil {
260267 return & dev , err
You can’t perform that action at this time.
0 commit comments