Compare commits

...

6 Commits

Author SHA1 Message Date
c3cb193bc1 Update build config to generate build artifacts 2024-02-03 21:49:55 -04:00
d538534db4 Update Makefile 2024-02-03 21:49:41 -04:00
b083506f62 Update gitignore 2024-02-03 21:47:35 -04:00
8eaa5a42f5 Add clean run config 2024-02-03 21:38:09 -04:00
e34cba1577 Add icons to program 2024-02-03 21:37:54 -04:00
51221ceb94 Add icons 2024-02-03 21:37:13 -04:00
9 changed files with 46 additions and 6 deletions

5
.gitignore vendored
View File

@ -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
View 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>

View File

@ -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>

View File

@ -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"

View File

@ -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
View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
ico/VolumeFix.xcf Normal file

Binary file not shown.

View File

@ -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")