This tool sets drive icons that can be seen on windows and mac os, with a gui and codebase that should work on linux, windows, and mac. I have tested it with png and jpeg, but it may work with other formats.
After getting the target drive and image, this tool...
- deletes the following files to prevent weird issues overwriting
.autorun.ico
autorun.inf
.VolumeIcon.icns
._
._.VolumeIcon.icns
- to apply windows icon it
- writes the icon as an ico file
- points to it with the
autorun.inf
file
- to apply mac icon it
- writes the icon as an icns file
- writes the
._
and._.VolumeIcon.icns
files- these files seem to be needed for the icon to appear - I don't know why
on mac os and unix systems, the autorun.inf file will be visible, as windows will not use it if it starts with a period
on windows systems, all files will be visible, as I haven't figured out a way to set the windows hidden property on non windows systems
- show drive names on windows via win32 api and build flags
- bring code up to golang standerds
- set windows hidden property for all written files - read fatattr's code?
- do it on unix systems
- add option to remove backgrounds from filetypes without transparency
- add options for how to crop non square files, instead of leaving it up to the os
- catch and log errors
if your building on your target os, go build .
and fyne package
will suffice. If you are building for a different os, fyne-cross <target os>
is what you should do. This will require docker, and a rather large initial download. Finally, if you add or change files in the data folder, you will need to run go-bindata data/...
to update the bindata.go
file, as the contents of the data folder will not be built into the final executable. Thanks for taking the time to contribute/build from source/read this far!
specific build commands
windows: fyne-cross windows
mac os: fyne-cross darwin
linux: go build . && fyne package
MIT - Go wild!
Lots of help from the Discord Gophers server, thank you all!