Compare commits
6 Commits
b010ecbaec
...
c3cb193bc1
Author | SHA1 | Date | |
---|---|---|---|
c3cb193bc1 | |||
d538534db4 | |||
b083506f62 | |||
8eaa5a42f5 | |||
e34cba1577 | |||
51221ceb94 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,2 +1,7 @@
|
|||||||
# Build folder
|
# Build folder
|
||||||
bin
|
bin
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
ico/VolumeFix.go
|
||||||
|
ico/VolumeFix.ico
|
||||||
|
ico/VolumeFix.syso
|
8
.idea/runConfigurations/clean.xml
generated
Normal file
8
.idea/runConfigurations/clean.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="clean" type="MAKEFILE_TARGET_RUN_CONFIGURATION" factoryName="Makefile">
|
||||||
|
<makefile filename="$PROJECT_DIR$/Makefile" target="clean" workingDirectory="" arguments="">
|
||||||
|
<envs />
|
||||||
|
</makefile>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
4
.idea/runConfigurations/go_build_VolumeFix.xml
generated
4
.idea/runConfigurations/go_build_VolumeFix.xml
generated
@ -6,6 +6,8 @@
|
|||||||
<package value="VolumeFix" />
|
<package value="VolumeFix" />
|
||||||
<directory value="$PROJECT_DIR$" />
|
<directory value="$PROJECT_DIR$" />
|
||||||
<filePath value="$PROJECT_DIR$" />
|
<filePath value="$PROJECT_DIR$" />
|
||||||
<method v="2" />
|
<method v="2">
|
||||||
|
<option name="RunConfigurationTask" enabled="true" run_configuration_name="build" run_configuration_type="MAKEFILE_TARGET_RUN_CONFIGURATION" />
|
||||||
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
21
Makefile
21
Makefile
@ -1,7 +1,26 @@
|
|||||||
|
.PHONY: icon syso build clean
|
||||||
|
|
||||||
# Export CGO_ENABLED=1
|
# Export CGO_ENABLED=1
|
||||||
CGO_ENABLED=1
|
CGO_ENABLED=1
|
||||||
# Export C compiler
|
# Export C compiler
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
build:
|
icon:
|
||||||
|
magick convert ico/VolumeFix.png ico/VolumeFix.ico
|
||||||
|
2goarray Icon ico < ico/VolumeFix.ico > ico/VolumeFix.go
|
||||||
|
|
||||||
|
syso:
|
||||||
|
rsrc -ico ico/VolumeFix.ico -o ico/VolumeFix.syso
|
||||||
|
|
||||||
|
build: icon syso
|
||||||
go build -ldflags "-H windowsgui" -o bin/
|
go build -ldflags "-H windowsgui" -o bin/
|
||||||
|
|
||||||
|
build-debug: icon syso
|
||||||
|
go build -o bin/VolumeFix
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f "ico/VolumeFix.ico"
|
||||||
|
rm -f "ico/VolumeFix.go"
|
||||||
|
rm -f "ico/VolumeFix.syso"
|
||||||
|
rm -f "bin/VolumeFix.exe"
|
||||||
|
rm -f "bin/VolumeFix"
|
@ -1,6 +1,10 @@
|
|||||||
# Volume Fix
|
# Volume Fix
|
||||||
Simple program that listens for volume changes, and changes the increment by 1 instead of 2
|
Simple program that listens for volume changes, and changes the increment by 1 instead of 2
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
- Needs `github.com/akavel/rsrc` to build the icon into the executable
|
||||||
|
- Needs `github.com/cratonica/2goarray` to generate a go file from the icon
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
`make build`
|
`make build`
|
||||||
|
|
||||||
|
2
go.sum
2
go.sum
@ -1,3 +1,5 @@
|
|||||||
|
github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
|
||||||
|
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 h1:NRUJuo3v3WGC/g5YiyF790gut6oQr5f3FBI88Wv0dx4=
|
github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 h1:NRUJuo3v3WGC/g5YiyF790gut6oQr5f3FBI88Wv0dx4=
|
||||||
|
BIN
ico/VolumeFix.png
Normal file
BIN
ico/VolumeFix.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
ico/VolumeFix.xcf
Normal file
BIN
ico/VolumeFix.xcf
Normal file
Binary file not shown.
4
main.go
4
main.go
@ -1,9 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"VolumeFix/ico"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/getlantern/systray"
|
"github.com/getlantern/systray"
|
||||||
"github.com/getlantern/systray/example/icon"
|
|
||||||
"github.com/go-ole/go-ole"
|
"github.com/go-ole/go-ole"
|
||||||
"github.com/moutend/go-hook/pkg/keyboard"
|
"github.com/moutend/go-hook/pkg/keyboard"
|
||||||
"github.com/moutend/go-hook/pkg/types"
|
"github.com/moutend/go-hook/pkg/types"
|
||||||
@ -31,7 +31,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func onReady() {
|
func onReady() {
|
||||||
systray.SetIcon(icon.Data)
|
systray.SetIcon(ico.Icon)
|
||||||
systray.SetTitle("Volume Fix")
|
systray.SetTitle("Volume Fix")
|
||||||
systray.SetTooltip("Volume Fix")
|
systray.SetTooltip("Volume Fix")
|
||||||
quit := systray.AddMenuItem("Quit", "Quit the whole app")
|
quit := systray.AddMenuItem("Quit", "Quit the whole app")
|
||||||
|
Reference in New Issue
Block a user