Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-tools
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-tools
Commits
5833d702
Verified
Commit
5833d702
authored
Aug 16, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ximperconf: add plugin commands
parent
4501c9a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
2 deletions
+117
-2
ximperconf
bin/ximperconf
+117
-2
No files found.
bin/ximperconf
View file @
5833d702
...
@@ -4,6 +4,7 @@ set -euo pipefail
...
@@ -4,6 +4,7 @@ set -euo pipefail
SCRIPT_NAME
=
"
$(
basename
"
$0
"
)
"
SCRIPT_NAME
=
"
$(
basename
"
$0
"
)
"
HYPR_CONF
=
"
$HOME
/.config/hypr/hyprland.conf"
HYPR_CONF
=
"
$HOME
/.config/hypr/hyprland.conf"
plugin_dir
=
"/usr/lib64/hyprland"
print_error
()
{
print_error
()
{
printf
"
\0
33[1;31m%s
\0
33[0m
\n
"
"
$1
"
printf
"
\0
33[1;31m%s
\0
33[0m
\n
"
"
$1
"
...
@@ -40,6 +41,15 @@ show_help() {
...
@@ -40,6 +41,15 @@ show_help() {
print_blue
" Флаги:"
print_blue
" Флаги:"
print_yellow
" --enabled Вывести включенные модули"
print_yellow
" --enabled Вывести включенные модули"
print_yellow
" --disabled Вывести отключенные модули"
print_yellow
" --disabled Вывести отключенные модули"
print_white
" plugin Управление плагинами"
print_yellow
" load <плагин> Загрузить плагин"
print_yellow
" unload <плагин> Выгрузить плагин"
print_yellow
" toggle <плагин> Переключить плагин"
print_yellow
" status <плагин> Статус плагина"
print_yellow
" list Список плагинов"
print_blue
" Флаги:"
print_yellow
" --loaded Вывести загруженные плагины"
print_yellow
" --unloaded Вывести выгруженные плагины"
print_white
" var Управление переменными"
print_white
" var Управление переменными"
print_yellow
" list Показать список переменных"
print_yellow
" list Показать список переменных"
print_yellow
" info Показать значения переменных"
print_yellow
" info Показать значения переменных"
...
@@ -54,9 +64,13 @@ show_help() {
...
@@ -54,9 +64,13 @@ show_help() {
print_white
"
$SCRIPT_NAME
hyprland check"
print_white
"
$SCRIPT_NAME
hyprland check"
print_white
""
print_white
""
print_white
"
$SCRIPT_NAME
hyprland module enable theme"
print_white
"
$SCRIPT_NAME
hyprland module enable theme"
print_white
"
$SCRIPT_NAME
hyprland module
enable --user
theme"
print_white
"
$SCRIPT_NAME
hyprland module
--user enable
theme"
print_white
"
$SCRIPT_NAME
hyprland module list"
print_white
"
$SCRIPT_NAME
hyprland module list"
print_white
"
$SCRIPT_NAME
hyprland module list --user --enabled"
print_white
"
$SCRIPT_NAME
hyprland module --user list --enabled"
print_white
""
print_white
"
$SCRIPT_NAME
hyprland plugin load Hyprspace"
print_white
"
$SCRIPT_NAME
hyprland plugin list"
print_white
"
$SCRIPT_NAME
hyprland plugin list --loaded"
print_white
""
print_white
""
print_white
"
$SCRIPT_NAME
hyprland var set terminal kitty"
print_white
"
$SCRIPT_NAME
hyprland var set terminal kitty"
print_white
"
$SCRIPT_NAME
hyprland var get terminal"
print_white
"
$SCRIPT_NAME
hyprland var get terminal"
...
@@ -317,6 +331,89 @@ hyprland_var_unset() {
...
@@ -317,6 +331,89 @@ hyprland_var_unset() {
fi
fi
}
}
hyprland_plugin_list
()
{
[
!
-d
"
$plugin_dir
"
]
&&
print_error
"Каталог плагинов не найден:
$plugin_dir
"
local
loaded_json
loaded_json
=
$(
hyprctl plugin list
-j
2>/dev/null
||
echo
'[]'
)
local
loaded_names
loaded_names
=
$(
echo
"
$loaded_json
"
| jq
-r
'.[].name'
2>/dev/null
||
true
)
local
filter
=
"
${
1
:-
all
}
"
for
f
in
"
$plugin_dir
"
/
*
.so
;
do
[
-e
"
$f
"
]
||
continue
local
name
name
=
$(
basename
"
$f
"
.so
)
local
is_loaded
=
0
if
echo
"
$loaded_names
"
|
grep
-qx
"
$name
"
;
then
is_loaded
=
1
fi
case
"
$filter
"
in
loaded
)
[
$is_loaded
-eq
1
]
&&
print_green
"
$name
"
;;
unloaded
)
[
$is_loaded
-eq
0
]
&&
print_white
"
$name
"
;;
all
)
[
$is_loaded
-eq
1
]
&&
print_green
"
$name
"
||
print_white
"
$name
"
;;
esac
done
}
hyprland_plugin_status
()
{
local
plugin
=
"
$1
"
[
-z
"
$plugin
"
]
&&
print_error
"Укажите имя плагина"
local
loaded
loaded
=
$(
hyprctl plugin list
-j
| jq
-r
'.[].name'
|
grep
-x
"
$plugin
"
||
true
)
if
[
-n
"
$loaded
"
]
;
then
echo
"loaded"
else
echo
"unloaded"
fi
}
hyprland_set_plugin
()
{
local
action
=
"
$1
"
local
plugin
=
"
$2
"
local
so_path
=
"
$plugin_dir
/
$plugin
.so"
[
-z
"
$plugin
"
]
&&
print_error
"Укажите имя плагина"
if
[
"
$action
"
=
"load"
]
;
then
[
!
-f
"
$so_path
"
]
&&
print_error
"Файл плагина не найден:
$so_path
"
if
[
"
$(
hyprland_plugin_status
"
$plugin
"
)
"
=
"loaded"
]
;
then
print_yellow
"Плагин '
$plugin
' уже загружен"
return
fi
hyprctl plugin load
"
$so_path
"
>
/dev/null 2>&1
print_green
"Плагин '
$plugin
' загружен"
elif
[
"
$action
"
=
"unload"
]
;
then
if
[
"
$(
hyprland_plugin_status
"
$plugin
"
)
"
=
"unloaded"
]
;
then
print_yellow
"Плагин '
$plugin
' уже выгружен"
return
fi
hyprctl plugin unload
"
$so_path
"
>
/dev/null 2>&1
print_green
"Плагин '
$plugin
' выгружен"
fi
}
hyprland_toggle_plugin
()
{
local
plugin
=
"
$1
"
[
-z
"
$plugin
"
]
&&
print_error
"Укажите плагин для переключения"
local
status
status
=
$(
hyprland_plugin_status
"
$plugin
"
)
case
"
$status
"
in
loaded
)
hyprland_set_plugin unload
"
$plugin
"
;;
unloaded
)
hyprland_set_plugin load
"
$plugin
"
;;
esac
}
cmd
=
"
${
1
:-}
"
cmd
=
"
${
1
:-}
"
subcmd
=
"
${
2
:-}
"
subcmd
=
"
${
2
:-}
"
shift
2
||
true
shift
2
||
true
...
@@ -366,6 +463,24 @@ case "$cmd" in
...
@@ -366,6 +463,24 @@ case "$cmd" in
unset
)
hyprland_var_unset
"
$2
"
;;
unset
)
hyprland_var_unset
"
$2
"
;;
esac
esac
;;
;;
plugin
)
case
"
$1
"
in
list
)
list_filter
=
"all"
for
arg
in
"
$@
"
;
do
case
"
$arg
"
in
--loaded
)
list_filter
=
"loaded"
;;
--unloaded
)
list_filter
=
"unloaded"
;;
esac
done
hyprland_plugin_list
"
$list_filter
"
;;
load
)
hyprland_set_plugin load
"
$2
"
;;
unload
)
hyprland_set_plugin unload
"
$2
"
;;
toggle
)
hyprland_toggle_plugin
"
$2
"
;;
status
)
hyprland_plugin_status
"
$2
"
;;
esac
;;
esac
esac
;;
;;
help
|
-h
|
--help
)
help
|
-h
|
--help
)
...
...
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