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
c1ebc2fe
Verified
Commit
c1ebc2fe
authored
Mar 09, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hyprland: add reload command
parent
264fdd09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
actions.go
hyprland/actions.go
+48
-0
commands.go
hyprland/commands.go
+11
-0
No files found.
hyprland/actions.go
View file @
c1ebc2fe
...
...
@@ -46,6 +46,54 @@ func HyprlandFixConfigCommand(ctx context.Context, cmd *cli.Command) error {
return
nil
}
func
HyprlandReloadCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
manager
,
err
:=
GetHyprlandManager
(
ctx
)
if
err
!=
nil
{
return
err
}
errs
,
err
:=
manager
.
Check
(
""
)
if
err
!=
nil
{
return
err
}
if
len
(
errs
)
>
0
{
if
cmd
.
Bool
(
"gui"
)
{
var
lines
[]
string
for
_
,
e
:=
range
errs
{
lines
=
append
(
lines
,
fmt
.
Sprintf
(
"%s:%d -> %s"
,
e
.
File
,
e
.
Line
,
e
.
Text
))
}
text
:=
locale
.
T
(
"Config has errors, not reloading:"
)
+
"
\n\n
"
+
strings
.
Join
(
lines
,
"
\n
"
)
dialogCmd
:=
exec
.
Command
(
"hyprland-dialog"
,
"--title"
,
locale
.
T
(
"Hyprland reload"
),
"--text"
,
text
,
"--buttons"
,
"OK"
,
)
_
=
dialogCmd
.
Run
()
return
nil
}
fmt
.
Println
(
locale
.
T
(
"Config has errors, not reloading:"
))
for
_
,
e
:=
range
errs
{
fmt
.
Printf
(
" %s:%d -> %s
\n
"
,
e
.
File
,
e
.
Line
,
e
.
Text
)
}
return
nil
}
if
out
,
err
:=
exec
.
Command
(
"hyprctl"
,
"reload"
)
.
CombinedOutput
();
err
!=
nil
{
return
fmt
.
Errorf
(
locale
.
T
(
"failed to reload: %s"
),
strings
.
TrimSpace
(
string
(
out
)))
}
if
cmd
.
Bool
(
"gui"
)
{
// 5 = Ok, цвет 0 (дефолтный для иконки), 3000ms
exec
.
Command
(
"hyprctl"
,
"notify"
,
"5"
,
"3000"
,
"0"
,
locale
.
T
(
"Config reloaded"
))
.
Run
()
}
else
{
color
.
Green
(
locale
.
T
(
"Config reloaded"
))
}
return
nil
}
func
HyprlandCheckCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
manager
,
err
:=
GetHyprlandManager
(
ctx
)
if
err
!=
nil
{
...
...
hyprland/commands.go
View file @
c1ebc2fe
...
...
@@ -49,6 +49,17 @@ func CommandList() *cli.Command {
Action
:
HyprlandFixConfigCommand
,
},
{
Name
:
"reload"
,
Usage
:
locale
.
T
(
"Verify config and reload Hyprland"
),
Flags
:
[]
cli
.
Flag
{
&
cli
.
BoolFlag
{
Name
:
"gui"
,
Usage
:
locale
.
T
(
"Show errors in a dialog window"
),
},
},
Action
:
HyprlandReloadCommand
,
},
{
Name
:
"binds"
,
Usage
:
locale
.
T
(
"Show keybindings"
),
Flags
:
[]
cli
.
Flag
{
...
...
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