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
a0099789
Verified
Commit
a0099789
authored
Nov 29, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update config
parent
6246bbc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
35 deletions
+22
-35
config.go
config/config.go
+22
-35
No files found.
config/config.go
View file @
a0099789
...
...
@@ -3,6 +3,7 @@ package config
import
(
"os"
"path/filepath"
"ximperconf/utils"
)
type
CreateEnv
struct
{
...
...
@@ -22,6 +23,7 @@ type RepoEnv struct {
type
Environment
struct
{
Version
string
IsRoot
bool
Create
*
CreateEnv
Hyprland
*
HyprEnv
Repo
*
RepoEnv
...
...
@@ -31,46 +33,24 @@ var Env Environment
func
InitConfig
()
error
{
Env
.
Version
=
"0.1.0"
if
_
,
err
:=
os
.
Stat
(
"/usr/bin/Hyprland"
);
os
.
IsNotExist
(
err
)
{
Env
.
Hyprland
=
nil
}
else
{
Env
.
Hyprland
=
&
HyprEnv
{}
}
home
,
_
:=
os
.
UserHomeDir
()
Env
.
IsRoot
=
os
.
Geteuid
()
==
0
Env
.
Create
=
&
CreateEnv
{
Config
:
"/etc/ximperdistro/ximperconf/profiles.yaml"
,
}
if
Env
.
Hyprland
!=
nil
{
userModulesPath
:=
filepath
.
Join
(
home
,
".config"
,
"hypr"
)
systemModulesPath
:=
"/etc/ximperdistro/hyprland/hypr"
confPath
:=
filepath
.
Join
(
userModulesPath
,
"hyprland.conf"
)
pluginsPath
:=
"/usr/lib64/hyprland"
if
_
,
err
:=
os
.
Stat
(
userModulesPath
);
os
.
IsNotExist
(
err
)
{
_
=
os
.
MkdirAll
(
userModulesPath
,
0755
)
}
Env
.
Hyprland
.
UserModulesDir
=
userModulesPath
if
_
,
err
:=
os
.
Stat
(
systemModulesPath
);
os
.
IsNotExist
(
err
)
{
Env
.
Hyprland
.
SystemModulesDir
=
""
}
else
{
Env
.
Hyprland
.
SystemModulesDir
=
systemModulesPath
}
if
_
,
err
:=
os
.
Stat
(
pluginsPath
);
os
.
IsNotExist
(
err
)
{
Env
.
Hyprland
.
PluginsDir
=
""
}
else
{
Env
.
Hyprland
.
PluginsDir
=
pluginsPath
}
if
_
,
err
:=
os
.
Stat
(
confPath
);
err
==
nil
{
Env
.
Hyprland
.
Config
=
confPath
}
else
{
Env
.
Hyprland
.
Config
=
""
if
utils
.
FileExists
(
"/usr/bin/hyprland"
)
{
home
,
_
:=
os
.
UserHomeDir
()
userModules
:=
filepath
.
Join
(
home
,
".config"
,
"hypr"
)
systemModules
:=
"/etc/ximperdistro/hyprland/hypr"
pluginsDir
:=
"/usr/lib64/hyprland"
confFile
:=
filepath
.
Join
(
userModules
,
"hyprland.conf"
)
Env
.
Hyprland
=
&
HyprEnv
{
Config
:
confFile
,
UserModulesDir
:
userModules
,
SystemModulesDir
:
optionalPath
(
systemModules
),
PluginsDir
:
optionalPath
(
pluginsDir
),
}
}
...
...
@@ -80,3 +60,10 @@ func InitConfig() error {
return
nil
}
func
optionalPath
(
path
string
)
string
{
if
utils
.
FileExists
(
path
)
{
return
path
}
return
""
}
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