1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Compare commits

...

6 Commits

Author SHA1 Message Date
LuckShiba
56c69fe1a7 doctor: show compositor, quickshell and cli path in verbose 2025-12-28 15:08:59 -03:00
LuckShiba
735428be64 doctor: use console.warn for quickshell feature logs 2025-12-28 15:08:59 -03:00
LuckShiba
ec10c8e301 feat: doctor command 2025-12-28 15:08:59 -03:00
johngalt
c281bf3b53 Adding Zen Browser matugen template (#1181)
* Adding Zen Browser matugen template

* Fixing indentation for matugen.go edits

* Trying to fix linting again..

* Tweaking contrasting surface colors in css, renamed file to match how firefox userchrome is named, also changed output directory to DMS config directory (like firefox)

* Modifing Zen userChrome again: removing unused css stuff, tweaking colors to better align with how pywalfox handles backgrounds/toolbars

* Last few tweaks on CSS - changing url bar highlight color, changing contrast on selected urls in dropdown

* matugen.go: fix check command for zen browser

* search_index: add zen browser setting
2025-12-28 12:52:41 -05:00
bbedward
45b8b2a895 clipboard: don't store sensitive mime types in history
fixes #1185
2025-12-28 11:13:34 -05:00
Tacticalsmooth
7b9ba840fb fixed lambda issue on nixos (#1188) 2025-12-28 12:50:07 +01:00
14 changed files with 879 additions and 4 deletions

View File

@@ -513,5 +513,6 @@ func getCommonCommands() []*cobra.Command {
notifyActionCmd,
matugenCmd,
clipboardCmd,
doctorCmd,
}
}

View File

@@ -0,0 +1,684 @@
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"slices"
"strings"
"github.com/AvengeMedia/DankMaterialShell/core/internal/config"
"github.com/AvengeMedia/DankMaterialShell/core/internal/distros"
"github.com/AvengeMedia/DankMaterialShell/core/internal/tui"
"github.com/AvengeMedia/DankMaterialShell/core/internal/utils"
"github.com/AvengeMedia/DankMaterialShell/core/internal/version"
"github.com/spf13/cobra"
)
var doctorCmd = &cobra.Command{
Use: "doctor",
Short: "Diagnose DMS installation and dependencies",
Long: "Check system health, verify dependencies, and diagnose configuration issues for DMS",
Run: runDoctor,
}
var doctorVerbose bool
func init() {
doctorCmd.Flags().BoolVarP(&doctorVerbose, "verbose", "v", false, "Show detailed output including paths and versions")
}
type category int
const (
catSystem category = iota
catVersions
catInstallation
catCompositor
catQuickshellFeatures
catOptionalFeatures
catConfigFiles
catServices
)
var categoryNames = []string{
"System", "Versions", "Installation", "Compositor",
"Quickshell Features", "Optional Features", "Config Files", "Services",
}
type checkResult struct {
category category
name string
status string
message string
details string
}
func runDoctor(cmd *cobra.Command, args []string) {
printDoctorHeader()
qsFeatures, qsMissingFeatures := checkQuickshellFeatures()
results := slices.Concat(
checkSystemInfo(),
checkVersions(qsMissingFeatures),
checkDMSInstallation(),
checkWindowManagers(),
qsFeatures,
checkOptionalDependencies(),
checkConfigurationFiles(),
checkSystemdServices(),
)
printResults(results)
printSummary(results, qsMissingFeatures)
}
func printDoctorHeader() {
theme := tui.TerminalTheme()
styles := tui.NewStyles(theme)
fmt.Println(getThemedASCII())
fmt.Println(styles.Title.Render("System Health Check"))
fmt.Println(styles.Subtle.Render("──────────────────────────────────────"))
fmt.Println()
}
func checkSystemInfo() []checkResult {
results := []checkResult{}
osInfo, err := distros.GetOSInfo()
if err != nil {
status, message, details := "warn", fmt.Sprintf("Unknown (%v)", err), ""
if strings.Contains(err.Error(), "Unsupported distribution") {
osRelease := readOSRelease()
if osRelease["ID"] == "nixos" {
status = "ok"
message = osRelease["PRETTY_NAME"]
if message == "" {
message = fmt.Sprintf("NixOS %s", osRelease["VERSION_ID"])
}
details = "Supported for runtime (install via NixOS module or Flake)"
} else if osRelease["PRETTY_NAME"] != "" {
message = fmt.Sprintf("%s (not supported by dms setup)", osRelease["PRETTY_NAME"])
details = "DMS may work but automatic installation is not available"
}
}
results = append(results, checkResult{catSystem, "Operating System", status, message, details})
} else {
status := "ok"
message := osInfo.PrettyName
if message == "" {
message = fmt.Sprintf("%s %s", osInfo.Distribution.ID, osInfo.VersionID)
}
if distros.IsUnsupportedDistro(osInfo.Distribution.ID, osInfo.VersionID) {
status = "warn"
message += " (version may not be fully supported)"
}
results = append(results, checkResult{
catSystem, "Operating System", status, message,
fmt.Sprintf("ID: %s, Version: %s, Arch: %s", osInfo.Distribution.ID, osInfo.VersionID, osInfo.Architecture),
})
}
arch := runtime.GOARCH
archStatus := "ok"
if arch != "amd64" && arch != "arm64" {
archStatus = "error"
}
results = append(results, checkResult{catSystem, "Architecture", archStatus, arch, ""})
waylandDisplay := os.Getenv("WAYLAND_DISPLAY")
xdgSessionType := os.Getenv("XDG_SESSION_TYPE")
switch {
case waylandDisplay != "" || xdgSessionType == "wayland":
results = append(results, checkResult{
catSystem, "Display Server", "ok", "Wayland",
fmt.Sprintf("WAYLAND_DISPLAY=%s", waylandDisplay),
})
case xdgSessionType == "x11":
results = append(results, checkResult{catSystem, "Display Server", "error", "X11 (DMS requires Wayland)", ""})
default:
results = append(results, checkResult{
catSystem, "Display Server", "warn", "Unknown (ensure you're running Wayland)",
fmt.Sprintf("XDG_SESSION_TYPE=%s", xdgSessionType),
})
}
return results
}
func readOSRelease() map[string]string {
result := make(map[string]string)
data, err := os.ReadFile("/etc/os-release")
if err != nil {
return result
}
for line := range strings.SplitSeq(string(data), "\n") {
if parts := strings.SplitN(line, "=", 2); len(parts) == 2 {
result[parts[0]] = strings.Trim(parts[1], "\"")
}
}
return result
}
func checkVersions(qsMissingFeatures bool) []checkResult {
dmsCliPath, _ := os.Executable()
dmsCliDetails := ""
if doctorVerbose {
dmsCliDetails = dmsCliPath
}
results := []checkResult{
{catVersions, "DMS CLI", "ok", formatVersion(Version), dmsCliDetails},
}
qsVersion, qsStatus, qsPath := getQuickshellVersionInfo(qsMissingFeatures)
qsDetails := ""
if doctorVerbose && qsPath != "" {
qsDetails = qsPath
}
results = append(results, checkResult{catVersions, "Quickshell", qsStatus, qsVersion, qsDetails})
dmsVersion, dmsPath := getDMSShellVersion()
if dmsVersion != "" {
results = append(results, checkResult{catVersions, "DMS Shell", "ok", dmsVersion, dmsPath})
} else {
results = append(results, checkResult{catVersions, "DMS Shell", "error", "Not installed or not detected", "Run 'dms setup' to install"})
}
return results
}
func getDMSShellVersion() (version, path string) {
if err := findConfig(nil, nil); err == nil && configPath != "" {
versionFile := filepath.Join(configPath, "VERSION")
if data, err := os.ReadFile(versionFile); err == nil {
return strings.TrimSpace(string(data)), configPath
}
return "installed", configPath
}
if dmsPath, err := config.LocateDMSConfig(); err == nil {
versionFile := filepath.Join(dmsPath, "VERSION")
if data, err := os.ReadFile(versionFile); err == nil {
return strings.TrimSpace(string(data)), dmsPath
}
return "installed", dmsPath
}
return "", ""
}
func getQuickshellVersionInfo(missingFeatures bool) (string, string, string) {
if !utils.CommandExists("qs") {
return "Not installed", "error", ""
}
qsPath, _ := exec.LookPath("qs")
output, err := exec.Command("qs", "--version").Output()
if err != nil {
return "Installed (version check failed)", "warn", qsPath
}
fullVersion := strings.TrimSpace(string(output))
if matches := regexp.MustCompile(`quickshell (\d+\.\d+\.\d+)`).FindStringSubmatch(fullVersion); len(matches) >= 2 {
if version.CompareVersions(matches[1], "0.2.0") < 0 {
return fmt.Sprintf("%s (needs >= 0.2.0)", fullVersion), "error", qsPath
}
if missingFeatures {
return fullVersion, "warn", qsPath
}
return fullVersion, "ok", qsPath
}
return fullVersion, "warn", qsPath
}
func checkDMSInstallation() []checkResult {
results := []checkResult{}
dmsPath := ""
if err := findConfig(nil, nil); err == nil && configPath != "" {
dmsPath = configPath
} else if path, err := config.LocateDMSConfig(); err == nil {
dmsPath = path
}
if dmsPath == "" {
return []checkResult{{catInstallation, "DMS Configuration", "error", "Not found", "shell.qml not found in any config path"}}
}
results = append(results, checkResult{catInstallation, "DMS Configuration", "ok", "Found", dmsPath})
shellQml := filepath.Join(dmsPath, "shell.qml")
if _, err := os.Stat(shellQml); err != nil {
results = append(results, checkResult{catInstallation, "shell.qml", "error", "Missing", shellQml})
} else {
results = append(results, checkResult{catInstallation, "shell.qml", "ok", "Present", shellQml})
}
if doctorVerbose {
installType := "Unknown"
switch {
case strings.Contains(dmsPath, "/nix/store"):
installType = "Nix store"
case strings.Contains(dmsPath, ".local/share") || strings.Contains(dmsPath, "/usr/share"):
installType = "System package"
case strings.Contains(dmsPath, ".config"):
installType = "User config"
}
results = append(results, checkResult{catInstallation, "Install Type", "info", installType, dmsPath})
}
return results
}
func checkWindowManagers() []checkResult {
compositors := []struct {
name, versionCmd, versionArg, versionRe string
commands []string
}{
{"Hyprland", "hyprctl", "version", `v?(\d+\.\d+\.\d+)`, []string{"hyprland", "Hyprland"}},
{"niri", "niri", "--version", `niri (\d+\.\d+)`, []string{"niri"}},
{"Sway", "sway", "--version", `sway version (\d+\.\d+)`, []string{"sway"}},
{"River", "river", "-version", `river (\d+\.\d+)`, []string{"river"}},
{"Wayfire", "wayfire", "--version", `wayfire (\d+\.\d+)`, []string{"wayfire"}},
}
results := []checkResult{}
foundAny := false
for _, c := range compositors {
if slices.ContainsFunc(c.commands, utils.CommandExists) {
foundAny = true
var compositorPath string
for _, cmd := range c.commands {
if path, err := exec.LookPath(cmd); err == nil {
compositorPath = path
break
}
}
details := ""
if doctorVerbose && compositorPath != "" {
details = compositorPath
}
results = append(results, checkResult{
catCompositor, c.name, "ok",
getVersionFromCommand(c.versionCmd, c.versionArg, c.versionRe), details,
})
}
}
if !foundAny {
results = append(results, checkResult{
catCompositor, "Compositor", "error",
"No supported Wayland compositor found",
"Install Hyprland, niri, Sway, River, or Wayfire",
})
}
if wm := detectRunningWM(); wm != "" {
results = append(results, checkResult{catCompositor, "Active", "info", wm, ""})
}
return results
}
func getVersionFromCommand(cmd, arg, regex string) string {
output, err := exec.Command(cmd, arg).Output()
if err != nil {
return "installed"
}
outStr := string(output)
if matches := regexp.MustCompile(regex).FindStringSubmatch(outStr); len(matches) > 1 {
ver := matches[1]
if strings.Contains(outStr, "git") || strings.Contains(outStr, "dirty") {
return ver + " (git)"
}
return ver
}
return strings.TrimSpace(outStr)
}
func detectRunningWM() string {
switch {
case os.Getenv("HYPRLAND_INSTANCE_SIGNATURE") != "":
return "Hyprland"
case os.Getenv("NIRI_SOCKET") != "":
return "niri"
case os.Getenv("XDG_CURRENT_DESKTOP") != "":
return os.Getenv("XDG_CURRENT_DESKTOP")
}
return ""
}
func checkQuickshellFeatures() ([]checkResult, bool) {
if !utils.CommandExists("qs") {
return nil, false
}
tmpDir := os.TempDir()
testScript := filepath.Join(tmpDir, "qs-feature-test.qml")
defer os.Remove(testScript)
qmlContent := `
import QtQuick
import Quickshell
ShellRoot {
id: root
property bool polkitAvailable: false
property bool idleMonitorAvailable: false
property bool idleInhibitorAvailable: false
property bool shortcutInhibitorAvailable: false
Timer {
interval: 50
running: true
repeat: false
onTriggered: {
try {
var polkitTest = Qt.createQmlObject(
'import Quickshell.Services.Polkit; import QtQuick; Item {}',
root
)
root.polkitAvailable = true
polkitTest.destroy()
} catch (e) {}
try {
var testItem = Qt.createQmlObject(
'import Quickshell.Wayland; import QtQuick; QtObject { ' +
'readonly property bool hasIdleMonitor: typeof IdleMonitor !== "undefined"; ' +
'readonly property bool hasIdleInhibitor: typeof IdleInhibitor !== "undefined"; ' +
'readonly property bool hasShortcutInhibitor: typeof ShortcutInhibitor !== "undefined" ' +
'}',
root
)
root.idleMonitorAvailable = testItem.hasIdleMonitor
root.idleInhibitorAvailable = testItem.hasIdleInhibitor
root.shortcutInhibitorAvailable = testItem.hasShortcutInhibitor
testItem.destroy()
} catch (e) {}
console.warn(root.polkitAvailable ? "FEATURE:Polkit:OK" : "FEATURE:Polkit:UNAVAILABLE")
console.warn(root.idleMonitorAvailable ? "FEATURE:IdleMonitor:OK" : "FEATURE:IdleMonitor:UNAVAILABLE")
console.warn(root.idleInhibitorAvailable ? "FEATURE:IdleInhibitor:OK" : "FEATURE:IdleInhibitor:UNAVAILABLE")
console.warn(root.shortcutInhibitorAvailable ? "FEATURE:ShortcutInhibitor:OK" : "FEATURE:ShortcutInhibitor:UNAVAILABLE")
Quickshell.execDetached(["kill", "-TERM", String(Quickshell.processId)])
}
}
}
`
if err := os.WriteFile(testScript, []byte(qmlContent), 0644); err != nil {
return nil, false
}
cmd := exec.Command("qs", "-p", testScript)
cmd.Env = append(os.Environ(), "NO_COLOR=1")
output, _ := cmd.CombinedOutput()
outputStr := string(output)
features := []struct{ name, desc string }{
{"Polkit", "Authentication prompts"},
{"IdleMonitor", "Idle detection"},
{"IdleInhibitor", "Prevent idle/sleep"},
{"ShortcutInhibitor", "Allow shortcut management (niri)"},
}
results := []checkResult{}
missingFeatures := false
for _, f := range features {
available := strings.Contains(outputStr, fmt.Sprintf("FEATURE:%s:OK", f.name))
status, message := "ok", "Available"
if !available {
status, message = "info", "Not available"
missingFeatures = true
}
results = append(results, checkResult{catQuickshellFeatures, f.name, status, message, f.desc})
}
return results, missingFeatures
}
func checkOptionalDependencies() []checkResult {
results := []checkResult{}
if utils.IsServiceActive("accounts-daemon", false) {
results = append(results, checkResult{catOptionalFeatures, "accountsservice", "ok", "Running", "User accounts"})
} else {
results = append(results, checkResult{catOptionalFeatures, "accountsservice", "warn", "Not running", "User accounts"})
}
terminals := []string{"ghostty", "kitty", "alacritty", "foot", "wezterm"}
terminalFound := ""
for _, term := range terminals {
if utils.CommandExists(term) {
terminalFound = term
break
}
}
if terminalFound != "" {
results = append(results, checkResult{catOptionalFeatures, "Terminal", "ok", terminalFound, ""})
} else {
results = append(results, checkResult{catOptionalFeatures, "Terminal", "warn", "None found", "Install ghostty, kitty, or alacritty"})
}
deps := []struct {
name, cmd, altCmd, desc string
important bool
}{
{"matugen", "matugen", "", "Dynamic theming", true},
{"dgop", "dgop", "", "System monitoring", true},
{"cava", "cava", "", "Audio waveform", false},
{"khal", "khal", "", "Calendar events", false},
{"Network", "nmcli", "iwctl", "Network management", false},
{"danksearch", "dsearch", "", "File search", false},
{"loginctl", "loginctl", "", "Session management", false},
{"fprintd", "fprintd-list", "", "Fingerprint auth", false},
}
for _, d := range deps {
found, foundCmd := utils.CommandExists(d.cmd), d.cmd
if !found && d.altCmd != "" {
if utils.CommandExists(d.altCmd) {
found, foundCmd = true, d.altCmd
}
}
if found {
message := "Installed"
switch foundCmd {
case "nmcli":
message = "NetworkManager"
case "iwctl":
message = "iwd"
}
results = append(results, checkResult{catOptionalFeatures, d.name, "ok", message, d.desc})
} else if d.important {
results = append(results, checkResult{catOptionalFeatures, d.name, "warn", "Missing", d.desc})
} else {
results = append(results, checkResult{catOptionalFeatures, d.name, "info", "Not installed", d.desc})
}
}
return results
}
func checkConfigurationFiles() []checkResult {
configFiles := []struct{ name, path string }{
{"Settings", filepath.Join(utils.XDGConfigHome(), "DankMaterialShell", "settings.json")},
{"Session", filepath.Join(utils.XDGStateHome(), "DankMaterialShell", "session.json")},
{"Colors", filepath.Join(utils.XDGCacheHome(), "DankMaterialShell", "dms-colors.json")},
}
results := []checkResult{}
for _, cf := range configFiles {
if _, err := os.Stat(cf.path); err == nil {
results = append(results, checkResult{catConfigFiles, cf.name, "ok", "Present", cf.path})
} else {
results = append(results, checkResult{catConfigFiles, cf.name, "info", "Not yet created", cf.path})
}
}
return results
}
func checkSystemdServices() []checkResult {
if !utils.CommandExists("systemctl") {
return nil
}
results := []checkResult{}
dmsState := getServiceState("dms", true)
if !dmsState.exists {
results = append(results, checkResult{catServices, "dms.service", "info", "Not installed", "Optional user service"})
} else {
status, message := "ok", dmsState.enabled
if dmsState.active != "" {
message = fmt.Sprintf("%s, %s", dmsState.enabled, dmsState.active)
}
if dmsState.enabled == "disabled" {
status, message = "warn", "Disabled"
}
results = append(results, checkResult{catServices, "dms.service", status, message, ""})
}
greetdState := getServiceState("greetd", false)
if greetdState.exists {
status := "ok"
if greetdState.enabled == "disabled" {
status = "info"
}
results = append(results, checkResult{catServices, "greetd", status, greetdState.enabled, ""})
} else if doctorVerbose {
results = append(results, checkResult{catServices, "greetd", "info", "Not installed", "Optional greeter service"})
}
return results
}
type serviceState struct {
exists bool
enabled string
active string
}
func getServiceState(name string, userService bool) serviceState {
args := []string{"is-enabled", name}
if userService {
args = []string{"--user", "is-enabled", name}
}
output, _ := exec.Command("systemctl", args...).Output()
enabled := strings.TrimSpace(string(output))
if enabled == "" || enabled == "not-found" {
return serviceState{}
}
state := serviceState{exists: true, enabled: enabled}
if userService {
output, _ = exec.Command("systemctl", "--user", "is-active", name).Output()
if active := strings.TrimSpace(string(output)); active != "" && active != "unknown" {
state.active = active
}
}
return state
}
func printResults(results []checkResult) {
theme := tui.TerminalTheme()
styles := tui.NewStyles(theme)
currentCategory := category(-1)
for _, r := range results {
if r.category != currentCategory {
if currentCategory != -1 {
fmt.Println()
}
fmt.Printf(" %s\n", styles.Bold.Render(categoryNames[r.category]))
currentCategory = r.category
}
printResultLine(r, styles)
}
}
func printResultLine(r checkResult, styles tui.Styles) {
icon, style := "○", styles.Subtle
switch r.status {
case "ok":
icon, style = "●", styles.Success
case "warn":
icon, style = "●", styles.Warning
case "error":
icon, style = "●", styles.Error
}
name := r.name
if len(name) > 18 {
name = name[:17] + "…"
}
dots := strings.Repeat("·", 19-len(name))
fmt.Printf(" %s %s %s %s\n", style.Render(icon), name, styles.Subtle.Render(dots), r.message)
if doctorVerbose && r.details != "" {
fmt.Printf(" %s\n", styles.Subtle.Render("└─ "+r.details))
}
}
func printSummary(results []checkResult, qsMissingFeatures bool) {
theme := tui.TerminalTheme()
styles := tui.NewStyles(theme)
errors, warnings, ok := 0, 0, 0
for _, r := range results {
switch r.status {
case "error":
errors++
case "warn":
warnings++
case "ok":
ok++
}
}
fmt.Println()
fmt.Printf(" %s\n", styles.Subtle.Render("──────────────────────────────────────"))
if errors == 0 && warnings == 0 {
fmt.Printf(" %s\n", styles.Success.Render("✓ All checks passed!"))
} else {
parts := []string{}
if errors > 0 {
parts = append(parts, styles.Error.Render(fmt.Sprintf("%d error(s)", errors)))
}
if warnings > 0 {
parts = append(parts, styles.Warning.Render(fmt.Sprintf("%d warning(s)", warnings)))
}
parts = append(parts, styles.Success.Render(fmt.Sprintf("%d ok", ok)))
fmt.Printf(" %s\n", strings.Join(parts, ", "))
if qsMissingFeatures {
fmt.Println()
fmt.Printf(" %s\n", styles.Subtle.Render("→ Consider using quickshell-git for full feature support"))
}
}
fmt.Println()
}

