ximperconf: add deferred commands

parent cbe32a3d
...@@ -28,6 +28,11 @@ show_help() { ...@@ -28,6 +28,11 @@ show_help() {
print_yellow " base Базовую конфигурацию" print_yellow " base Базовую конфигурацию"
print_yellow " hyprland Конфигурацию Hyprland" print_yellow " hyprland Конфигурацию Hyprland"
print_white "" print_white ""
print_white " deferred Репозиторий Deferred"
print_yellow " info Информация"
print_yellow " date Дата архива"
print_yellow " last-update Дата последнего обновления"
print_white ""
print_white " hyprland Управление модулями Hyprland" print_white " hyprland Управление модулями Hyprland"
print_yellow " check Проверить конфиг" print_yellow " check Проверить конфиг"
print_yellow " sync-xkb-layouts Синхронизировать раскладки с xkb" print_yellow " sync-xkb-layouts Синхронизировать раскладки с xkb"
...@@ -64,6 +69,8 @@ show_help() { ...@@ -64,6 +69,8 @@ show_help() {
print_white " $SCRIPT_NAME create base" print_white " $SCRIPT_NAME create base"
print_white " $SCRIPT_NAME create hyprland" print_white " $SCRIPT_NAME create hyprland"
print_white "" print_white ""
print_white " $SCRIPT_NAME deferred info"
print_white ""
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"
...@@ -119,6 +126,32 @@ create_link_if_missing() { ...@@ -119,6 +126,32 @@ create_link_if_missing() {
fi fi
} }
deferred_get_html() {
curl -s "https://download.etersoft.ru/pub/Etersoft/Sisyphus/Deferred_Info.html"
}
deferred_last_update() {
local html="$1"
grep -oP '(?<=Last update date: )[0-9:. ]+' <<<"$html"
}
deferred_archive_date() {
local html="$1"
grep -oP '(?<=Sisyphus archive date: )[0-9-]+' <<<"$html"
}
deferred_info() {
local html="$1"
local last_update archive_date
last_update=$(deferred_last_update "$html")
archive_date=$(deferred_archive_date "$html")
print_green "Deferred:"
print_white " Последнее обновление: $last_update"
print_white " Дата архива: $archive_date"
}
hyprland_check() { hyprland_check() {
command -v hyprland >/dev/null 2>&1 || print_error "Hyprland не найден в PATH" command -v hyprland >/dev/null 2>&1 || print_error "Hyprland не найден в PATH"
...@@ -447,6 +480,14 @@ case "$cmd" in ...@@ -447,6 +480,14 @@ case "$cmd" in
*) print_error "Неизвестная конфигурация: $subcmd" ;; *) print_error "Неизвестная конфигурация: $subcmd" ;;
esac esac
;; ;;
deferred)
html=$(deferred_get_html)
case "$subcmd" in
info) deferred_info "$html" ;;
date) deferred_archive_date "$html" ;;
last-update) deferred_last_update "$html" ;;
esac
;;
hyprland) hyprland)
case "$subcmd" in case "$subcmd" in
check) hyprland_check ;; check) hyprland_check ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment