Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximperconf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximperconf
Commits
dafc0694
Verified
Commit
dafc0694
authored
Mar 03, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preset: auto-remove missing and deps-broken modules
parent
e876aae1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
actions.go
hyprland/actions.go
+1
-1
manager.go
hyprland/manager.go
+2
-2
actions.go
preset/actions.go
+37
-0
No files found.
hyprland/actions.go
View file @
dafc0694
...
...
@@ -258,7 +258,7 @@ func HyprlandInfoModulesCommand(ctx context.Context, cmd *cli.Command) error {
name
=
d
.
info
.
Meta
.
Group
+
"/"
+
name
}
if
!
d
.
info
.
DepsInstalled
{
missing
:=
m
issingDeps
(
d
.
info
.
Meta
)
missing
:=
M
issingDeps
(
d
.
info
.
Meta
)
if
len
(
missing
)
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"(requires: %s)"
,
strings
.
Join
(
missing
,
", "
)))
}
...
...
hyprland/manager.go
View file @
dafc0694
...
...
@@ -235,7 +235,7 @@ func checkDeps(meta *ModuleMeta) bool {
return
true
}
func
m
issingDeps
(
meta
*
ModuleMeta
)
[]
string
{
func
M
issingDeps
(
meta
*
ModuleMeta
)
[]
string
{
if
meta
==
nil
{
return
nil
}
...
...
@@ -528,7 +528,7 @@ func (m *HyprlandManager) SetModule(action, module string, onlyNew bool) (string
// зависимости не установлены
if
!
info
.
DepsInstalled
{
return
""
,
fmt
.
Errorf
(
locale
.
T
(
"missing module dependencies: %s"
),
strings
.
Join
(
m
issingDeps
(
info
.
Meta
),
", "
))
strings
.
Join
(
M
issingDeps
(
info
.
Meta
),
", "
))
}
// нет файла
...
...
preset/actions.go
View file @
dafc0694
...
...
@@ -207,6 +207,42 @@ func processHyprModules(manager *hyprland.HyprlandManager, prof config.PresetPro
}
}
func
processCleanupModules
(
manager
*
hyprland
.
HyprlandManager
,
opts
opOptions
,
res
*
Result
)
{
cat
:=
"hypr/"
+
locale
.
T
(
"cleanup"
)
for
_
,
info
:=
range
manager
.
GetModulesList
(
"all"
)
{
needRemove
:=
false
var
reason
string
switch
{
case
info
.
Status
.
IsEqual
(
config
.
ModuleStatus
.
Missing
)
:
needRemove
=
true
reason
=
locale
.
T
(
"file not found"
)
case
!
info
.
DepsInstalled
&&
info
.
LineNumber
>
0
:
needRemove
=
true
reason
=
fmt
.
Sprintf
(
locale
.
T
(
"missing dependencies: %s"
),
strings
.
Join
(
hyprland
.
MissingDeps
(
info
.
Meta
),
", "
))
}
if
!
needRemove
{
continue
}
msg
:=
fmt
.
Sprintf
(
locale
.
T
(
"Module '%s' removed (%s)"
),
info
.
Name
,
reason
)
if
opts
.
DryRun
{
res
.
Add
(
cat
,
msg
,
config
.
OpStatus
.
DryRun
)
continue
}
if
_
,
err
:=
manager
.
SetModule
(
"remove"
,
info
.
Name
,
false
);
err
!=
nil
{
res
.
Add
(
cat
,
fmt
.
Sprintf
(
locale
.
T
(
"Failed to remove '%s': %v"
),
info
.
Name
,
err
),
config
.
OpStatus
.
Error
)
continue
}
res
.
Add
(
cat
,
msg
,
config
.
OpStatus
.
Done
)
}
}
func
processVerifyModules
(
manager
*
hyprland
.
HyprlandManager
,
prof
config
.
PresetProfile
,
opts
opOptions
,
res
*
Result
)
{
if
!
prof
.
Hyprland
.
Check
||
opts
.
DryRun
{
return
...
...
@@ -324,6 +360,7 @@ func processProfile(prof config.PresetProfile, opts opOptions, res *Result, mana
if
manager
!=
nil
{
processHyprVars
(
manager
,
prof
,
opts
,
res
)
processHyprModules
(
manager
,
prof
,
opts
,
res
)
processCleanupModules
(
manager
,
opts
,
res
)
processHyprLayoutSync
(
manager
,
prof
,
opts
,
res
)
processVerifyModules
(
manager
,
prof
,
opts
,
res
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment