mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
feat(mango): first-class MangoWM support across DMS, dankinstaller & UI tools
- Bring up Mango to parity with niri/hyprland via a native JSON-IPC w/Native MangoServic., replaces the legacy dwl/`mmsg` path and recent breaking changes - Dankinstall: mango supported installer, config/binds templates, and packaging (Arch AUR, Fedora Terra auto-enable, Gentoo GURU) - Window rules: Go provider + CLI + Settings GUI editor - Keybinds + config reload on edit (mmsg dispatch reload_config) - Misc new supported options in DMS settings
This commit is contained in:
@@ -73,6 +73,10 @@ func (cd *ConfigDeployer) deployConfigurationsInternal(ctx context.Context, wm d
|
||||
filepath.Join(os.Getenv("HOME"), ".config", "hypr", "hyprland.lua"),
|
||||
filepath.Join(os.Getenv("HOME"), ".config", "hypr", "hyprland.conf"),
|
||||
},
|
||||
"Mango": {
|
||||
filepath.Join(os.Getenv("HOME"), ".config", "mango", "config.conf"),
|
||||
filepath.Join(os.Getenv("HOME"), ".config", "mango", "mango.conf"),
|
||||
},
|
||||
"Ghostty": {
|
||||
filepath.Join(os.Getenv("HOME"), ".config", "ghostty", "config"),
|
||||
},
|
||||
@@ -126,6 +130,14 @@ func (cd *ConfigDeployer) deployConfigurationsInternal(ctx context.Context, wm d
|
||||
return results, fmt.Errorf("failed to deploy Hyprland config: %w", err)
|
||||
}
|
||||
}
|
||||
case deps.WindowManagerMango:
|
||||
if shouldReplaceConfig("Mango") {
|
||||
result, err := cd.deployMangoConfig(terminal, useSystemd)
|
||||
results = append(results, result)
|
||||
if err != nil {
|
||||
return results, fmt.Errorf("failed to deploy Mango config: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch terminal {
|
||||
@@ -269,6 +281,96 @@ func (cd *ConfigDeployer) deployNiriDmsConfigs(dmsDir, terminalCommand string) e
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cd *ConfigDeployer) deployMangoConfig(terminal deps.Terminal, useSystemd bool) (DeploymentResult, error) {
|
||||
result := DeploymentResult{
|
||||
ConfigType: "Mango",
|
||||
Path: filepath.Join(os.Getenv("HOME"), ".config", "mango", "config.conf"),
|
||||
}
|
||||
|
||||
configDir := filepath.Dir(result.Path)
|
||||
if err := os.MkdirAll(configDir, 0o755); err != nil {
|
||||
result.Error = fmt.Errorf("failed to create config directory: %w", err)
|
||||
return result, result.Error
|
||||
}
|
||||
|
||||
dmsDir := filepath.Join(configDir, "dms")
|
||||
if err := os.MkdirAll(dmsDir, 0o755); err != nil {
|
||||
result.Error = fmt.Errorf("failed to create dms directory: %w", err)
|
||||
return result, result.Error
|
||||
}
|
||||
|
||||
var terminalCommand string
|
||||
switch terminal {
|
||||
case deps.TerminalGhostty:
|
||||
terminalCommand = "ghostty"
|
||||
case deps.TerminalKitty:
|
||||
terminalCommand = "kitty"
|
||||
case deps.TerminalAlacritty:
|
||||
terminalCommand = "alacritty"
|
||||
default:
|
||||
terminalCommand = "ghostty"
|
||||
}
|
||||
|
||||
// DMS owns config.conf for mango (like niri/hyprland): back up and replace.
|
||||
if existingData, err := os.ReadFile(result.Path); err == nil {
|
||||
cd.log("Found existing Mango configuration")
|
||||
timestamp := time.Now().Format("2006-01-02_15-04-05")
|
||||
result.BackupPath = result.Path + ".backup." + timestamp
|
||||
if err := os.WriteFile(result.BackupPath, existingData, 0o644); err != nil {
|
||||
result.Error = fmt.Errorf("failed to create backup: %w", err)
|
||||
return result, result.Error
|
||||
}
|
||||
cd.log(fmt.Sprintf("Backed up existing config to %s", result.BackupPath))
|
||||
}
|
||||
|
||||
newConfig := strings.ReplaceAll(MangoConfig, "{{TERMINAL_COMMAND}}", terminalCommand)
|
||||
if err := os.WriteFile(result.Path, []byte(newConfig), 0o644); err != nil {
|
||||
result.Error = fmt.Errorf("failed to write config: %w", err)
|
||||
return result, result.Error
|
||||
}
|
||||
|
||||
if err := cd.deployMangoDmsConfigs(dmsDir, terminalCommand); err != nil {
|
||||
result.Error = fmt.Errorf("failed to deploy dms configs: %w", err)
|
||||
return result, result.Error
|
||||
}
|
||||
|
||||
result.Deployed = true
|
||||
cd.log("Successfully deployed Mango configuration")
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (cd *ConfigDeployer) deployMangoDmsConfigs(dmsDir, terminalCommand string) error {
|
||||
configs := []struct {
|
||||
name string
|
||||
content string
|
||||
overwrite bool
|
||||
}{
|
||||
// binds.conf is DMS-owned (overwrite); the rest are runtime/user-managed.
|
||||
{"binds.conf", strings.ReplaceAll(MangoBindsConfig, "{{TERMINAL_COMMAND}}", terminalCommand), true},
|
||||
{"colors.conf", MangoColorsConfig, false},
|
||||
{"layout.conf", MangoLayoutConfig, false},
|
||||
{"outputs.conf", "", false},
|
||||
{"cursor.conf", "", false},
|
||||
{"windowrules.conf", "", false},
|
||||
}
|
||||
|
||||
for _, cfg := range configs {
|
||||
path := filepath.Join(dmsDir, cfg.name)
|
||||
if !cfg.overwrite {
|
||||
if info, err := os.Stat(path); err == nil && info.Size() > 0 {
|
||||
cd.log(fmt.Sprintf("Skipping %s (already exists)", cfg.name))
|
||||
continue
|
||||
}
|
||||
}
|
||||
if err := os.WriteFile(path, []byte(cfg.content), 0o644); err != nil {
|
||||
return fmt.Errorf("failed to write %s: %w", cfg.name, err)
|
||||
}
|
||||
cd.log(fmt.Sprintf("Deployed %s", cfg.name))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cd *ConfigDeployer) deployGhosttyConfig() ([]DeploymentResult, error) {
|
||||
var results []DeploymentResult
|
||||
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
# DMS default keybinds (MangoWM) — managed by DMS, regenerated by `dms setup`.
|
||||
# Format: bind=MODS,key,action[,args]
|
||||
# Descriptions go on the line ABOVE each bind (mango does not strip inline
|
||||
# comments — a trailing `# ...` would be passed to spawn as extra arguments).
|
||||
|
||||
# === Application Launchers ===
|
||||
# Open Terminal
|
||||
bind=SUPER,t,spawn,{{TERMINAL_COMMAND}}
|
||||
# Open Terminal
|
||||
bind=SUPER,Return,spawn,{{TERMINAL_COMMAND}}
|
||||
# Application Launcher
|
||||
bind=SUPER,space,spawn,dms ipc call spotlight toggle
|
||||
# Spotlight Bar
|
||||
bind=ALT,space,spawn,dms ipc call spotlight-bar toggle
|
||||
# Clipboard Manager
|
||||
bind=SUPER,v,spawn,dms ipc call clipboard toggle
|
||||
# Task Manager
|
||||
bind=SUPER,m,spawn,dms ipc call processlist focusOrToggle
|
||||
# Settings
|
||||
bind=SUPER,comma,spawn,dms ipc call settings focusOrToggle
|
||||
# Notification Center
|
||||
bind=SUPER,n,spawn,dms ipc call notifications toggle
|
||||
# Notepad
|
||||
bind=SUPER+SHIFT,n,spawn,dms ipc call notepad toggle
|
||||
# Browse Wallpapers
|
||||
bind=SUPER,y,spawn,dms ipc call dankdash wallpaper
|
||||
# Power Menu
|
||||
bind=SUPER,x,spawn,dms ipc call powermenu toggle
|
||||
# Cycle Display Profile
|
||||
bind=SUPER,p,spawn,dms ipc outputs cycleProfile
|
||||
|
||||
# === Cheat sheet ===
|
||||
# Keyboard Shortcuts
|
||||
bind=SUPER+SHIFT,slash,spawn,dms ipc call keybinds toggle mangowc
|
||||
|
||||
# === Security ===
|
||||
# Lock Screen
|
||||
bind=SUPER+ALT,l,spawn,dms ipc call lock lock
|
||||
# Task Manager
|
||||
bind=CTRL+ALT,Delete,spawn,dms ipc call processlist focusOrToggle
|
||||
|
||||
# === Window Rules ===
|
||||
# Create Window Rule
|
||||
bind=SUPER+SHIFT,w,spawn,dms ipc call window-rules toggle
|
||||
|
||||
# === Screenshots ===
|
||||
# Screenshot: Interactive
|
||||
bind=none,Print,spawn,dms screenshot
|
||||
# Screenshot: Full Screen
|
||||
bind=CTRL,Print,spawn,dms screenshot full
|
||||
# Screenshot: Window
|
||||
bind=ALT,Print,spawn,dms screenshot window
|
||||
|
||||
# === Audio Controls ===
|
||||
# Volume Up
|
||||
bind=none,XF86AudioRaiseVolume,spawn,dms ipc call audio increment 3
|
||||
# Volume Down
|
||||
bind=none,XF86AudioLowerVolume,spawn,dms ipc call audio decrement 3
|
||||
# Mute Output
|
||||
bind=none,XF86AudioMute,spawn,dms ipc call audio mute
|
||||
# Mute Microphone
|
||||
bind=none,XF86AudioMicMute,spawn,dms ipc call audio micmute
|
||||
# Play/Pause
|
||||
bind=none,XF86AudioPlay,spawn,dms ipc call mpris playPause
|
||||
# Play/Pause
|
||||
bind=none,XF86AudioPause,spawn,dms ipc call mpris playPause
|
||||
# Previous Track
|
||||
bind=none,XF86AudioPrev,spawn,dms ipc call mpris previous
|
||||
# Next Track
|
||||
bind=none,XF86AudioNext,spawn,dms ipc call mpris next
|
||||
|
||||
# === Brightness Controls ===
|
||||
# Brightness Up
|
||||
bind=none,XF86MonBrightnessUp,spawn,dms ipc call brightness increment 5
|
||||
# Brightness Down
|
||||
bind=none,XF86MonBrightnessDown,spawn,dms ipc call brightness decrement 5
|
||||
|
||||
# === Window Management ===
|
||||
# Close Window
|
||||
bind=SUPER,q,killclient,
|
||||
# Toggle Fullscreen
|
||||
bind=SUPER,f,togglefullscreen,
|
||||
# Toggle Maximize
|
||||
bind=SUPER,a,togglemaximizescreen,
|
||||
# Toggle Floating
|
||||
bind=SUPER+SHIFT,space,togglefloating,
|
||||
# Exit Compositor
|
||||
bind=SUPER+SHIFT,e,quit,
|
||||
|
||||
# === Focus Navigation ===
|
||||
# Focus Next Window
|
||||
bind=SUPER,Tab,focusstack,next
|
||||
# Focus Previous Window
|
||||
bind=SUPER+SHIFT,Tab,focusstack,prev
|
||||
# Focus Left
|
||||
bind=SUPER,Left,focusdir,left
|
||||
# Focus Right
|
||||
bind=SUPER,Right,focusdir,right
|
||||
# Focus Up
|
||||
bind=SUPER,Up,focusdir,up
|
||||
# Focus Down
|
||||
bind=SUPER,Down,focusdir,down
|
||||
|
||||
# === Window Movement ===
|
||||
# Move Window Left
|
||||
bind=SUPER+SHIFT,Left,exchange_client,left
|
||||
# Move Window Right
|
||||
bind=SUPER+SHIFT,Right,exchange_client,right
|
||||
# Move Window Up
|
||||
bind=SUPER+SHIFT,Up,exchange_client,up
|
||||
# Move Window Down
|
||||
bind=SUPER+SHIFT,Down,exchange_client,down
|
||||
|
||||
# === Monitor Navigation ===
|
||||
# Focus Monitor Left
|
||||
bind=SUPER+ALT,Left,focusmon,left
|
||||
# Focus Monitor Right
|
||||
bind=SUPER+ALT,Right,focusmon,right
|
||||
# Move to Monitor Left
|
||||
bind=SUPER+ALT+SHIFT,Left,tagmon,left
|
||||
# Move to Monitor Right
|
||||
bind=SUPER+ALT+SHIFT,Right,tagmon,right
|
||||
|
||||
# === Layout ===
|
||||
# Cycle Layout
|
||||
bind=SUPER,j,switch_layout
|
||||
# Increase Gaps
|
||||
bind=SUPER+SHIFT,equal,incgaps,1
|
||||
# Decrease Gaps
|
||||
bind=SUPER+SHIFT,minus,incgaps,-1
|
||||
|
||||
# === Tags (1-9): view tag ===
|
||||
# View Tag 1
|
||||
bind=SUPER,1,view,1
|
||||
# View Tag 2
|
||||
bind=SUPER,2,view,2
|
||||
# View Tag 3
|
||||
bind=SUPER,3,view,3
|
||||
# View Tag 4
|
||||
bind=SUPER,4,view,4
|
||||
# View Tag 5
|
||||
bind=SUPER,5,view,5
|
||||
# View Tag 6
|
||||
bind=SUPER,6,view,6
|
||||
# View Tag 7
|
||||
bind=SUPER,7,view,7
|
||||
# View Tag 8
|
||||
bind=SUPER,8,view,8
|
||||
# View Tag 9
|
||||
bind=SUPER,9,view,9
|
||||
|
||||
# === Tags (1-9): move focused window to tag ===
|
||||
# Move to Tag 1
|
||||
bind=SUPER+SHIFT,1,tag,1
|
||||
# Move to Tag 2
|
||||
bind=SUPER+SHIFT,2,tag,2
|
||||
# Move to Tag 3
|
||||
bind=SUPER+SHIFT,3,tag,3
|
||||
# Move to Tag 4
|
||||
bind=SUPER+SHIFT,4,tag,4
|
||||
# Move to Tag 5
|
||||
bind=SUPER+SHIFT,5,tag,5
|
||||
# Move to Tag 6
|
||||
bind=SUPER+SHIFT,6,tag,6
|
||||
# Move to Tag 7
|
||||
bind=SUPER+SHIFT,7,tag,7
|
||||
# Move to Tag 8
|
||||
bind=SUPER+SHIFT,8,tag,8
|
||||
# Move to Tag 9
|
||||
bind=SUPER+SHIFT,9,tag,9
|
||||
|
||||
# === Touchpad Gestures ===
|
||||
# Syntax: gesturebind=MODIFIERS,DIRECTION,FINGERS,COMMAND,PARAMETERS
|
||||
# 3-finger horizontal swipe: switch between occupied workspaces
|
||||
gesturebind=none,left,3,viewtoleft_have_client
|
||||
gesturebind=none,right,3,viewtoright_have_client
|
||||
@@ -0,0 +1,6 @@
|
||||
# Auto-generated by DMS. Overwritten by matugen (dms/colors.conf).
|
||||
# Remove `source=./dms/colors.conf` from config.conf to override manually.
|
||||
|
||||
bordercolor = 0x595959ff
|
||||
focuscolor = 0x8ab4f8ff
|
||||
urgentcolor = 0xff5555ff
|
||||
@@ -0,0 +1,8 @@
|
||||
# Auto-generated by DMS. Regenerated from DMS settings (dms/layout.conf).
|
||||
|
||||
border_radius=12
|
||||
gappih=5
|
||||
gappiv=5
|
||||
gappoh=5
|
||||
gappov=5
|
||||
borderpx=2
|
||||
@@ -0,0 +1,18 @@
|
||||
# DankMaterialShell — MangoWM configuration (managed by `dms setup`)
|
||||
# Keybinds, colors, layout, outputs, cursor and window rules are pulled from the
|
||||
# ./dms fragments below. Add your own binds/rules here; they sit alongside DMS's.
|
||||
|
||||
env=XDG_CURRENT_DESKTOP,mango
|
||||
env=XDG_SESSION_TYPE,wayland
|
||||
|
||||
# exec_once runs only at startup. Do NOT use exec= for the shell: mango re-runs
|
||||
# every exec= on each config reload, and DMS reloads the config, which would
|
||||
# spawn a new shell on every reload.
|
||||
exec_once=dms run
|
||||
|
||||
source=./dms/colors.conf
|
||||
source=./dms/layout.conf
|
||||
source=./dms/cursor.conf
|
||||
source=./dms/outputs.conf
|
||||
source=./dms/windowrules.conf
|
||||
source=./dms/binds.conf
|
||||
@@ -0,0 +1,15 @@
|
||||
package config
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed embedded/mango.conf
|
||||
var MangoConfig string
|
||||
|
||||
//go:embed embedded/mango-colors.conf
|
||||
var MangoColorsConfig string
|
||||
|
||||
//go:embed embedded/mango-layout.conf
|
||||
var MangoLayoutConfig string
|
||||
|
||||
//go:embed embedded/mango-binds.conf
|
||||
var MangoBindsConfig string
|
||||
Reference in New Issue
Block a user