1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

Compare commits

...

7 Commits

Author SHA1 Message Date
bbedward
8161fd6acb i18n: add hebrew *partial*
- Most widgets and components lack proper RTL layout support
- Merging hebrew anyway, as these can be updated incrementally later
2025-12-04 11:39:58 -05:00
bbedward
2137920e81 dankslideout: put opacity on parent layer 2025-12-04 10:06:45 -05:00
bbedward
879102599c matugen: package vscode theme as vsix 2025-12-04 09:39:29 -05:00
bbedward
44190f07fe colorpicker: hide magnifier on startup 2025-12-04 09:14:12 -05:00
bbedward
a41487eb8f colorpicker: hide magnfier on monitor leave 2025-12-04 09:12:21 -05:00
bbedward
e1acaaa27c dankbar: add option to disable maximize detection
fixes #895
2025-12-04 08:56:04 -05:00
Marcus Ramberg
08a97aeff8 power: support automatic profile switching on battery change (#897) 2025-12-04 08:37:07 -05:00
25 changed files with 3932 additions and 318 deletions

View File

@@ -41,6 +41,7 @@ type LayerSurface struct {
wlPool *client.ShmPool
wlBuffer *client.Buffer
configured bool
hidden bool
}
type Picker struct {
@@ -359,6 +360,7 @@ func (p *Picker) createLayerSurface(output *Output) (*LayerSurface, error) {
state: NewSurfaceState(p.config.Format, p.config.Lowercase),
wlSurface: surface,
layerSurf: layerSurf,
hidden: true, // Start hidden, will show overlay when pointer enters
}
if p.viewporter != nil {
@@ -503,7 +505,13 @@ func (p *Picker) captureForSurface(ls *LayerSurface) {
}
func (p *Picker) redrawSurface(ls *LayerSurface) {
renderBuf := ls.state.Redraw()
var renderBuf *ShmBuffer
if ls.hidden {
// When hidden, just show the screenshot without overlay
renderBuf = ls.state.RedrawScreenOnly()
} else {
renderBuf = ls.state.Redraw()
}
if renderBuf == nil {
return
}
@@ -571,6 +579,15 @@ func (p *Picker) redrawSurface(ls *LayerSurface) {
ls.state.SwapBuffers()
}
func (p *Picker) hideSurface(ls *LayerSurface) {
if ls == nil || ls.wlSurface == nil || ls.hidden {
return
}
ls.hidden = true
// Redraw without the crosshair overlay
p.redrawSurface(ls)
}
func (p *Picker) setupInput() {
if p.seat == nil {
return
@@ -610,13 +627,22 @@ func (p *Picker) setupPointerHandlers() {
if p.activeSurface == nil {
return
}
// If surface was hidden, mark it as visible again
if p.activeSurface.hidden {
p.activeSurface.hidden = false
}
p.activeSurface.state.OnPointerMotion(e.SurfaceX, e.SurfaceY)
p.redrawSurface(p.activeSurface)
})
p.pointer.SetLeaveHandler(func(e client.PointerLeaveEvent) {
if p.activeSurface != nil && p.activeSurface.wlSurface.ID() == e.Surface.ID() {
p.activeSurface = nil
for _, ls := range p.surfaces {
if ls.wlSurface.ID() == e.Surface.ID() {
p.hideSurface(ls)
break
}
}
})

View File

@@ -274,6 +274,25 @@ func (s *SurfaceState) Redraw() *ShmBuffer {
return dst
}
// RedrawScreenOnly renders just the screenshot without any overlay (magnifier, preview).
// Used for when pointer leaves the surface.
func (s *SurfaceState) RedrawScreenOnly() *ShmBuffer {
s.mu.Lock()
defer s.mu.Unlock()
if !s.readyForDisplay || s.screenBuf == nil {
return nil
}
dst := s.renderBufs[s.front]
if dst == nil {
return nil
}
copy(dst.data, s.screenBuf.data)
return dst
}
func (s *SurfaceState) PickColor() (Color, bool) {
s.mu.Lock()
defer s.mu.Unlock()

View File

@@ -248,10 +248,12 @@ Singleton {
property int acLockTimeout: 0
property int acSuspendTimeout: 0
property int acSuspendBehavior: SettingsData.SuspendBehavior.Suspend
property string acProfileName: ""
property int batteryMonitorTimeout: 0
property int batteryLockTimeout: 0
property int batterySuspendTimeout: 0
property int batterySuspendBehavior: SettingsData.SuspendBehavior.Suspend
property string batteryProfileName: ""
property bool lockBeforeSuspend: false
property bool preventIdleForMedia: false
property bool loginctlLockIntegration: true
@@ -370,7 +372,8 @@ Singleton {
openOnOverview: false,
visible: true,
popupGapsAuto: true,
popupGapsManual: 4
popupGapsManual: 4,
maximizeDetection: true
}
]

View File

@@ -147,10 +147,12 @@ var SPEC = {
acLockTimeout: { def: 0 },
acSuspendTimeout: { def: 0 },
acSuspendBehavior: { def: 0 },
acProfileName: { def: "" },
batteryMonitorTimeout: { def: 0 },
batteryLockTimeout: { def: 0 },
batterySuspendTimeout: { def: 0 },
batterySuspendBehavior: { def: 0 },
batteryProfileName: { def: "" },
lockBeforeSuspend: { def: false },
preventIdleForMedia: { def: false },
loginctlLockIntegration: { def: true },
@@ -268,7 +270,8 @@ var SPEC = {
openOnOverview: false,
visible: true,
popupGapsAuto: true,
popupGapsManual: 4
popupGapsManual: 4,
maximizeDetection: true
}], onChange: "updateBarConfigs" }
};

View File

@@ -149,6 +149,8 @@ PanelWindow {
property string screenName: modelData.name
readonly property bool hasMaximizedToplevel: {
if (!(barConfig?.maximizeDetection ?? true))
return false;
if (!CompositorService.isHyprland && !CompositorService.isNiri)
return false;

View File

@@ -236,7 +236,8 @@ Item {
openOnOverview: defaultBar.openOnOverview ?? false,
visible: defaultBar.visible ?? true,
popupGapsAuto: defaultBar.popupGapsAuto ?? true,
popupGapsManual: defaultBar.popupGapsManual ?? 4
popupGapsManual: defaultBar.popupGapsManual ?? 4,
maximizeDetection: defaultBar.maximizeDetection ?? true
};
SettingsData.addBarConfig(newBar);
selectedBarId = newId;
@@ -739,6 +740,17 @@ Item {
}
}
SettingsToggleCard {
iconName: "fit_screen"
title: I18n.tr("Maximize Detection")
description: I18n.tr("Remove gaps and border when windows are maximized")
visible: selectedBarConfig?.enabled && (CompositorService.isNiri || CompositorService.isHyprland)
checked: selectedBarConfig?.maximizeDetection ?? true
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
maximizeDetection: checked
})
}
SettingsCard {
iconName: "space_bar"
title: I18n.tr("Spacing")
@@ -932,34 +944,16 @@ Item {
}
}
SettingsCard {
SettingsToggleCard {
iconName: "border_style"
title: I18n.tr("Border")
visible: selectedBarConfig?.enabled
SettingsToggleRow {
text: I18n.tr("Enable Border")
checked: selectedBarConfig?.borderEnabled ?? false
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
borderEnabled: checked
})
}
Column {
width: parent.width
leftPadding: Theme.spacingM
spacing: Theme.spacingM
visible: selectedBarConfig?.borderEnabled ?? false
Rectangle {
width: parent.width - parent.leftPadding
height: 1
color: Theme.outline
opacity: 0.15
}
SettingsButtonGroupRow {
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Color")
model: ["Surface", "Secondary", "Primary"]
currentIndex: {
@@ -997,8 +991,7 @@ Item {
SettingsSliderRow {
id: borderOpacitySlider
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Border Opacity")
text: I18n.tr("Opacity")
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
minimum: 0
maximum: 100
@@ -1019,8 +1012,7 @@ Item {
SettingsSliderRow {
id: borderThicknessSlider
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Border Thickness")
text: I18n.tr("Thickness")
value: selectedBarConfig?.borderThickness ?? 1
minimum: 1
maximum: 10
@@ -1039,36 +1031,17 @@ Item {
}
}
}
}
SettingsCard {
SettingsToggleCard {
iconName: "highlight"
title: I18n.tr("Widget Outline")
visible: selectedBarConfig?.enabled
SettingsToggleRow {
text: I18n.tr("Enable Widget Outline")
checked: selectedBarConfig?.widgetOutlineEnabled ?? false
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
widgetOutlineEnabled: checked
})
}
Column {
width: parent.width
leftPadding: Theme.spacingM
spacing: Theme.spacingM
visible: selectedBarConfig?.widgetOutlineEnabled ?? false
Rectangle {
width: parent.width - parent.leftPadding
height: 1
color: Theme.outline
opacity: 0.15
}
SettingsButtonGroupRow {
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Color")
model: ["Surface", "Secondary", "Primary"]
currentIndex: {
@@ -1106,8 +1079,7 @@ Item {
SettingsSliderRow {
id: widgetOutlineOpacitySlider
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Outline Opacity")
text: I18n.tr("Opacity")
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
minimum: 0
maximum: 100
@@ -1128,8 +1100,7 @@ Item {
SettingsSliderRow {
id: widgetOutlineThicknessSlider
width: parent.width - parent.parent.leftPadding
text: I18n.tr("Outline Thickness")
text: I18n.tr("Thickness")
value: selectedBarConfig?.widgetOutlineThickness ?? 1
minimum: 1
maximum: 10
@@ -1148,7 +1119,6 @@ Item {
}
}
}
}
SettingsCard {
iconName: "opacity"
@@ -1198,15 +1168,12 @@ Item {
}
}
SettingsCard {
SettingsSliderCard {
id: fontScaleSliderCard
iconName: "text_fields"
title: I18n.tr("Font Scale")
visible: selectedBarConfig?.enabled
SettingsSliderRow {
id: fontScaleSlider
text: I18n.tr("DankBar Font Scale")
description: I18n.tr("Scale DankBar font sizes independently")
visible: selectedBarConfig?.enabled
minimum: 50
maximum: 200
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
@@ -1218,7 +1185,7 @@ Item {
}
Binding {
target: fontScaleSlider
target: fontScaleSliderCard
property: "value"
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
restoreMode: Binding.RestoreBinding
@@ -1226,5 +1193,4 @@ Item {
}
}
}
}
}

View File

@@ -99,6 +99,43 @@ Item {
SettingsData.set("fadeToLockGracePeriod", periodValues[index]);
}
}
SettingsDropdownRow {
id: powerProfileDropdown
property var profileOptions: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
property var profileValues: ["", "0", "1", "2"]
width: parent.width
addHorizontalPadding: true
text: I18n.tr("Switch to power profile")
options: profileOptions
Connections {
target: powerCategory
function onCurrentIndexChanged() {
const currentProfile = powerCategory.currentIndex === 0 ? SettingsData.acProfileName : SettingsData.batteryProfileName;
const index = powerProfileDropdown.profileValues.indexOf(currentProfile);
powerProfileDropdown.currentValue = powerProfileDropdown.profileOptions[index]
}
}
Component.onCompleted: {
const currentProfile = powerCategory.currentIndex === 0 ? SettingsData.acProfileName : SettingsData.batteryProfileName;
const index = profileValues.indexOf(currentProfile);
currentValue = profileOptions[index]
}
onValueChanged: value => {
const index = profileOptions.indexOf(value);
if (index >= 0) {
const profileValue = profileValues[index];
if (powerCategory.currentIndex === 0) {
SettingsData.set("acProfileName", profileValue);
} else {
SettingsData.set("batteryProfileName", profileValue);
}
}
}
}
Rectangle {
width: parent.width

View File

@@ -0,0 +1,100 @@
pragma ComponentBehavior: Bound
import QtQuick
import qs.Common
import qs.Widgets
StyledRect {
id: root
property string tab: ""
property var tags: []
property string title: ""
property string description: ""
property string iconName: ""
property alias value: slider.value
property alias minimum: slider.minimum
property alias maximum: slider.maximum
property alias unit: slider.unit
property int defaultValue: -1
signal sliderValueChanged(int newValue)
width: parent?.width ?? 0
height: Theme.spacingL * 2 + contentColumn.height
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
Column {
id: contentColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Theme.spacingL
anchors.rightMargin: Theme.spacingL
spacing: Theme.spacingS
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
id: headerIcon
name: root.iconName
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
visible: root.iconName !== ""
}
Column {
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingXS
width: parent.width - headerIcon.width - (root.defaultValue >= 0 ? resetButton.width + Theme.spacingS : 0) - Theme.spacingM
StyledText {
text: root.title
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
visible: root.title !== ""
}
StyledText {
text: root.description
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
}
}
DankActionButton {
id: resetButton
anchors.verticalCenter: parent.verticalCenter
buttonSize: 36
iconName: "restart_alt"
iconSize: 20
visible: root.defaultValue >= 0 && slider.value !== root.defaultValue
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
iconColor: Theme.surfaceVariantText
onClicked: {
slider.value = root.defaultValue;
root.sliderValueChanged(root.defaultValue);
}
}
}
DankSlider {
id: slider
width: parent.width
height: 32
showValue: true
wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => root.sliderValueChanged(newValue)
}
}
}

View File

@@ -0,0 +1,113 @@
pragma ComponentBehavior: Bound
import QtQuick
import qs.Common
import qs.Widgets
StyledRect {
id: root
property string tab: ""
property var tags: []
property string title: ""
property string description: ""
property string iconName: ""
property bool checked: false
property bool enabled: true
default property alias content: expandedContent.children
readonly property bool hasContent: expandedContent.children.length > 0
signal toggled(bool checked)
width: parent?.width ?? 0
height: Theme.spacingL * 2 + mainColumn.height
radius: Theme.cornerRadius
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
Column {
id: mainColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Theme.spacingL
anchors.rightMargin: Theme.spacingL
spacing: Theme.spacingM
Item {
width: parent.width
height: headerColumn.height
Column {
id: headerColumn
anchors.left: parent.left
anchors.right: toggleSwitch.left
anchors.rightMargin: Theme.spacingM
spacing: Theme.spacingXS
Row {
spacing: Theme.spacingM
DankIcon {
id: headerIcon
name: root.iconName
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
visible: root.iconName !== ""
}
StyledText {
id: headerText
text: root.title
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
visible: root.title !== ""
}
}
StyledText {
id: descriptionText
text: root.description
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
visible: root.description !== ""
}
}
DankToggle {
id: toggleSwitch
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
hideText: true
checked: root.checked
enabled: root.enabled
onToggled: checked => root.toggled(checked)
}
StateLayer {
anchors.fill: parent
disabled: !root.enabled
stateColor: Theme.primary
cornerRadius: root.radius
onClicked: {
if (!root.enabled)
return;
root.toggled(!root.checked);
}
}
}
Column {
id: expandedContent
width: parent.width
spacing: Theme.spacingM
visible: root.checked && root.hasContent
}
}
}

View File

@@ -72,6 +72,17 @@ Singleton {
}
}
const profileValue = BatteryService.isPluggedIn
? SettingsData.acProfileName
: SettingsData.batteryProfileName;
if (profileValue !== "") {
const targetProfile = parseInt(profileValue);
if (!isNaN(targetProfile) && PowerProfiles.profile !== targetProfile) {
PowerProfiles.profile = targetProfile;
}
}
previousPluggedState = isPluggedIn;
}

View File

@@ -115,6 +115,7 @@ PanelWindow {
layer.enabled: Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
layer.smooth: false
layer.textureSize: Qt.size(width * root.dpr, height * root.dpr)
opacity: customTransparency >= 0 ? customTransparency : SettingsData.popupTransparency
anchors.top: parent.top
anchors.bottom: parent.bottom
@@ -123,8 +124,7 @@ PanelWindow {
DankRectangle {
anchors.fill: parent
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b,
customTransparency >= 0 ? customTransparency : SettingsData.popupTransparency)
color: Theme.surfaceContainer
}
Column {

View File

@@ -1,11 +0,0 @@
[templates.dmscodiumdefault]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-default.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-default.json'
[templates.dmscodiumdark]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-dark.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-dark.json'
[templates.dmscodiumlight]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-light.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-light.json'

View File

@@ -1,11 +0,0 @@
[templates.dmsvscodedefault]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-default.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-default.json'
[templates.dmsvscodedark]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-dark.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-dark.json'
[templates.dmsvscodelight]
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme-light.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-light.json'

Binary file not shown.

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="dynamic-base16-dankshell" Version="0.0.1" Publisher="local" />
<DisplayName>Dynamic Base16 DankShell</DisplayName>
<Description xml:space="preserve">Dynamic Material You theme with base16 terminal colors</Description>
<Categories>Themes</Categories>
<Properties>
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.70.0" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui,workspace" />
</Properties>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="package.json" Addressable="true" />
</Assets>
</PackageManifest>

View File

@@ -0,0 +1,5 @@
# Changelog
## 1.0.0
- Initial release

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 DankLinux
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,17 @@
# Dynamic Base16 DankShell Theme
A VSCode theme for [DankMaterialShell](https://github.com/EverydayCodeAlchemy/DankMaterialShellGit).
## How It Works
1. Install this extension
2. Select one of the "Dynamic Base16 DankShell" themes in VSCode
3. DankMaterialShell automatically updates the theme files when you change themes.
The theme files are located in your VSCode extensions directory and are updated by matugen when generating new colors.
## Themes
- **Dynamic Base16 DankShell** - Follows your current light/dark mode
- **Dynamic Base16 DankShell (Dark)** - Always dark variant
- **Dynamic Base16 DankShell (Light)** - Always light variant

View File

@@ -1,6 +1,7 @@
{
"name": "dynamic-base16-dankshell",
"displayName": "Dynamic Base16 DankShell",
"description": "Dynamic Material You theme with base16 terminal colors - auto-updated by DankMaterialShell",
"publisher": "local",
"version": "0.0.1",
"engines": {
@@ -9,6 +10,18 @@
"categories": [
"Themes"
],
"keywords": [
"theme",
"material",
"material you",
"base16",
"dynamic",
"dankshell"
],
"repository": {
"type": "git",
"url": "https://github.com/AvengeMedia/DankMaterialShellGit"
},
"contributes": {
"themes": [
{

View File

@@ -0,0 +1,36 @@
{
"$schema": "vscode://schemas/color-theme",
"name": "Dynamic Base16 DankShell",
"colors": {
"editor.background": "#1a1a2e",
"editor.foreground": "#e4e4e7",
"editorLineNumber.foreground": "#71717a",
"editorLineNumber.activeForeground": "#e4e4e7",
"editorCursor.foreground": "#a78bfa",
"editor.selectionBackground": "#4c1d95",
"activityBar.background": "#1a1a2e",
"activityBar.foreground": "#e4e4e7",
"activityBarBadge.background": "#a78bfa",
"activityBarBadge.foreground": "#1a1a2e",
"sideBar.background": "#1a1a2e",
"sideBar.foreground": "#e4e4e7",
"statusBar.background": "#1a1a2e",
"statusBar.foreground": "#e4e4e7",
"titleBar.activeBackground": "#1a1a2e",
"titleBar.activeForeground": "#e4e4e7"
},
"tokenColors": [
{
"scope": ["comment"],
"settings": { "foreground": "#71717a", "fontStyle": "italic" }
},
{
"scope": ["keyword"],
"settings": { "foreground": "#a78bfa" }
},
{
"scope": ["string"],
"settings": { "foreground": "#34d399" }
}
]
}

View File

@@ -0,0 +1,36 @@
{
"$schema": "vscode://schemas/color-theme",
"name": "Dynamic Base16 DankShell",
"colors": {
"editor.background": "#1a1a2e",
"editor.foreground": "#e4e4e7",
"editorLineNumber.foreground": "#71717a",
"editorLineNumber.activeForeground": "#e4e4e7",
"editorCursor.foreground": "#a78bfa",
"editor.selectionBackground": "#4c1d95",
"activityBar.background": "#1a1a2e",
"activityBar.foreground": "#e4e4e7",
"activityBarBadge.background": "#a78bfa",
"activityBarBadge.foreground": "#1a1a2e",
"sideBar.background": "#1a1a2e",
"sideBar.foreground": "#e4e4e7",
"statusBar.background": "#1a1a2e",
"statusBar.foreground": "#e4e4e7",
"titleBar.activeBackground": "#1a1a2e",
"titleBar.activeForeground": "#e4e4e7"
},
"tokenColors": [
{
"scope": ["comment"],
"settings": { "foreground": "#71717a", "fontStyle": "italic" }
},
{
"scope": ["keyword"],
"settings": { "foreground": "#a78bfa" }
},
{
"scope": ["string"],
"settings": { "foreground": "#34d399" }
}
]
}

View File

@@ -0,0 +1,36 @@
{
"$schema": "vscode://schemas/color-theme",
"name": "Dynamic Base16 DankShell",
"colors": {
"editor.background": "#1a1a2e",
"editor.foreground": "#e4e4e7",
"editorLineNumber.foreground": "#71717a",
"editorLineNumber.activeForeground": "#e4e4e7",
"editorCursor.foreground": "#a78bfa",
"editor.selectionBackground": "#4c1d95",
"activityBar.background": "#1a1a2e",
"activityBar.foreground": "#e4e4e7",
"activityBarBadge.background": "#a78bfa",
"activityBarBadge.foreground": "#1a1a2e",
"sideBar.background": "#1a1a2e",
"sideBar.foreground": "#e4e4e7",
"statusBar.background": "#1a1a2e",
"statusBar.foreground": "#e4e4e7",
"titleBar.activeBackground": "#1a1a2e",
"titleBar.activeForeground": "#e4e4e7"
},
"tokenColors": [
{
"scope": ["comment"],
"settings": { "foreground": "#71717a", "fontStyle": "italic" }
},
{
"scope": ["keyword"],
"settings": { "foreground": "#a78bfa" }
},
{
"scope": ["string"],
"settings": { "foreground": "#34d399" }
}
]
}

View File

@@ -22,6 +22,7 @@ LANGUAGES = {
"it": "it.json",
"pl": "pl.json",
"es": "es.json",
"he": "he.json",
}
def error(msg):

View File

@@ -73,6 +73,27 @@ append_config() {
echo "" >> "$cfg_file"
}
append_vscode_config() {
local name="$1" ext_dir="$2" cfg_file="$3"
[[ ! -d "$ext_dir" ]] && return
local template_dir="$SHELL_DIR/matugen/templates"
cat >> "$cfg_file" << EOF
[templates.dms${name}default]
input_path = '$template_dir/vscode-color-theme-default.json'
output_path = '$ext_dir/themes/dankshell-default.json'
[templates.dms${name}dark]
input_path = '$template_dir/vscode-color-theme-dark.json'
output_path = '$ext_dir/themes/dankshell-dark.json'
[templates.dms${name}light]
input_path = '$template_dir/vscode-color-theme-light.json'
output_path = '$ext_dir/themes/dankshell-light.json'
EOF
log "Added $name theme config (extension found at $ext_dir)"
}
build_merged_config() {
local mode="$1" run_user="$2" cfg_file="$3"
@@ -107,8 +128,12 @@ EOF
append_config "alacritty" "alacritty.toml" "$cfg_file"
append_config "wezterm" "wezterm.toml" "$cfg_file"
append_config "dgop" "dgop.toml" "$cfg_file"
append_config "code" "vscode.toml" "$cfg_file"
append_config "codium" "codium.toml" "$cfg_file"
append_vscode_config "vscode" "$HOME/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1" "$cfg_file"
append_vscode_config "codium" "$HOME/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1" "$cfg_file"
append_vscode_config "codeoss" "$HOME/.config/Code - OSS/extensions/local.dynamic-base16-dankshell-0.0.1" "$cfg_file"
append_vscode_config "cursor" "$HOME/.cursor/extensions/local.dynamic-base16-dankshell-0.0.1" "$cfg_file"
append_vscode_config "windsurf" "$HOME/.windsurf/extensions/local.dynamic-base16-dankshell-0.0.1" "$cfg_file"
if [[ "$run_user" == "true" && -f "$CONFIG_DIR/matugen/config.toml" ]]; then
awk '/^\[templates\]/{p=1} p' "$CONFIG_DIR/matugen/config.toml" >> "$cfg_file"
@@ -167,66 +192,6 @@ refresh_gtk() {
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-${mode}" 2>/dev/null || true
}
setup_vscode_extension() {
local cmd="$1" ext_dir="$2" config_dir="$3"
command -v "$cmd" >/dev/null 2>&1 || return
[[ ! -d "$config_dir" ]] && return
local theme_dir="$ext_dir/themes"
mkdir -p "$theme_dir"
cp "$SHELL_DIR/matugen/templates/vscode-package.json" "$ext_dir/package.json" 2>/dev/null || true
cp "$SHELL_DIR/matugen/templates/vscode-vsixmanifest.xml" "$ext_dir/.vsixmanifest" 2>/dev/null || true
update_vscode_extensions_json "$config_dir/extensions" "$ext_dir"
}
update_vscode_extensions_json() {
local ext_list_dir="$1" ext_dir="$2"
local ext_json="$ext_list_dir/extensions.json"
[[ ! -f "$ext_json" ]] && return
grep -q "dynamic-base16-dankshell" "$ext_json" && return
cp "$ext_json" "$ext_json.bak"
local entry
entry=$(cat <<EOF
{
"identifier": {
"id": "local.dynamic-base16-dankshell",
"uuid": "00000000-0000-0000-0000-000000000000"
},
"version": "0.0.1",
"location": {
"\$mid": 1,
"path": "$ext_dir",
"scheme": "file"
},
"relativeLocation": "local.dynamic-base16-dankshell-0.0.1",
"metadata": {
"isApplicationScoped": false,
"isMachineScoped": false,
"isBuiltin": false,
"installedTimestamp": $(date +%s)000,
"pinned": false,
"source": "local",
"id": "00000000-0000-0000-0000-000000000000",
"publisherId": "local",
"publisherDisplayName": "Dank Linux",
"targetPlatform": "undefined",
"updated": true,
"private": false,
"isPreReleaseVersion": false,
"hasPreReleaseVersion": false,
"preRelease": false
}
}
EOF
)
local content
content=$(cat "$ext_json")
if [[ "$content" == "[]" ]]; then
echo "[$entry]" > "$ext_json"
else
echo "${content%]}, $entry]" > "$ext_json"
fi
}
signal_terminals() {
pgrep -x kitty >/dev/null 2>&1 && pkill -USR1 kitty
pgrep -x ghostty >/dev/null 2>&1 && pkill -USR2 ghostty
@@ -308,8 +273,6 @@ build_once() {
fi
refresh_gtk "$mode"
setup_vscode_extension "code" "$HOME/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1" "$HOME/.vscode"
setup_vscode_extension "codium" "$HOME/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1" "$HOME/.vscode-oss"
signal_terminals
return 0

File diff suppressed because it is too large Load Diff