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
631f8e23
Verified
Commit
631f8e23
authored
Oct 18, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: json -> yaml
parent
41a62e06
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
25 deletions
+32
-25
actions.go
create/actions.go
+7
-3
struct.go
create/struct.go
+22
-22
go.mod
go.mod
+1
-0
go.sum
go.sum
+2
-0
No files found.
create/actions.go
View file @
631f8e23
...
...
@@ -6,7 +6,6 @@ import (
"ximperconf/hyprland"
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
...
...
@@ -15,6 +14,7 @@ import (
"github.com/fatih/color"
"github.com/urfave/cli/v3"
"gopkg.in/yaml.v3"
)
func
processProfile
(
prof
Profile
,
dryRun
bool
,
res
*
Result
)
{
...
...
@@ -215,9 +215,13 @@ func loadConfig(path string) (*Config, error) {
if
err
!=
nil
{
return
nil
,
err
}
var
cfg
Config
err
=
json
.
Unmarshal
(
data
,
&
cfg
)
return
&
cfg
,
err
if
err
:=
yaml
.
Unmarshal
(
data
,
&
cfg
);
err
!=
nil
{
return
nil
,
err
}
return
&
cfg
,
nil
}
func
expandPath
(
path
,
name
string
)
string
{
...
...
create/struct.go
View file @
631f8e23
package
create
type
CopyEntry
struct
{
Src
string
`
json
:"src"`
Dest
string
`
json
:"dest"`
Src
string
`
yaml
:"src"`
Dest
string
`
yaml
:"dest"`
}
type
LinkEntry
struct
{
Apps
[]
string
`
json
:"apps,omitempty"`
App
string
`
json
:"app,omitempty"`
Sys
string
`
json
:"sys"`
User
string
`
json
:"user"`
Apps
[]
string
`
yaml
:"apps,omitempty"`
App
string
`
yaml
:"app,omitempty"`
Sys
string
`
yaml
:"sys"`
User
string
`
yaml
:"user"`
}
type
ReleaseReplaceEntry
struct
{
Src
string
`
json
:"src"`
Dest
string
`
json
:"dest"`
Src
string
`
yaml
:"src"`
Dest
string
`
yaml
:"dest"`
}
type
HyprVar
struct
{
Name
string
`
json
:"name"`
Value
string
`
json
:"value"`
Name
string
`
yaml
:"name"`
Value
string
`
yaml
:"value"`
}
type
HyprModule
struct
{
Module
string
`
json
:"module"`
User
bool
`
json
:"user,omitempty"`
NewOnly
bool
`
json
:"new-only,omitempty"`
IfExec
string
`
json
:"if-exec,omitempty"`
Module
string
`
yaml
:"module"`
User
bool
`
yaml
:"user,omitempty"`
NewOnly
bool
`
yaml
:"new-only,omitempty"`
IfExec
string
`
yaml
:"if-exec,omitempty"`
}
type
Profile
struct
{
Binary
string
`
json
:"binary,omitempty"`
Copy
[]
CopyEntry
`
json
:"copy,omitempty"`
Links
[]
LinkEntry
`
json
:"links"`
ReleaseReplace
[]
ReleaseReplaceEntry
`
json
:"release-replace,omitempty"`
Binary
string
`
yaml
:"binary,omitempty"`
Copy
[]
CopyEntry
`
yaml
:"copy,omitempty"`
Links
[]
LinkEntry
`
yaml
:"links"`
ReleaseReplace
[]
ReleaseReplaceEntry
`
yaml
:"release-replace,omitempty"`
// ----- hyprland -----
SyncSystemLayouts
bool
`
json
:"sync-system-layouts,omitempty"`
HyprVars
[]
HyprVar
`
json
:"hyprvars,omitempty"`
HyprModules
[]
HyprModule
`
json
:"hyprmodules,omitempty"`
SyncSystemLayouts
bool
`
yaml
:"sync-system-layouts,omitempty"`
HyprVars
[]
HyprVar
`
yaml
:"hyprvars,omitempty"`
HyprModules
[]
HyprModule
`
yaml
:"hyprmodules,omitempty"`
}
type
Config
struct
{
Profiles
map
[
string
]
Profile
`
json
:"profiles"`
Profiles
map
[
string
]
Profile
`
yaml
:"profiles"`
}
type
Result
struct
{
...
...
go.mod
View file @
631f8e23
...
...
@@ -6,6 +6,7 @@ require (
github.com/fatih/color v1.18.0
github.com/godbus/dbus/v5 v5.1.0
github.com/urfave/cli/v3 v3.4.1
gopkg.in/yaml.v3 v3.0.1
)
require (
...
...
go.sum
View file @
631f8e23
...
...
@@ -19,5 +19,7 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
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