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
e7044e5b
Verified
Commit
e7044e5b
authored
Dec 03, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create: add --available
parent
7a57395c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
actions.go
create/actions.go
+23
-1
commands.go
create/commands.go
+8
-4
No files found.
create/actions.go
View file @
e7044e5b
...
@@ -430,6 +430,10 @@ func printTree(title string, lines []string) {
...
@@ -430,6 +430,10 @@ func printTree(title string, lines []string) {
func
createProfile
(
profileName
string
,
prof
Profile
,
dryRun
bool
,
res
*
Result
)
{
func
createProfile
(
profileName
string
,
prof
Profile
,
dryRun
bool
,
res
*
Result
)
{
color
.
Green
(
"Создаётся профиль: %s"
,
profileName
)
color
.
Green
(
"Создаётся профиль: %s"
,
profileName
)
if
!
ProfileAvailable
(
prof
)
{
color
.
Red
(
"Профиль %s недоступен"
,
profileName
)
return
}
processProfile
(
prof
,
dryRun
,
res
)
processProfile
(
prof
,
dryRun
,
res
)
}
}
...
@@ -481,8 +485,9 @@ func ShowProfilesInfo() {
...
@@ -481,8 +485,9 @@ func ShowProfilesInfo() {
func
CreateConfCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
func
CreateConfCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
profile
:=
cmd
.
Args
()
.
Get
(
0
)
profile
:=
cmd
.
Args
()
.
Get
(
0
)
auto
:=
cmd
.
Bool
(
"auto"
)
auto
:=
cmd
.
Bool
(
"auto"
)
available
:=
cmd
.
Bool
(
"available"
)
if
profile
==
""
&&
!
auto
{
if
profile
==
""
&&
!
auto
&&
!
available
{
ShowProfilesInfo
()
ShowProfilesInfo
()
return
nil
return
nil
}
}
...
@@ -505,6 +510,23 @@ func CreateConfCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -505,6 +510,23 @@ func CreateConfCommand(ctx context.Context, cmd *cli.Command) error {
return
err
return
err
}
}
if
available
{
color
.
Cyan
(
"Создаём все доступные профили...
\n
"
)
for
name
,
profile
:=
range
cfg
.
Profiles
{
if
ProfileAvailable
(
profile
)
{
res
:=
&
Result
{}
createProfile
(
name
,
profile
,
dryRun
,
res
)
printTree
(
"Копируем"
,
res
.
Copies
)
printTree
(
"Создаём ссылки"
,
res
.
Links
)
printTree
(
"Обновляем"
,
res
.
Replaced
)
printTree
(
"Создаём переменные Hyprland"
,
res
.
HyprVars
)
printTree
(
"Подключаем модули Hyprland"
,
res
.
HyprModules
)
printTree
(
"Синхронизируем раскладку Hyprland"
,
res
.
SyncSystemLayouts
)
}
}
return
nil
}
mainProf
,
ok
:=
cfg
.
Profiles
[
profile
]
mainProf
,
ok
:=
cfg
.
Profiles
[
profile
]
if
!
ok
{
if
!
ok
{
color
.
Red
(
"Профиль %s не найден"
,
profile
)
color
.
Red
(
"Профиль %s не найден"
,
profile
)
...
...
create/commands.go
View file @
e7044e5b
...
@@ -20,10 +20,14 @@ func CommandList() *cli.Command {
...
@@ -20,10 +20,14 @@ func CommandList() *cli.Command {
Value
:
false
,
Value
:
false
,
},
},
&
cli
.
BoolFlag
{
&
cli
.
BoolFlag
{
Name
:
"auto"
,
Name
:
"auto"
,
Usage
:
" Automatic profile selection"
,
Usage
:
"Automatic profile selection"
,
Aliases
:
[]
string
{
"a"
},
Value
:
false
,
Value
:
false
,
},
&
cli
.
BoolFlag
{
Name
:
"available"
,
Usage
:
"available profiles selected"
,
Value
:
false
,
},
},
},
},
Action
:
CreateConfCommand
,
Action
:
CreateConfCommand
,
...
...
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