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
1
Merge Requests
1
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
ed93b23b
Commit
ed93b23b
authored
Jan 13, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hyprland: add --format flag to info/list commands
- Add --format flag to var list/info, module info, plugin list/info - Support JSON output for all info/list commands
parent
e38fe06d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
6 deletions
+55
-6
actions.go
hyprland/actions.go
+7
-0
commands.go
hyprland/commands.go
+17
-6
plugin-actions.go
hyprland/plugin-actions.go
+16
-0
var-actions.go
hyprland/var-actions.go
+15
-0
No files found.
hyprland/actions.go
View file @
ed93b23b
...
@@ -168,6 +168,9 @@ func HyprlandInfoModulesCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -168,6 +168,9 @@ func HyprlandInfoModulesCommand(ctx context.Context, cmd *cli.Command) error {
modules
:=
manager
.
GetModulesList
(
user
,
filter
)
modules
:=
manager
.
GetModulesList
(
user
,
filter
)
if
len
(
modules
)
==
0
{
if
len
(
modules
)
==
0
{
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
([]
ui
.
JSONItem
{})
}
return
fmt
.
Errorf
(
"нет доступных модулей"
)
return
fmt
.
Errorf
(
"нет доступных модулей"
)
}
}
...
@@ -191,6 +194,10 @@ func HyprlandInfoModulesCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -191,6 +194,10 @@ func HyprlandInfoModulesCommand(ctx context.Context, cmd *cli.Command) error {
})
})
}
}
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
(
ui
.
TreeItemsToJSON
(
items
))
}
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
Title
:
"Modules"
,
Title
:
"Modules"
,
Items
:
items
,
Items
:
items
,
...
...
hyprland/commands.go
View file @
ed93b23b
...
@@ -92,6 +92,7 @@ func CommandList() *cli.Command {
...
@@ -92,6 +92,7 @@ func CommandList() *cli.Command {
Aliases
:
[]
string
{
"f"
},
Aliases
:
[]
string
{
"f"
},
Value
:
"all"
,
Value
:
"all"
,
},
},
config
.
FormatFlag
,
},
},
Action
:
HyprlandInfoModulesCommand
,
Action
:
HyprlandInfoModulesCommand
,
},
},
...
@@ -131,13 +132,19 @@ func CommandList() *cli.Command {
...
@@ -131,13 +132,19 @@ func CommandList() *cli.Command {
Usage
:
"Hyprland vars"
,
Usage
:
"Hyprland vars"
,
Commands
:
[]
*
cli
.
Command
{
Commands
:
[]
*
cli
.
Command
{
{
{
Name
:
"list"
,
Name
:
"list"
,
Usage
:
"vars list"
,
Usage
:
"vars list"
,
Flags
:
[]
cli
.
Flag
{
config
.
FormatFlag
,
},
Action
:
HyprlandVarListCommand
,
Action
:
HyprlandVarListCommand
,
},
},
{
{
Name
:
"info"
,
Name
:
"info"
,
Usage
:
"vars info"
,
Usage
:
"vars info"
,
Flags
:
[]
cli
.
Flag
{
config
.
FormatFlag
,
},
Action
:
HyprlandVarInfoCommand
,
Action
:
HyprlandVarInfoCommand
,
},
},
{
{
...
@@ -164,8 +171,11 @@ func CommandList() *cli.Command {
...
@@ -164,8 +171,11 @@ func CommandList() *cli.Command {
Usage
:
"Hyprland plugins"
,
Usage
:
"Hyprland plugins"
,
Commands
:
[]
*
cli
.
Command
{
Commands
:
[]
*
cli
.
Command
{
{
{
Name
:
"list"
,
Name
:
"list"
,
Usage
:
"Hyprland plugins list"
,
Usage
:
"Hyprland plugins list"
,
Flags
:
[]
cli
.
Flag
{
config
.
FormatFlag
,
},
Action
:
HyprlandPluginListCommand
,
Action
:
HyprlandPluginListCommand
,
},
},
{
{
...
@@ -185,6 +195,7 @@ func CommandList() *cli.Command {
...
@@ -185,6 +195,7 @@ func CommandList() *cli.Command {
Aliases
:
[]
string
{
"f"
},
Aliases
:
[]
string
{
"f"
},
Value
:
"all"
,
Value
:
"all"
,
},
},
config
.
FormatFlag
,
},
},
Action
:
HyprlandPluginInfoCommand
,
Action
:
HyprlandPluginInfoCommand
,
},
},
...
...
hyprland/plugin-actions.go
View file @
ed93b23b
...
@@ -17,6 +17,15 @@ func HyprlandPluginListCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -17,6 +17,15 @@ func HyprlandPluginListCommand(ctx context.Context, cmd *cli.Command) error {
return
err
return
err
}
}
list
:=
manager
.
GetPluginsList
(
cmd
.
String
(
"filter"
))
list
:=
manager
.
GetPluginsList
(
cmd
.
String
(
"filter"
))
if
config
.
IsJSON
(
cmd
)
{
items
:=
make
([]
ui
.
JSONItem
,
len
(
list
))
for
i
,
name
:=
range
list
{
items
[
i
]
=
ui
.
JSONItem
{
Name
:
name
}
}
return
ui
.
PrintJSON
(
items
)
}
fmt
.
Println
(
strings
.
Join
(
list
,
"
\n
"
))
fmt
.
Println
(
strings
.
Join
(
list
,
"
\n
"
))
return
nil
return
nil
}
}
...
@@ -37,6 +46,9 @@ func HyprlandPluginInfoCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -37,6 +46,9 @@ func HyprlandPluginInfoCommand(ctx context.Context, cmd *cli.Command) error {
}
}
plugins
:=
manager
.
GetPluginsList
(
cmd
.
String
(
"filter"
))
plugins
:=
manager
.
GetPluginsList
(
cmd
.
String
(
"filter"
))
if
len
(
plugins
)
==
0
{
if
len
(
plugins
)
==
0
{
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
([]
ui
.
JSONItem
{})
}
return
fmt
.
Errorf
(
"нет доступных плагинов"
)
return
fmt
.
Errorf
(
"нет доступных плагинов"
)
}
}
...
@@ -59,6 +71,10 @@ func HyprlandPluginInfoCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -59,6 +71,10 @@ func HyprlandPluginInfoCommand(ctx context.Context, cmd *cli.Command) error {
})
})
}
}
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
(
ui
.
TreeItemsToJSON
(
items
))
}
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
Title
:
"Plugins"
,
Title
:
"Plugins"
,
Items
:
items
,
Items
:
items
,
...
...
hyprland/var-actions.go
View file @
ed93b23b
...
@@ -21,6 +21,14 @@ func HyprlandVarListCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -21,6 +21,14 @@ func HyprlandVarListCommand(ctx context.Context, cmd *cli.Command) error {
return
err
return
err
}
}
if
config
.
IsJSON
(
cmd
)
{
items
:=
make
([]
ui
.
JSONItem
,
len
(
manager
.
Vars
))
for
i
,
v
:=
range
manager
.
Vars
{
items
[
i
]
=
ui
.
JSONItem
{
Name
:
v
.
Name
,
Value
:
v
.
Value
}
}
return
ui
.
PrintJSON
(
items
)
}
for
_
,
v
:=
range
manager
.
Vars
{
for
_
,
v
:=
range
manager
.
Vars
{
fmt
.
Println
(
v
.
Name
)
fmt
.
Println
(
v
.
Name
)
}
}
...
@@ -37,6 +45,9 @@ func HyprlandVarInfoCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -37,6 +45,9 @@ func HyprlandVarInfoCommand(ctx context.Context, cmd *cli.Command) error {
info
:=
manager
.
GetVarList
()
info
:=
manager
.
GetVarList
()
if
len
(
info
)
==
0
{
if
len
(
info
)
==
0
{
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
([]
ui
.
JSONItem
{})
}
color
.
Yellow
(
"Нет переменных в конфигурации"
)
color
.
Yellow
(
"Нет переменных в конфигурации"
)
return
nil
return
nil
}
}
...
@@ -53,6 +64,10 @@ func HyprlandVarInfoCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -53,6 +64,10 @@ func HyprlandVarInfoCommand(ctx context.Context, cmd *cli.Command) error {
})
})
}
}
if
config
.
IsJSON
(
cmd
)
{
return
ui
.
PrintJSON
(
ui
.
TreeItemsToJSON
(
items
))
}
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
ui
.
RenderTree
(
ui
.
RenderTreeOptions
{
Title
:
"Vars"
,
Title
:
"Vars"
,
Items
:
items
,
Items
:
items
,
...
...
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