mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
RoundRobinCheck test
This commit is contained in:
parent
9751dac79e
commit
325d57ac23
@ -239,6 +239,11 @@ func (self *TitleBar) SetSoundVolume(vol int) {
|
|||||||
func (self *TitleBar) CheckBatteryStat() {
|
func (self *TitleBar) CheckBatteryStat() {
|
||||||
bat_segs:= [][]int{[]int{0,6},[]int{7,15},[]int{16,20},[]int{21,30},[]int{31,50},[]int{51,60},[]int{61,80},[]int{81,90},[]int{91,100}}
|
bat_segs:= [][]int{[]int{0,6},[]int{7,15},[]int{16,20},[]int{21,30},[]int{31,50},[]int{51,60},[]int{61,80},[]int{81,90},[]int{91,100}}
|
||||||
|
|
||||||
|
if FileExists(sysgo.Battery) == false {
|
||||||
|
self.Icons["battery"] = self.Icons["battery_unknown"]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
file, err := os.Open( sysgo.Battery )
|
file, err := os.Open( sysgo.Battery )
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Could not open file ", sysgo.Battery)
|
fmt.Println("Could not open file ", sysgo.Battery)
|
||||||
|
|||||||
@ -243,7 +243,11 @@ func System(cmd string) string {
|
|||||||
ret := ""
|
ret := ""
|
||||||
out,err := exec.Command("bash","-c",cmd).Output()
|
out,err := exec.Command("bash","-c",cmd).Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
if _, ok := err.(*exec.ExitError); ok {
|
||||||
|
//exit code !=0 ,but it can be ignored
|
||||||
|
}else{
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
ret = string(out)
|
ret = string(out)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user