mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
dankinstall: replace grim+slurp+grimblast with dms
This commit is contained in:
@@ -281,12 +281,9 @@ binde = $mod SHIFT, minus, resizeactive, 0 -10%
|
|||||||
binde = $mod SHIFT, equal, resizeactive, 0 10%
|
binde = $mod SHIFT, equal, resizeactive, 0 10%
|
||||||
|
|
||||||
# === Screenshots ===
|
# === Screenshots ===
|
||||||
bind = , XF86Launch1, exec, grimblast copy area
|
bind = , Print, exec, dms screenshot
|
||||||
bind = CTRL, XF86Launch1, exec, grimblast copy screen
|
bind = CTRL, Print, exec, dms screenshot full
|
||||||
bind = ALT, XF86Launch1, exec, grimblast copy active
|
bind = ALT, Print, exec, dms screenshot window
|
||||||
bind = , Print, exec, grimblast copy area
|
|
||||||
bind = CTRL, Print, exec, grimblast copy screen
|
|
||||||
bind = ALT, Print, exec, grimblast copy active
|
|
||||||
|
|
||||||
# === System Controls ===
|
# === System Controls ===
|
||||||
bind = $mod SHIFT, P, dpms, off
|
bind = $mod SHIFT, P, dpms, off
|
||||||
|
|||||||
@@ -228,10 +228,7 @@ func (b *BaseDistribution) detectHyprlandTools() []deps.Dependency {
|
|||||||
name string
|
name string
|
||||||
description string
|
description string
|
||||||
}{
|
}{
|
||||||
{"grim", "Screenshot utility for Wayland"},
|
|
||||||
{"slurp", "Region selection utility for Wayland"},
|
|
||||||
{"hyprctl", "Hyprland control utility"},
|
{"hyprctl", "Hyprland control utility"},
|
||||||
{"grimblast", "Screenshot script for Hyprland"},
|
|
||||||
{"jq", "JSON processor"},
|
{"jq", "JSON processor"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,6 @@ func (m *ManualPackageInstaller) InstallManualPackages(ctx context.Context, pack
|
|||||||
if err := m.installDgop(ctx, sudoPassword, progressChan); err != nil {
|
if err := m.installDgop(ctx, sudoPassword, progressChan); err != nil {
|
||||||
return fmt.Errorf("failed to install dgop: %w", err)
|
return fmt.Errorf("failed to install dgop: %w", err)
|
||||||
}
|
}
|
||||||
case "grimblast":
|
|
||||||
if err := m.installGrimblast(ctx, sudoPassword, progressChan); err != nil {
|
|
||||||
return fmt.Errorf("failed to install grimblast: %w", err)
|
|
||||||
}
|
|
||||||
case "niri":
|
case "niri":
|
||||||
if err := m.installNiri(ctx, sudoPassword, progressChan); err != nil {
|
if err := m.installNiri(ctx, sudoPassword, progressChan); err != nil {
|
||||||
return fmt.Errorf("failed to install niri: %w", err)
|
return fmt.Errorf("failed to install niri: %w", err)
|
||||||
@@ -166,62 +162,6 @@ func (m *ManualPackageInstaller) installDgop(ctx context.Context, sudoPassword s
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ManualPackageInstaller) installGrimblast(ctx context.Context, sudoPassword string, progressChan chan<- InstallProgressMsg) error {
|
|
||||||
m.log("Installing grimblast script for Hyprland...")
|
|
||||||
|
|
||||||
progressChan <- InstallProgressMsg{
|
|
||||||
Phase: PhaseSystemPackages,
|
|
||||||
Progress: 0.1,
|
|
||||||
Step: "Downloading grimblast script...",
|
|
||||||
IsComplete: false,
|
|
||||||
CommandInfo: "curl grimblast script",
|
|
||||||
}
|
|
||||||
|
|
||||||
grimblastURL := "https://raw.githubusercontent.com/hyprwm/contrib/refs/heads/main/grimblast/grimblast"
|
|
||||||
tmpPath := filepath.Join(os.TempDir(), "grimblast")
|
|
||||||
|
|
||||||
downloadCmd := exec.CommandContext(ctx, "curl", "-L", "-o", tmpPath, grimblastURL)
|
|
||||||
if err := downloadCmd.Run(); err != nil {
|
|
||||||
m.logError("failed to download grimblast", err)
|
|
||||||
return fmt.Errorf("failed to download grimblast: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
progressChan <- InstallProgressMsg{
|
|
||||||
Phase: PhaseSystemPackages,
|
|
||||||
Progress: 0.5,
|
|
||||||
Step: "Making grimblast executable...",
|
|
||||||
IsComplete: false,
|
|
||||||
CommandInfo: "chmod +x grimblast",
|
|
||||||
}
|
|
||||||
|
|
||||||
chmodCmd := exec.CommandContext(ctx, "chmod", "+x", tmpPath)
|
|
||||||
if err := chmodCmd.Run(); err != nil {
|
|
||||||
m.logError("failed to make grimblast executable", err)
|
|
||||||
return fmt.Errorf("failed to make grimblast executable: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
progressChan <- InstallProgressMsg{
|
|
||||||
Phase: PhaseSystemPackages,
|
|
||||||
Progress: 0.8,
|
|
||||||
Step: "Installing grimblast to /usr/local/bin...",
|
|
||||||
IsComplete: false,
|
|
||||||
NeedsSudo: true,
|
|
||||||
CommandInfo: "sudo cp grimblast /usr/local/bin/",
|
|
||||||
}
|
|
||||||
|
|
||||||
installCmd := ExecSudoCommand(ctx, sudoPassword,
|
|
||||||
fmt.Sprintf("cp %s /usr/local/bin/grimblast", tmpPath))
|
|
||||||
if err := installCmd.Run(); err != nil {
|
|
||||||
m.logError("failed to install grimblast", err)
|
|
||||||
return fmt.Errorf("failed to install grimblast: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Remove(tmpPath)
|
|
||||||
|
|
||||||
m.log("grimblast installed successfully to /usr/local/bin")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ManualPackageInstaller) installNiri(ctx context.Context, sudoPassword string, progressChan chan<- InstallProgressMsg) error {
|
func (m *ManualPackageInstaller) installNiri(ctx context.Context, sudoPassword string, progressChan chan<- InstallProgressMsg) error {
|
||||||
m.log("Installing niri from source...")
|
m.log("Installing niri from source...")
|
||||||
|
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ func (m Model) categorizeDependencies() map[string][]DependencyInfo {
|
|||||||
switch dep.Name {
|
switch dep.Name {
|
||||||
case "dms (DankMaterialShell)", "quickshell":
|
case "dms (DankMaterialShell)", "quickshell":
|
||||||
categories["Shell"] = append(categories["Shell"], dep)
|
categories["Shell"] = append(categories["Shell"], dep)
|
||||||
case "hyprland", "grim", "slurp", "hyprctl", "grimblast":
|
case "hyprland", "hyprctl":
|
||||||
categories["Hyprland Components"] = append(categories["Hyprland Components"], dep)
|
categories["Hyprland Components"] = append(categories["Hyprland Components"], dep)
|
||||||
case "niri":
|
case "niri":
|
||||||
categories["Niri Components"] = append(categories["Niri Components"], dep)
|
categories["Niri Components"] = append(categories["Niri Components"], dep)
|
||||||
|
|||||||
Reference in New Issue
Block a user