View File

@@ -255,6 +255,9 @@ output_path = '%s'
if !opts.ShouldSkipTemplate("pywalfox") {
appendConfig(opts, cfgFile, "pywalfox", "pywalfox.toml")
}
if !opts.ShouldSkipTemplate("zenbrowser") {
appendConfig(opts, cfgFile, "zen", "zenbrowser.toml")
}
if !opts.ShouldSkipTemplate("vesktop") {
appendConfig(opts, cfgFile, "vesktop", "vesktop.toml")
}

View File

@@ -11,14 +11,16 @@ import (
"io"
"os"
"path/filepath"
"slices"
"strings"
"syscall"
"time"
"hash/fnv"
"github.com/fsnotify/fsnotify"
_ "golang.org/x/image/bmp"
_ "golang.org/x/image/tiff"
"hash/fnv"
bolt "go.etcd.io/bbolt"
@@ -28,6 +30,11 @@ import (
wlclient "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
)
// These mime types wont be stored in history
var sensitiveMimeTypes = []string{
"x-kde-passwordManagerHint",
}
func NewManager(wlCtx wlcontext.WaylandContext, config Config) (*Manager, error) {
if config.Disabled {
return nil, fmt.Errorf("clipboard disabled in config")
@@ -253,6 +260,10 @@ func (m *Manager) setupDataDeviceSync() {
return
}
if m.hasSensitiveMimeType(mimes) {
return
}
preferredMime := m.selectMimeType(mimes)
if preferredMime == "" {
return
@@ -492,6 +503,12 @@ func extractHash(data []byte) uint64 {
return binary.BigEndian.Uint64(data[len(data)-8:])
}
func (m *Manager) hasSensitiveMimeType(mimes []string) bool {
return slices.ContainsFunc(mimes, func(mime string) bool {
return slices.Contains(sensitiveMimeTypes, mime)
})
}
func (m *Manager) selectMimeType(mimes []string) string {
preferredTypes := []string{
"text/plain;charset=utf-8",

View File

@@ -1,8 +1,24 @@
package utils
import "os/exec"
import (
"os/exec"
"strings"
)
func CommandExists(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
func IsServiceActive(name string, userService bool) bool {
if !CommandExists("systemctl") {
return false
}
args := []string{"is-active", name}
if userService {
args = []string{"--user", "is-active", name}
}
output, _ := exec.Command("systemctl", args...).Output()
return strings.TrimSpace(string(output)) == "active"
}

View File

@@ -6,6 +6,30 @@ import (
"strings"
)
func xdgDir(envVar string, defaultPath ...string) string {
if dir := os.Getenv(envVar); dir != "" {
return dir
}
home, _ := os.UserHomeDir()
return filepath.Join(append([]string{home}, defaultPath...)...)
}
func XDGConfigHome() string {
return xdgDir("XDG_CONFIG_HOME", ".config")
}
func XDGStateHome() string {
return xdgDir("XDG_STATE_HOME", ".local", "state")
}
func XDGCacheHome() string {
return xdgDir("XDG_CACHE_HOME", ".cache")
}
func XDGDataHome() string {
return xdgDir("XDG_DATA_HOME", ".local", "share")
}
func ExpandPath(path string) (string, error) {
expanded := os.ExpandEnv(path)
expanded = filepath.Clean(expanded)

View File

@@ -37,7 +37,7 @@ in
};
dgop = {
package = lib.mkPackageOption pkgs "dgop";
package = lib.mkPackageOption pkgs "dgop" {};
};
enableSystemMonitoring = lib.mkOption {

View File

@@ -288,6 +288,7 @@ Singleton {
property bool matugenTemplateQt6ct: true
property bool matugenTemplateFirefox: true
property bool matugenTemplatePywalfox: true
property bool matugenTemplateZenBrowser: true
property bool matugenTemplateVesktop: true
property bool matugenTemplateEquibop: true
property bool matugenTemplateGhostty: true

View File

@@ -876,7 +876,7 @@ Singleton {
if (typeof SettingsData !== "undefined") {
const skipTemplates = [];
if (!SettingsData.runDmsMatugenTemplates) {
skipTemplates.push("gtk", "neovim", "niri", "qt5ct", "qt6ct", "firefox", "pywalfox", "vesktop", "equibop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode");
skipTemplates.push("gtk", "neovim", "niri", "qt5ct", "qt6ct", "firefox", "pywalfox", "zenbrowser", "vesktop", "equibop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode");
} else {
if (!SettingsData.matugenTemplateGtk)
skipTemplates.push("gtk");
@@ -890,6 +890,8 @@ Singleton {
skipTemplates.push("firefox");
if (!SettingsData.matugenTemplatePywalfox)
skipTemplates.push("pywalfox");
if (!SettingsData.matugenTemplateZenBrowser)
skipTemplates.push("zenbrowser");
if (!SettingsData.matugenTemplateVesktop)
skipTemplates.push("vesktop");
if (!SettingsData.matugenTemplateEquibop)

View File

@@ -187,6 +187,7 @@ var SPEC = {
matugenTemplateQt6ct: { def: true },
matugenTemplateFirefox: { def: true },
matugenTemplatePywalfox: { def: true },
matugenTemplateZenBrowser: { def: true },
matugenTemplateVesktop: { def: true },
matugenTemplateEquibop: { def: true },
matugenTemplateGhostty: { def: true },

View File

@@ -1127,6 +1127,17 @@ Item {
onToggled: checked => SettingsData.set("matugenTemplatePywalfox", checked)
}
SettingsToggleRow {
tab: "theme"
tags: ["matugen", "zenbrowser", "template"]
settingKey: "matugenTemplateZenBrowser"
text: "zenbrowser"
description: ""
visible: SettingsData.runDmsMatugenTemplates
checked: SettingsData.matugenTemplateZenBrowser
onToggled: checked => SettingsData.set("matugenTemplateZenBrowser", checked)
}
SettingsToggleRow {
tab: "theme"
tags: ["matugen", "vesktop", "discord", "template"]

View File

@@ -0,0 +1,3 @@
[templates.dmszenbrowser]
input_path = 'SHELL_DIR/matugen/templates/zen-userchrome.css'
output_path = '~/.config/DankMaterialShell/zen.css'

View File

@@ -0,0 +1,94 @@
/* DMS Matugen Zen Browser Theme */
:root {
--zen-primary-color: {{colors.primary_container.default.hex}} !important;
--toolbarbutton-icon-fill: {{colors.primary.default.hex}} !important;
--toolbar-field-color: {{colors.on_background.default.hex}} !important;
--tab-selected-textcolor: {{colors.primary.default.hex}} !important;
--toolbar-color: {{colors.on_background.default.hex}} !important;
--arrowpanel-color: {{colors.on_surface.default.hex}} !important;
--arrowpanel-background: {{colors.surface_container.default.hex}} !important;
--sidebar-text-color: {{colors.on_background.default.hex}} !important;
--zen-main-browser-background: {{colors.background.default.hex}} !important;
}
.sidebar-placesTree {
background-color: {{colors.surface_container.default.hex}} !important;
}
#zen-workspaces-button {
background-color: {{colors.on_surface_variant.default.hex}} !important;
}
#TabsToolbar {
background-color: {{colors.background.default.hex}} !important;
}
.urlbar-background {
background-color: {{colors.surface_container.default.hex}} !important;
}
.urlbar-input::selection {
color: {{colors.on_primary.default.hex}} !important;
background-color: {{colors.primary.default.hex}} !important;
}
.urlbarView-url {
color: {{colors.on_surface_variant.default.hex}} !important;
}
toolbar .toolbarbutton-1 {
&:not([disabled]) {
&:is([open], [checked])
> :is(
.toolbarbutton-icon,
.toolbarbutton-text,
.toolbarbutton-badge-stack
) {
fill: {{colors.primary.default.hex}}
}
}
}
.identity-color-blue {
--identity-tab-color: {{dank16.color12.default.hex}} !important;
--identity-icon-color: {{dank16.color12.default.hex}} !important;
}
.identity-color-turquoise {
--identity-tab-color: {{dank16.color6.default.hex}} !important;
--identity-icon-color: {{dank16.color6.default.hex}} !important;
}
.identity-color-green {
--identity-tab-color: {{dank16.color10.default.hex}} !important;
--identity-icon-color: {{dank16.color10.default.hex}} !important;
}
.identity-color-yellow {
--identity-tab-color: {{dank16.color11.default.hex}} !important;
--identity-icon-color: {{dank16.color11.default.hex}} !important;
}
.identity-color-orange {
--identity-tab-color: {{dank16.color3.default.hex}} !important;
--identity-icon-color: {{dank16.color3.default.hex}} !important;
}
.identity-color-red {
--identity-tab-color: {{dank16.color9.default.hex}} !important;
--identity-icon-color: {{dank16.color9.default.hex}} !important;
}
.identity-color-pink {
--identity-tab-color: {{dank16.color13.default.hex}} !important;
--identity-icon-color: {{dank16.color13.default.hex}} !important;
}
.identity-color-purple {
--identity-tab-color: {{dank16.color5.default.hex}} !important;
--identity-icon-color: {{dank16.color5.default.hex}} !important;
}
#zen-appcontent-navbar-container {
background-color: {{colors.background.default.hex}} !important;
}

View File

@@ -1565,6 +1565,24 @@
"theme"
]
},
{
"section": "matugenTemplateZenBrowser",
"label": "Zen Browser",
"tabIndex": 10,
"category": "Theme & Colors",
"keywords": [
"appearance",
"colors",
"zen",
"zenbrowser",
"look",
"matugen",
"scheme",
"style",
"template",
"theme"
]
},
{
"section": "matugenTemplateGtk",
"label": "GTK",