1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 00:12:50 -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
11 changed files with 188 additions and 15 deletions

View File

@@ -169,12 +169,22 @@ func readOSRelease() map[string]string {
}
func checkVersions(qsMissingFeatures bool) []checkResult {
results := []checkResult{
{catVersions, "DMS CLI", "info", formatVersion(Version), ""},
dmsCliPath, _ := os.Executable()
dmsCliDetails := ""
if doctorVerbose {
dmsCliDetails = dmsCliPath
}
qsVersion, qsStatus := getQuickshellVersionInfo(qsMissingFeatures)
results = append(results, checkResult{catVersions, "Quickshell", qsStatus, qsVersion, ""})
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 != "" {
@@ -206,28 +216,30 @@ func getDMSShellVersion() (version, path string) {
return "", ""
}
func getQuickshellVersionInfo(missingFeatures bool) (string, string) {
func getQuickshellVersionInfo(missingFeatures bool) (string, string, string) {
if !utils.CommandExists("qs") {
return "Not installed", "error"
return "Not installed", "error", ""
}
qsPath, _ := exec.LookPath("qs")
output, err := exec.Command("qs", "--version").Output()
if err != nil {
return "Installed (version check failed)", "warn"
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"
return fmt.Sprintf("%s (needs >= 0.2.0)", fullVersion), "error", qsPath
}
if missingFeatures {
return fullVersion, "warn"
return fullVersion, "warn", qsPath
}
return fullVersion, "ok"
return fullVersion, "ok", qsPath
}
return fullVersion, "warn"
return fullVersion, "warn", qsPath
}
func checkDMSInstallation() []checkResult {
@@ -287,9 +299,20 @@ func checkWindowManagers() []checkResult {
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), "",
getVersionFromCommand(c.versionCmd, c.versionArg, c.versionRe), details,
})
}
}

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

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