Compare commits

..

No commits in common. "62453daa17edfb4932c999f21f23715a8d5cd204" and "41f8406484e75e2dd514c583be31f152cfd00fa4" have entirely different histories.

9 changed files with 10 additions and 44 deletions

View File

@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: '^1.17' go-version: '^1.16.6'
- run: go version - run: go version
- name: Release - name: Release

View File

@ -4,7 +4,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [1.17.x] go-version: [1.16.x]
os: [ubuntu-latest] os: [ubuntu-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -16,6 +16,5 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Test - name: Test
run: | run: |
sudo apt update
sudo apt install xorg-dev libgl1-mesa-dev sudo apt install xorg-dev libgl1-mesa-dev
DISPLAY=:0 go test -mod=vendor ./... DISPLAY=:0 go test -mod=vendor ./...

View File

@ -35,7 +35,7 @@ var defaultTheme = Theme{
BrightMagenta: "#c397d8", BrightMagenta: "#c397d8",
BrightCyan: "#70c0b1", BrightCyan: "#70c0b1",
BrightWhite: "#eaeaea", BrightWhite: "#eaeaea",
Background: "#000000", Background: "#1d1f21",
Foreground: "#c5c8c6", Foreground: "#c5c8c6",
SelectionBackground: "#33aa33", SelectionBackground: "#33aa33",
SelectionForeground: "#ffffff", SelectionForeground: "#ffffff",

View File

@ -103,7 +103,7 @@ func (g *GUI) watchForUpdate() {
for range g.updateChan { for range g.updateChan {
ebiten.ScheduleFrame() ebiten.ScheduleFrame()
go func() { go func() {
if g.keyState.AnythingPressed() { for g.keyState.AnythingPressed() {
time.Sleep(time.Millisecond * 10) time.Sleep(time.Millisecond * 10)
ebiten.ScheduleFrame() ebiten.ScheduleFrame()
} }

View File

@ -4,6 +4,7 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"syscall"
"time" "time"
"github.com/liamg/darktile/internal/app/darktile/termutil" "github.com/liamg/darktile/internal/app/darktile/termutil"
@ -51,5 +52,7 @@ func (h *DmesgTimestampHinter) Click(api HintAPI) error {
} }
func setSysStartTime() { func setSysStartTime() {
sysStart = time.Now().Local().Add(time.Duration(int(getUptime()*-1)) * time.Second) sysInfo := &syscall.Sysinfo_t{}
_ = syscall.Sysinfo(sysInfo)
sysStart = time.Now().Local().Add(time.Duration(int(sysInfo.Uptime*-1)) * time.Second)
} }

View File

@ -1,23 +0,0 @@
//go:build cgo && (freebsd || openbsd)
package hinters
/*
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/timespec.h>
time_t getuptime() {
struct timespec tp;
clock_gettime(CLOCK_UPTIME, &tp);
return tp.tv_sec;
}
*/
import "C"
func getUptime() int64 {
time := C.getuptime()
return int64(time)
}

View File

@ -1,13 +0,0 @@
//go:build cgo && (linux || netbsd)
package hinters
import (
"syscall"
)
func getUptime() int64 {
sysInfo := &syscall.Sysinfo_t{}
_ = syscall.Sysinfo(sysInfo)
return sysInfo.Uptime
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
version=$(git describe --exact-match --tags 2>/dev/null || git describe 2>/dev/null || echo "prerelease") version=$(git describe --exact-match --tags 2>/dev/null || git describe 2>/dev/null || echo "prerelease")
go build \ go build \

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
set -e set -e