mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
core: migrate to dankgo shared go modules, embed quickshell in DMS
binary to mount at runtime, -c or DMS_SHELL_DIR overrides required to explicitly override embedded configuration
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// Package shellembed carries the quickshell UI inside the dms binary and
|
||||
// materializes it at runtime via dankgo/shellapp/shellfs, since quickshell
|
||||
// needs a real filesystem path. Customization goes through -c /
|
||||
// DMS_SHELL_DIR instead of editing the extraction.
|
||||
package shellembed
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"path"
|
||||
|
||||
"github.com/AvengeMedia/dankgo/shellapp/shellfs"
|
||||
)
|
||||
|
||||
const (
|
||||
distRoot = "dist"
|
||||
shellEntry = "shell.qml"
|
||||
)
|
||||
|
||||
// Available reports whether this binary was built with the embedded UI
|
||||
// (the withshell build tag).
|
||||
func Available() bool {
|
||||
info, err := fs.Stat(distFS, path.Join(distRoot, shellEntry))
|
||||
return err == nil && !info.IsDir()
|
||||
}
|
||||
|
||||
func Extract(baseDir string) (string, error) {
|
||||
sub, err := fs.Sub(distFS, distRoot)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return shellfs.Extract(sub, baseDir)
|
||||
}
|
||||
|
||||
func Prune(baseDir, keep string) {
|
||||
shellfs.Prune(baseDir, keep)
|
||||
}
|
||||
Reference in New Issue
Block a user