Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-panel
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
ximper-shell-panel
Commits
912b6b8e
Verified
Commit
912b6b8e
authored
May 22, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add toggle command
parent
45dd72ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
README.md
README.md
+1
-0
main.go
main.go
+9
-0
runner.go
runner.go
+7
-0
No files found.
README.md
View file @
912b6b8e
...
@@ -20,6 +20,7 @@ ximper-shell-panel list-modules
...
@@ -20,6 +20,7 @@ ximper-shell-panel list-modules
ximper-shell-panel list-modules
-o
json
ximper-shell-panel list-modules
-o
json
ximper-shell-panel start
ximper-shell-panel start
ximper-shell-panel stop
ximper-shell-panel stop
ximper-shell-panel toggle
ximper-shell-panel restart
ximper-shell-panel restart
```
```
...
...
main.go
View file @
912b6b8e
...
@@ -53,6 +53,11 @@ func main() {
...
@@ -53,6 +53,11 @@ func main() {
Action
:
stopCommand
,
Action
:
stopCommand
,
},
},
{
{
Name
:
"toggle"
,
Usage
:
"Start the panel if stopped, stop it if running"
,
Action
:
toggleCommand
,
},
{
Name
:
"restart"
,
Name
:
"restart"
,
Usage
:
"Restart the panel"
,
Usage
:
"Restart the panel"
,
Action
:
restartCommand
,
Action
:
restartCommand
,
...
@@ -130,6 +135,10 @@ func stopCommand(ctx context.Context, cmd *cli.Command) error {
...
@@ -130,6 +135,10 @@ func stopCommand(ctx context.Context, cmd *cli.Command) error {
return
StopWaybar
()
return
StopWaybar
()
}
}
func
toggleCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
return
ToggleWaybar
()
}
func
restartCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
func
restartCommand
(
ctx
context
.
Context
,
cmd
*
cli
.
Command
)
error
{
return
RestartWaybar
()
return
RestartWaybar
()
}
}
runner.go
View file @
912b6b8e
...
@@ -50,6 +50,13 @@ func StopWaybar() error {
...
@@ -50,6 +50,13 @@ func StopWaybar() error {
return
stopWaybar
()
return
stopWaybar
()
}
}
func
ToggleWaybar
()
error
{
if
PanelIsRunning
()
{
return
StopWaybar
()
}
return
StartWaybar
()
}
func
RestartWaybar
()
error
{
func
RestartWaybar
()
error
{
if
err
:=
StopWaybar
();
err
!=
nil
{
if
err
:=
StopWaybar
();
err
!=
nil
{
return
err
return
err
...
...
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