diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 9eef699..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.idea/bluetooth_flow.iml b/.idea/bluetooth_flow.iml
deleted file mode 100644
index c956989..0000000
--- a/.idea/bluetooth_flow.iml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index db64868..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index ca74b16..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 1a62b0a..2d4e5ed 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Alfred 4 workflow for mac bluetooth.
## Installation
-1. Download latest version from [releases](https://github.com/haoguanguan/bluetooth_flow/releases)
+1. Download latest version from [release](https://github.com/haoguanguan/bluetooth_flow/releases)
2. Double click and install it
## Manual
1. show all device info: just input `bb`
@@ -12,16 +12,17 @@ Alfred 4 workflow for mac bluetooth.
## Features
1. show bluetooth device info
+
status/battery/name
2. switch bluetooth status
- connect -> disconnect
- disconnect -> connect
+ 1. connect -> disconnect
+ 2. disconnect -> connect
## Build
```shell script
go build entry.go
```
-You should download golang, and use go mod for dependency manager.
+You should download golang, and use go mod for dependency management.
## Acknowledgement
1. I Got much information from [alfred-bluetooth-workflow](https://github.com/tilmanginzel/alfred-bluetooth-workflow)
2. I also used [blueutil](https://github.com/toy/blueutil) for quickly switch device status
diff --git a/entry b/entry
deleted file mode 100755
index 9282ddf..0000000
Binary files a/entry and /dev/null differ
diff --git a/system/system.go b/system/system.go
index 1617050..c6e9a8d 100644
--- a/system/system.go
+++ b/system/system.go
@@ -3,7 +3,6 @@ package system
import (
"encoding/json"
"fmt"
- "os"
"os/exec"
)
@@ -13,18 +12,12 @@ type Info struct {
}
func NewSystem(key string) (*Info, error) {
- command := fmt.Sprintf("system_profiler %s -json > .system.log", key)
+ command := fmt.Sprintf("system_profiler %s -json 2> /dev/null", key)
d, err := exec.Command("bash", "-c", command).CombinedOutput()
if err != nil {
return nil, err
}
- // fmt.Printf("%s", string(d))
- d, err = os.ReadFile(".system.log")
- if err != nil {
- return nil, err
- }
-
var res map[string]interface{}
if err = json.Unmarshal(d, &res); err != nil {
return nil, err