added adaptive quickshell
This commit is contained in:
1 parent
6eb56d2065
commit
5b33a73fd8
189 files changed
+8678
-15
No files matched your search
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -0,0 +1,56 @@
|
||||
#!/bin/sh
|
||||
PATH=$1
|
||||
SHELL=$2
|
||||
|
||||
check_root() {
|
||||
if [ $(/usr/bin/id -u) -ne 0 ]; then
|
||||
printf "** You must be root\n"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_or_mkdir() {
|
||||
[ ! -d $PATH/dev ] && mkdir -pv $PATH/dev
|
||||
[ ! -d $PATH/proc ] && mkdir -pv $PATH/proc
|
||||
[ ! -d $PATH/sys ] && mkdir -pv $PATH/sys
|
||||
[ ! -d $PATH/run ] && mkdir -pv $PATH/run
|
||||
}
|
||||
|
||||
mount_virtual() {
|
||||
/usr/bin/mount -v --bind /dev $PATH/dev
|
||||
/usr/bin/mount -vt devpts devpts -o gid=5,mode=0620 $PATH/dev/pts
|
||||
/usr/bin/mount -vt proc proc $PATH/proc
|
||||
/usr/bin/mount -vt sysfs sysfs $PATH/sys
|
||||
/usr/bin/mount -vt tmpfs tmpfs $PATH/run
|
||||
if [ -h $PATH/dev/shm ]; then
|
||||
/usr/bin/install -v -d -m 1777 $PATH$(/usr/bin/realpath /dev/shm)
|
||||
else
|
||||
/usr/bin/mount -vt tmpfs -o nosuid,nodev tmpfs $PATH/dev/shm
|
||||
fi
|
||||
/usr/bin/cp -v /etc/resolv.conf $PATH/etc/resolv.conf
|
||||
}
|
||||
|
||||
umount_virtual() {
|
||||
/usr/bin/mountpoint -q $PATH/dev/shm && /usr/bin/umount $PATH/dev/shm
|
||||
/usr/bin/umount $PATH/dev/pts
|
||||
/usr/bin/umount $PATH/{sys,proc,run,dev}
|
||||
}
|
||||
|
||||
get_shell() {
|
||||
if [[ "$SHELL" != "" ]]; then
|
||||
echo $SHELL
|
||||
fi
|
||||
echo "/bin/sh"
|
||||
}
|
||||
|
||||
check_root
|
||||
check_or_mkdir
|
||||
mount_virtual
|
||||
|
||||
/usr/bin/chroot \
|
||||
$PATH \
|
||||
/usr/bin/env -i \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin \
|
||||
$(get_shell)
|
||||
|
||||
umount_virtual
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,403 @@
|
||||
# Adaptive Shell: состояние реализации
|
||||
|
||||
Desktop-этап реализации задания из `docs/prompt/hyprland_quickshell_adaptive_shell.md`.
|
||||
Проверено 17 ноября 2026 на Quickshell 0.3.2, Qt 6.12 и работающей Wayland-сессии Hyprland.
|
||||
Это ещё не завершённая конвергентная оболочка по всем критериям мастер-промпта.
|
||||
|
||||
## Реализовано
|
||||
|
||||
- `quickshell/shell.qml`: один процесс, общий набор сервисов, IPC для открытия экранов.
|
||||
- Панель на каждом выходе, рабочие пространства, заголовок активного окна, часы,
|
||||
системный трей и реальные аккумуляторы через UPower; доступ к аудиоустройствам,
|
||||
состоянию/заглушению микрофона и меню питания. IPC открывает панели на мониторе
|
||||
с фокусом Hyprland; физическая проверка нескольких мониторов ещё предстоит.
|
||||
- Launcher: XDG DesktopEntries, фильтрация, сетка, клавиатурная навигация,
|
||||
выполнение через DesktopEntry.execute(), без исполнения поисковой строки.
|
||||
Избранное сохраняется по Desktop Entry ID, история ограничена 50 записями;
|
||||
в выдаче сначала избранное, затем последние запуски, затем алфавит.
|
||||
Кнопка ★ и Пробел на выбранном приложении переключают закрепление.
|
||||
- Desktop Settings — отдельное управляемое окно с изменяемым размером, боковой
|
||||
навигацией и компактным переключателем разделов при узком окне. Повторный вызов
|
||||
открывает то же окно. Секция звука доступна также из панели и Quick Settings.
|
||||
- Quick Settings: NetworkManager через Quickshell.Networking, отдельные интерфейсы,
|
||||
Wi-Fi с учётом аппаратной блокировки; адаптеры BlueZ; PipeWire volume/mute,
|
||||
микрофон; MPRIS. Для расширенного редактирования подключений и сопряжения
|
||||
открываются nm-connection-editor и blueman-manager. Это временные внешние инструменты,
|
||||
а не собственные страницы Settings. Выбор устройства ввода/вывода, mute и громкость
|
||||
каждого устройства уже реализованы внутри Settings через PipeWire/WirePlumber.
|
||||
Изменения устройств отслеживаются общей моделью без polling.
|
||||
- Статические обои: отдельный Background-слой на каждом мониторе без захвата ввода
|
||||
и резервирования рабочей области. Выбор через FileDialog/локальный путь, предпросмотр,
|
||||
общий фон и отдельные настройки выходов, включая сохранённые отключённые мониторы.
|
||||
При ошибке декодирования новый файл не подменяет последние загруженные обои.
|
||||
Есть отключение слоя и возврат к общему фону; настройки переживают restart и QML reload.
|
||||
Без выбора обоев фоновые поверхности не создаются. Hyprpaper пока сохранён для отката.
|
||||
- Отдельная страница «Сеть»: каждый интерфейс отдельно, MAC, состояние управления,
|
||||
Ethernet carrier/link speed, Wi-Fi сети/уровень сигнала/защита. Native connect для
|
||||
сохранённых, открытых/OWE и PSK-сетей, подтверждение disconnect интерфейса,
|
||||
ошибки/тайм-ауты и защита от повторного запроса. PSK-поле очищается при отправке,
|
||||
закрытии страницы и успешном подключении; секреты не пишутся в preferences JSON.
|
||||
Сканирование Wi-Fi включено только при активной странице с доступным radio.
|
||||
- Отдельная Bluetooth-страница: адаптеры, реальные устройства/состояния,
|
||||
включение/выключение radio, connect/disconnect и удаление сопряжения с подтверждением.
|
||||
Discovery — явный поиск до минуты, прекращающийся при закрытии страницы;
|
||||
helper удерживает собственную BlueZ discovery session. Ошибки возвращаются в UI.
|
||||
Сопряжение с PIN/passkey пока выполняется через системный диалог Blueman.
|
||||
- Settings: общая и индивидуальная для мониторов компоновка, light/dark/AMOLED,
|
||||
ручное указание сенсорного режима, reduced motion и диагностика доступных backend.
|
||||
- Настройки в `Quickshell.statePath("preferences.json")`: схема v1, проверка значений,
|
||||
атомарная запись и наблюдение за внешними изменениями. Повреждённый или более новый
|
||||
файл не перезаписывается; Settings показывает его путь. Хранение секретов отсутствует.
|
||||
- Desktop/tablet/phone layout по логической ширине и ручной настройке touch;
|
||||
нижняя кнопочная навигация в мобильных режимах. Автообнаружение touchscreen пока отсутствует.
|
||||
- Recent: настоящие окна через Wayland ToplevelManager, переключение и закрытие.
|
||||
Миниатюры не имитируются.
|
||||
- Экспериментальный Notifications backend: получение, изображения, actions,
|
||||
удаление, clear all, группировка по desktop entry/имени приложения, всплывающая карточка,
|
||||
сохранённый DND без повторного показа старых всплывающих карточек, лимит 100 текущих уведомлений.
|
||||
История на диске ограничена 100 записями, доступна после перезапуска, имеет отключение
|
||||
и очистку; transient-уведомления не сохраняются и не появляются в центре.
|
||||
Изображения и клиентские actions не записываются в историю. Архивные карточки
|
||||
не восстанавливают мёртвые D-Bus-действия.
|
||||
Тайм-ауты: клиентское положительное значение в миллисекундах, 0 — без автоистечения,
|
||||
default — 3 с для low и 6 с для normal; critical требует явного закрытия.
|
||||
Изменившаяся replacement-посылка перезапускает таймер и обновляет существующую запись.
|
||||
Мягкий QML reload не дублирует историю и не воспроизводит старую всплывающую карточку.
|
||||
По умолчанию выключен, SwayNC продолжает работать.
|
||||
- Меню питания: доступность действий через logind, явное подтверждение выхода,
|
||||
перезагрузки, выключения и сна; ожидание, ошибки backend и блокировка повторных запросов.
|
||||
Перед сном backend ожидает compositor-confirmed lock через Hyprland lock-notify.
|
||||
Settings использует то же меню вместо отдельной detached-команды блокировки.
|
||||
- Опциональное подключение из существующего Lua startup; старые команды сохранены
|
||||
как профиль по умолчанию. Установщик Settings entry не меняет сессию и пакеты.
|
||||
|
||||
Цвета основаны на фиксированной палитре Material 3; Dynamic Color, полная типографика
|
||||
и полный набор Material-компонентов пока не реализованы. QtQuick Controls запускаются
|
||||
со стилем Material через wrapper. Reduced motion сохранён в настройках; текущие экраны
|
||||
не используют собственные анимации.
|
||||
|
||||
## Запуск и возврат
|
||||
|
||||
Из корня репозитория, внутри Wayland-сессии:
|
||||
|
||||
```sh
|
||||
./hypr/bin/adaptive-shell start
|
||||
```
|
||||
|
||||
Это предварительный запуск рядом с действующей панелью, без отключения Waybar/SwayNC.
|
||||
В другом терминале:
|
||||
|
||||
```sh
|
||||
./hypr/bin/adaptive-shell settings
|
||||
./hypr/bin/adaptive-shell launcher
|
||||
./hypr/bin/adaptive-shell recent
|
||||
./hypr/bin/adaptive-shell stop
|
||||
```
|
||||
|
||||
Wrapper для открытия страницы запускает процесс, если он отсутствует.
|
||||
|
||||
Для подключения вместо Waybar в **следующей сессии** запусти из TTY:
|
||||
|
||||
```sh
|
||||
ADAPTIVE_SHELL=1 start-hyprland
|
||||
```
|
||||
|
||||
Привязки Alt+D, XF86LaunchB, Alt+Shift+P и Alt+Z используют новую оболочку.
|
||||
SwayNC остаётся сервером уведомлений, Hyprpaper — исходным/резервным фоном, SwayOSD — OSD.
|
||||
При выборе обоев в Settings новый Background-слой Quickshell отображается поверх прежнего фона.
|
||||
Hyprlock, Hypridle, lxpolkit, Clipse, Sherlock и пользовательские приложения сохраняются.
|
||||
Переменная должна быть установлена при запуске композитора, а не только Quickshell.
|
||||
|
||||
Возврат: выйди из сессии и запусти `start-hyprland` без `ADAPTIVE_SHELL`.
|
||||
При аварии оболочки внутри активного нового профиля можно вручную запустить `waybar`,
|
||||
а приложения открывать из терминала; постоянные настройки Hyprland профилем не меняются.
|
||||
|
||||
Notifications backend пока остаётся экспериментальным: ещё нужны проверки приватности
|
||||
при lock/suspend, inline replies, поведения нескольких одновременных всплывающих карточек
|
||||
и безопасной миграции владельца D-Bus. SwayNC по умолчанию сохранён. В тесте эта переменная используется с отдельной
|
||||
D-Bus-шиной. При включении в новом профиле startup не запускает SwayNC; уже запущенный
|
||||
SwayNC автоматически не завершается. Не запускай два notification server на одной шине.
|
||||
|
||||
Установка команды и `.desktop` файла Settings (с резервными копиями существующих файлов):
|
||||
|
||||
```sh
|
||||
python quickshell/install.py # показать пути
|
||||
python quickshell/install.py --apply # записать launcher и desktop entry
|
||||
```
|
||||
|
||||
Установщик не устанавливает пакеты, не создаёт автологин, не включает systemd services,
|
||||
не запускает `install_scripts/install-arch.sh`. Конфигурация запускается прямо из репозитория,
|
||||
поэтому перемещение репозитория требует повторной установки launcher.
|
||||
|
||||
## Проверки
|
||||
|
||||
```sh
|
||||
QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input quickshell/tests -o -,txt
|
||||
lua quickshell/tests/test_lua.lua 0 0
|
||||
lua quickshell/tests/test_lua.lua 1 0
|
||||
lua quickshell/tests/test_lua.lua 1 1
|
||||
python quickshell/tests/smoke.py
|
||||
python quickshell/tests/notifications.py
|
||||
python quickshell/tests/wallpapers.py
|
||||
python -m unittest discover -s quickshell/tests -p 'test_power_backend.py' -v
|
||||
python quickshell/tests/power_controller.py
|
||||
python quickshell/tests/network_controller.py
|
||||
python -m unittest discover -s quickshell/tests -p 'test_bluetooth_backend.py' -v
|
||||
python quickshell/tests/bluetooth_controller.py
|
||||
```
|
||||
|
||||
QtTest: 27 успешных проверок, включая границы режимов, отбрасывание некорректной схемы,
|
||||
ранжирование приложений, лимит/уникальность истории и избранное, notification timeout policy
|
||||
и валидацию notification history, локальные file URL, наследование обоев и совместимость схемы.
|
||||
Lua: проверены три комбинации старого/нового профиля и notifications без исполнения команд.
|
||||
Wayland smoke: загрузка всех страниц, включая native audio, IPC, проверка Settings
|
||||
в списке управляемых окон Hyprland, смена трёх режимов, темы, запись JSON,
|
||||
подхват внешних настроек, защита повреждённого JSON от перезаписи и восстановление,
|
||||
отправка уведомления на частной D-Bus-шине. Тест временно показывает панель и экраны,
|
||||
не останавливает текущие компоненты, использует временное хранилище.
|
||||
|
||||
Python-тесты сами создают частную D-Bus-шину, даже при прямом запуске, и используют
|
||||
временное хранилище. Lifecycle-тест требует PyGObject (`python-gobject` на Arch).
|
||||
Он проверяет replacement, причины закрытия 1/2/3, ActionInvoked, DND, critical/transient,
|
||||
группировку, сохранение/очистку/отключение истории, права каталога, QML reload,
|
||||
перезапуск процесса и продолжение доставки при повреждённом файле истории.
|
||||
Wallpaper-тест проверяет загрузку PNG с Unicode/пробелами/спецсимволами в пути,
|
||||
настоящие Background-слои через Hyprland IPC, переопределение выхода, запрет удалённых URL,
|
||||
сохранение прежнего изображения при отсутствующем файле, отключение слоя, наследование,
|
||||
сохранение настройки отключённого выхода и восстановление после restart/QML reload.
|
||||
Тест не останавливает Hyprpaper и в конце снимает свои фоновые поверхности.
|
||||
|
||||
Используй Qt 6 tools: `/usr/bin/qmllint` на этой машине относится к Qt 5.
|
||||
Qt 6 qmllint сообщает предупреждения о метаданных Quickshell PanelWindow и динамических
|
||||
моделях, а также о неквалифицированных обращениях в delegates; чистый lint пока не заявлен.
|
||||
При runtime-проверке остаются предупреждения внешних SVG-иконок и Wayland text input.
|
||||
BlueZ на этой машине не предоставляет доступный object manager; отсутствие контроллера
|
||||
обработано, но реальное Bluetooth-сопряжение не проверено.
|
||||
Изолированный headless Hyprland здесь не запускается: отсутствует `/dev/dri`,
|
||||
Aquamarine сообщает `CBackend::create() failed`. Smoke проверен в существующей сессии.
|
||||
|
||||
## Следующие обязательные этапы
|
||||
|
||||
1. Полноценная дизайн-система: токены, шрифты, Material Symbols, Dynamic Color,
|
||||
системная тема, motion, доступность и адаптивная навигация Settings.
|
||||
2. Собственные расширенные страницы профилей сети/IP/DNS/VPN и pairing-agent Bluetooth, обработка
|
||||
оставшихся ошибок/авторизации (базовая native страница сети уже реализована),
|
||||
яркость, power profiles, модемы/SIM и расширенные состояния HardwareCapabilityService.
|
||||
Сейчас отсутствие backend и отсутствие оборудования не везде различимы.
|
||||
3. Уведомления: inline replies, privacy lock/suspend, очередь всплывающих карточек,
|
||||
безопасное переключение владельца D-Bus и оставшиеся ограничения reload/replacement,
|
||||
перечисленные ниже. Базовые history/grouping/timeout/close/action тесты уже реализованы.
|
||||
4. Home Screen с папками, dock, drag-and-drop, избранным и сохранением состояния;
|
||||
Desktop Actions и тесты всех полей Desktop Entry в launcher (история и избранное уже есть).
|
||||
5. Глобальные touchscreen-жесты через проверенную интеграцию с композитором;
|
||||
маршрутизация Back, удержание для Recent, safe areas, экранная клавиатура, landscape.
|
||||
Нижние кнопки текущей реализации не считаются реализацией этих жестов.
|
||||
6. Slideshow, видеообои, отдельные lock-screen обои и аппаратные проверки multi-output/hotplug
|
||||
(статический Wallpaper engine с per-output настройками уже реализован);
|
||||
расширенные страницы мониторов с подтверждением/откатом и политики композитора.
|
||||
Глобальные gaps/borders нельзя менять независимо для мониторов без проверки API.
|
||||
7. Безопасная блокировка ext-session-lock-v1, PAM/fprintd и аппаратная проверка.
|
||||
До этого Hyprlock остаётся обязательным блокировщиком. Новый helper `lock-session`
|
||||
не меняет обои/конфиг, но действующие lock bindings и idle-конфигурация не переписаны.
|
||||
Сохранение Hyprlock не доказывает выполнение всех требований fail-closed/suspend.
|
||||
8. Исправление существующей опечатки `brightnesctl` в Hypridle после проверки реального
|
||||
пути конфигурации, единый lock entrypoint, проверка inhibitor перед suspend/resume.
|
||||
9. Безопасные backup/import/export/reset/migrations, автоматический rollback,
|
||||
обновлённые общие инструкции установки и окончательная миграция компонентов.
|
||||
10. Mock-тесты hotplug и всех комбинаций оборудования, реальные multi-monitor,
|
||||
touchscreen, ARM64/телефон, suspend/resume, fingerprint и замеры CPU/RAM/энергии.
|
||||
|
||||
До завершения этих этапов критерии готовности раздела 27 мастер-промпта не выполнены.
|
||||
|
||||
## Порядок дальнейшей разработки
|
||||
|
||||
Приоритет — завершить и стабилизировать desktop. Phone сохраняется как архитектурная
|
||||
цель, но физические проверки телефона начнутся после desktop-этапа. Переключение
|
||||
layout на desktop в smoke-тесте не считается проверкой phone, touchscreen или ARM64.
|
||||
|
||||
На текущем desktop обнаружены два устройства вывода и одно устройство ввода. Проверены
|
||||
построение native audio UI и подписка на модель; автоматический тест не меняет громкость,
|
||||
mute и выбранные устройства пользователя. Переключение/отключение физических устройств
|
||||
и реальное Bluetooth-сопряжение остаются ручными проверками.
|
||||
|
||||
## История уведомлений и ограничения Quickshell
|
||||
|
||||
История хранится в `Quickshell.statePath("notification-history/notifications.json")`.
|
||||
Подкаталог создаётся с правами `0700` через одноразовый вызов GNU `install`; периодического
|
||||
опроса и постоянно работающего вспомогательного процесса нет. Это локальный JSON с текстом
|
||||
уведомлений. Переключатель «Сохранять историю» позволяет прекратить запись и очистить её.
|
||||
Повреждённый файл не перезаписывается автоматически: ошибка отображается в центре,
|
||||
новые уведомления продолжают поступать. Для восстановления после остановки оболочки
|
||||
перенеси повреждённый файл в резервную копию и запусти оболочку снова.
|
||||
|
||||
Для Quickshell 0.3.2 тайм-аут проверен прямым D-Bus-вызовом с 250 мс. Реальный backend
|
||||
передаёт миллисекунды; описание `expireTimeout` в онлайн-документации на момент работы
|
||||
указывает секунды. При обновлении Quickshell повторяй lifecycle-тест, не меняй единицы
|
||||
только по тексту документации. Использованы [Notification API](https://quickshell.org/docs/v0.3.2/types/Quickshell.Services.Notifications/Notification/)
|
||||
и [исходники backend](https://github.com/quickshell-mirror/quickshell/blob/master/src/services/notifications/notification.cpp).
|
||||
|
||||
У Quickshell 0.3.2 новый `notification` signal не приходит для replacement существующего
|
||||
объекта; оболочка отслеживает изменения его свойств. Полностью идентичная replacement-посылка
|
||||
без изменений свойств пока не обнаруживается и не сбрасывает таймер. Это ограничение API
|
||||
нужно закрыть upstream-хуком или отдельной проверенной интеграцией перед окончательной миграцией.
|
||||
Для transient-уведомлений оставшееся время после QML reload может отсчитываться заново:
|
||||
намеренно не сохраняются их данные на диск. История обычных уведомлений сохраняет deadline
|
||||
для восстановления при мягком reload. Полный перезапуск процесса восстанавливает только
|
||||
архивный текст, а не активные уведомления/клиентские actions.
|
||||
|
||||
## Статические обои на desktop
|
||||
|
||||
Открыть страницу можно из Settings → «Обои» или командой:
|
||||
|
||||
```sh
|
||||
./hypr/bin/adaptive-shell wallpapers
|
||||
```
|
||||
|
||||
Выбери общий фон или конкретный выход, затем файл и «Применить». Имя монитора хранится
|
||||
как ключ настройки, поэтому порядок подключённых выходов не влияет на выбор.
|
||||
Для отключённого выхода доступна настройка будущего подключения; фиктивное окно для него
|
||||
не создаётся. «Использовать общие обои» удаляет override, а «Использовать прежний фон»
|
||||
отключает слой для выбранного выхода (или общий фон, если выбран общий пункт).
|
||||
|
||||
Принимаются только абсолютные локальные пути и локальные `file:///` URL. Текст пути
|
||||
не передаётся shell-команде. Новые поля `wallpapers` необязательны в прежней схеме v1.
|
||||
Предпросмотр и рендер используют Qt Image; доступность формата зависит от Qt-плагинов.
|
||||
Декодирование фонового изображения ограничено 4096 пикселями по каждой оси, crop сохраняет
|
||||
соотношение сторон. Dynamic Color, slideshow и видео этим этапом не реализованы.
|
||||
|
||||
Последнее успешное изображение удерживается в памяти текущего процесса, пока грузится
|
||||
новое или показывается ошибка. Если ошибочный путь сохранён и процесс перезапущен,
|
||||
прежнее изображение из памяти не восстанавливается: остаётся исходный фон Hyprpaper.
|
||||
Полное отключение Hyprpaper и гарантированный fallback без него требуют отдельного этапа
|
||||
миграции. Физическое подключение/отключение нескольких мониторов пока не проверено;
|
||||
на текущем desktop проверен один реальный выход и сохранение настройки отключённого.
|
||||
FileDialog загружается вместе со страницей; ручной выбор файла через системный диалог
|
||||
пока не входит в автоматический smoke-тест.
|
||||
|
||||
## Меню питания desktop
|
||||
|
||||
Меню доступно из панели, Alt+Shift+P в новом профиле и Settings → «Оболочка» →
|
||||
«Блокировка и питание…». В нём есть lock, suspend, logout, reboot и poweroff.
|
||||
Возможности перечитываются при открытии и по кнопке обновления; постоянного опроса нет.
|
||||
Неизвестные/недоступные действия отключены с причиной, а состояние `challenge` для
|
||||
reboot/poweroff обозначено как требующее авторизации. Меню не закрывается при ошибке.
|
||||
Ожидание имеет тайм-аут, но его сообщение не утверждает, что уже отправленное действие
|
||||
обязательно отменено. Закрытие меню сбрасывает неподтверждённый выбор.
|
||||
|
||||
Одноразовый `backend/power.py` использует системную D-Bus-шину logind, не root-shell.
|
||||
Вызовы CanSuspend/CanReboot/CanPowerOff предшествуют действиям. Reboot/poweroff разрешают
|
||||
обычную авторизацию polkit. Для suspend требуется `CanSuspend=yes`; `challenge` пока
|
||||
отключает этот пункт: полноценная авторизация до блокировки — отдельная будущая работа.
|
||||
После подтверждения блокировки Suspend вызывается без интерактивной авторизации,
|
||||
чтобы не открывать скрытый polkit-диалог под lock screen. Force/ignore-inhibitors флаги
|
||||
не используются. Logout отправляет фиксированный IPC-dispatch текущему Hyprland,
|
||||
не вызывает killall и не завершает остальные пользовательские сессии.
|
||||
|
||||
LockObserver сначала подписывается на `hyprland-lock-notify-v1`, затем при необходимости
|
||||
запускает Hyprlock с `--grace 0` и ждёт `locked`. Наличие процесса или logind LockedHint
|
||||
не считается подтверждением. При отсутствующем протоколе, завершившемся locker, тайм-ауте
|
||||
или полученном unlock запрос Suspend не отправляется. Helper не владеет session lock
|
||||
и не уничтожает lock client при ошибке/завершении наблюдения. Существующие Hypridle,
|
||||
Alt+B, PAM и настройки Hyprlock этим этапом не переписаны.
|
||||
|
||||
Зависимости runtime для меню: Python 3, `python-gobject`, `python-pywayland`, Hyprlock,
|
||||
Hyprland с lock-notify и logind. Если зависимость недоступна, это отражается в меню.
|
||||
Vendored XML и сгенерированные bindings находятся в `backend/protocols/`; сохранены
|
||||
исходная лицензия, URL и hash XML. Повторная генерация не требует сетевого доступа.
|
||||
Ориентиры: [logind API](https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html)
|
||||
и [исходный протокол Hyprland](https://github.com/hyprwm/hyprland-protocols/blob/main/protocols/hyprland-lock-notify-v1.xml).
|
||||
|
||||
Проверки: 19 Python unit-тестов с внедрёнными backend/observer, 7 сценариев настоящего
|
||||
Quickshell Process-controller с явно переданным fake-helper (success, denied, ошибка,
|
||||
повреждённый ответ, watchdog, неверное действие, отсутствующий helper). Они не вызывают
|
||||
реальных действий питания. Offscreen fixture запускается отдельно от production shell,
|
||||
не имеет power IPC и не выбирается через переменную окружения обычного пользователя.
|
||||
QtTest не загружает статически встроенные плагины Quickshell, поэтому controller проверяется
|
||||
отдельным runner `power_controller.py`, а не имитацией Process в QtTest.
|
||||
|
||||
В текущей desktop-сессии выполнено только чтение возможностей: logind и lock-notify доступны.
|
||||
Реальные lock/suspend/resume, logout, reboot/poweroff и интерактивный polkit ещё не проверены.
|
||||
Проверка порядка вызовов на mock-backend не заменяет проверку блокировки на всех физических
|
||||
выходах и сна/пробуждения на реальном оборудовании.
|
||||
|
||||
## Сетевые подключения desktop
|
||||
|
||||
```sh
|
||||
./hypr/bin/adaptive-shell network
|
||||
```
|
||||
|
||||
Раздел также доступен в Settings и из Quick Settings. Состояния берутся из общей
|
||||
модели Quickshell.Networking/NetworkManager, без shell-парсинга `nmcli` и без таймерного
|
||||
опроса. Отсутствующий backend отличается от пустого списка адаптеров; Wi-Fi switch
|
||||
не появляется без адаптера и сохраняется для существующего выключенного/blocked устройства.
|
||||
IP/DNS/VPN, выбор между несколькими сохранёнными профилями, enterprise/EAP/WEP и сертификаты
|
||||
пока открываются через `nm-connection-editor`. Bluetooth доступен в Quick Settings и отдельной странице Settings;
|
||||
собственный pairing agent ещё не готов.
|
||||
|
||||
WPA/WPA2-Personal и SAE используют native `connectWithPsk`; пароль передаётся непосредственно
|
||||
API, не попадает в argv, preferences, диагностический текст или собственный файл оболочки.
|
||||
NetworkManager может сохранить его в своём хранилище профилей. Поле скрывает ввод и
|
||||
запрещает предиктивный ввод. Новая enterprise-сеть не получает неподходящий PSK-переключатель.
|
||||
Для сохранённых сетей сначала пробуется подключение без повторного запроса пароля.
|
||||
При NoSecrets поле появляется только для поддерживаемых PSK-типов и активной страницы.
|
||||
|
||||
Операция остаётся ожидающей до обновления реального состояния или ошибки. Disconnect
|
||||
требует подтверждения; 45-секундный timeout сообщает о неподтверждённом результате и
|
||||
не пытается отключить/отменить соединение автоматически. Удаление интерфейса и потеря
|
||||
управления учитываются контроллером. Отключённая/скрытая страница не продолжает сканирование.
|
||||
Сложные случаи polkit/secret agent и ошибки radio toggle ещё требуют доработки и ручной проверки.
|
||||
|
||||
`network_controller.py`: 9 сценариев с явно переданными QML fake-устройствами и реальным
|
||||
NetworkController, включая правильный адаптер, connect/disconnect, duplicate prevention,
|
||||
NoSecrets, timeout, удаление/неуправляемое устройство, передачу синтетического PSK и очистку
|
||||
настоящего TextField при закрытии/подключении. Fixture изолирована от production entrypoint
|
||||
и не создаёт Networking singleton. На desktop smoke-тесте проверена загрузка страницы
|
||||
с реальными интерфейсами; connect/disconnect и Wi-Fi switch тестом не вызываются.
|
||||
Открытие страницы может включать обновление списка сетей, если доступен Wi-Fi-адаптер.
|
||||
Реальное WPA/EAP-подключение, ввод credentials через OSK и USB-hotplug ещё не проверены.
|
||||
|
||||
API сверено с [Quickshell Network](https://quickshell.org/docs/v0.3.2/types/Quickshell.Networking/Network/),
|
||||
[WifiNetwork](https://quickshell.org/docs/v0.3.2/types/Quickshell.Networking/WifiNetwork/)
|
||||
и установленными qmltypes 0.3.2. Скорость Ethernet — физический link speed, не измерение
|
||||
скорости доступа к Интернету.
|
||||
|
||||
## Bluetooth desktop
|
||||
|
||||
```sh
|
||||
./hypr/bin/adaptive-shell bluetooth
|
||||
```
|
||||
|
||||
Страница показывает адаптеры из общей Quickshell.Bluetooth модели и не создаёт mock-устройств
|
||||
при отсутствии оборудования. Состояние заблокированного/выключенного адаптера не скрывает
|
||||
сам адаптер. Включение, выключение, connect/disconnect и forget используют одноразовый
|
||||
`backend/bluetooth.py` с BlueZ D-Bus, проверкой object paths и структурированными ошибками.
|
||||
Выключение адаптера, отключение устройства и удаление сопряжения требуют подтверждения.
|
||||
UI ждёт ответ backend, повторные запросы блокируются; состояние устройства читается из BlueZ,
|
||||
а не устанавливается оптимистично. Страница не меняет Discoverable, Pairable и Trusted.
|
||||
|
||||
«Найти устройства» запускает временный helper с собственной системной D-Bus connection,
|
||||
вызывает StartDiscovery и удерживает discovery session. StopDiscovery вызывается тем же
|
||||
клиентом после закрытия страницы, остановки или тайм-аута до 60 секунд. При зависшем старте
|
||||
или завершении helper принудительно закрывается; соединение не остаётся живым после процесса.
|
||||
Поиск, уже выполняющийся другим клиентом, не останавливается. В простое отдельного Bluetooth
|
||||
процесса нет. Readiness перечитывается при открытии страницы и явном обновлении, без polling.
|
||||
|
||||
Первичное сопряжение, PIN/passkey, Numeric Comparison и подтверждение доверия пока делегированы
|
||||
`blueman-manager`: оболочка не регистрирует агент, который автоматически принимает запросы.
|
||||
Встроенный connect предназначен для уже сопряжённых устройств. Дополнительный Quick Settings
|
||||
switch пока остаётся прямым API Quickshell; полная обработка его отказов ещё предстоит.
|
||||
Зависимости helper: Python 3, `python-gobject` и работающий BlueZ. Тестовые backend явно
|
||||
передаются отдельным fixtures и не выбираются через переменную обычной сессии.
|
||||
|
||||
Проверки: 10 Python unit-тестов (пути, маршрутизация, ошибки, lifetime discovery), 14 сценариев
|
||||
настоящих QML/Process controllers с fake helper (включая watchdog, закрытие до старта,
|
||||
неудачный старт, отсутствие executable, ограничение времени, смену адаптера и чужой поиск),
|
||||
desktop smoke с загрузкой Bluetooth-страницы без изменения radio и без реального сопряжения.
|
||||
В текущей системе read-only вызов BlueZ вернул NameHasNoOwner: проверен экран недоступного
|
||||
сервиса. Реальные adapter hotplug, поиск, power/rfkill, профили connect/disconnect и pairing
|
||||
на оборудовании ещё не проверены. Доступного через BlueZ контроллера для этих проверок пока нет; отсутствие самого оборудования
|
||||
этим не доказано.
|
||||
|
||||
Семантика discovery сверена с [официальным BlueZ Adapter API](https://github.com/bluez/bluez/blob/master/doc/org.bluez.Adapter.rst):
|
||||
StartDiscovery/StopDiscovery относятся к сессии конкретного клиента, а общий поиск может
|
||||
продолжаться, пока его используют другие клиенты.
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"display": {
|
||||
"separator": " ─▶ "
|
||||
},
|
||||
@@ -207,11 +206,11 @@
|
||||
"type": "custom",
|
||||
"format": "└────────────────────────────────┘"
|
||||
},
|
||||
{
|
||||
"type": "weather",
|
||||
"key": "├▶ ",
|
||||
"keyColor": "white"
|
||||
},
|
||||
// {
|
||||
// "type": "weather",
|
||||
// "key": "├▶ ",
|
||||
// "keyColor": "white"
|
||||
// },
|
||||
{
|
||||
"type": "player",
|
||||
"key": "",
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
export QT_QUICK_CONTROLS_STYLE=Material
|
||||
# Quickshell owns org.freedesktop.Notifications when the adaptive shell runs.
|
||||
export ADAPTIVE_NOTIFICATIONS="${ADAPTIVE_NOTIFICATIONS:-1}"
|
||||
repo=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
|
||||
case "${1:-start}" in
|
||||
start) exec quickshell --no-duplicate --path "$repo/quickshell" ;;
|
||||
reload|status|launcher|settings|bluetooth|network|wallpapers|audio|quickSettings|recent|power|notifications|close)
|
||||
if ! quickshell ipc --path "$repo/quickshell" show >/dev/null 2>&1; then
|
||||
quickshell --daemonize --no-duplicate --path "$repo/quickshell"
|
||||
fi
|
||||
exec quickshell ipc --path "$repo/quickshell" call shell "$1" ;;
|
||||
stop) exec quickshell kill --path "$repo/quickshell" ;;
|
||||
*) printf '%s\n' 'Usage: adaptive-shell [start|stop|reload|status|launcher|settings|bluetooth|network|wallpapers|audio|quickSettings|recent|power|notifications|close]' >&2; exit 2 ;;
|
||||
esac
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Do not mutate wallpaper/configuration while establishing the security boundary.
|
||||
set -eu
|
||||
if pgrep -x hyprlock >/dev/null; then exit 0; fi
|
||||
exec hyprlock
|
||||
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
Executable → Regular
File mode changed.
+1
-1
@@ -1,6 +1,6 @@
|
||||
background {
|
||||
monitor =
|
||||
path = /home/tola/Pictures/wallpaper/photo_2025-11-04_16-15-57.jpg
|
||||
path = /home/tola/Pictures/wallpaper/crafted-for-cuteness-3840x2160-v0-d8u3ac79b94e1.png
|
||||
color = rgba(25, 20, 20, 1.0)
|
||||
blur_passes = 3
|
||||
blur_size = 3
|
||||
|
||||
Whitespace-only changes.
+1
-5
@@ -1,5 +1 @@
|
||||
hl.monitor({output = "", mode = "preferred", position = "auto", scale = "auto"})
|
||||
hl.monitor({output = "DVI-I-1", mode = "1920x1200", position = "0x0", scale = 1})
|
||||
hl.monitor({output = "HEADLESS-2", mode = "2048x1538", position = "0x0", scale = 2})
|
||||
hl.monitor({output = "vnc", mode = "1280x720", position = "0x0", scale = 1})
|
||||
hl.monitor({output = "DP-1", mode = "3440x1440@165", position = "0x0", scale = 1})
|
||||
hl.monitor({ output = "DP-1", mode = "3440x1440@165.00Hz", position = "0x0", scale = 1 })
|
||||
@@ -26,3 +26,11 @@ keyboard_brightness_lower = "brightnessctl --device smc::kbd_backlight s 10%-"
|
||||
music_toggle = "swayosd-client --playerctl play-pause"
|
||||
music_next = "swayosd-client --playerctl next"
|
||||
music_prev = "swayosd-client --playerctl previous"
|
||||
|
||||
-- Optional migration profile. Keep the legacy commands above as rollback defaults.
|
||||
if os.getenv("ADAPTIVE_SHELL") == "1" then
|
||||
local shell = "~/dotfiles/hypr/bin/adaptive-shell "
|
||||
launcher = shell .. "launcher"
|
||||
powermenu = shell .. "power"
|
||||
swaync_toggle = shell .. "notifications"
|
||||
end
|
||||
+8
-2
@@ -1,7 +1,11 @@
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("hyprpaper")
|
||||
hl.exec_cmd("sleep 0.3 && ~/dotfiles/hypr/bin/background.sh")
|
||||
hl.exec_cmd("waybar")
|
||||
if os.getenv("ADAPTIVE_SHELL") == "1" then
|
||||
hl.exec_cmd("~/dotfiles/hypr/bin/adaptive-shell start")
|
||||
else
|
||||
hl.exec_cmd("waybar")
|
||||
end
|
||||
hl.exec_cmd("lxpolkit")
|
||||
hl.exec_cmd("gsettings set org.gnome.desktop.interface gtk-theme 'MacTahoe-Dark'")
|
||||
hl.exec_cmd("gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'")
|
||||
@@ -10,7 +14,9 @@ hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice 24")
|
||||
hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP")
|
||||
hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP")
|
||||
hl.exec_cmd("swaync")
|
||||
if os.getenv("ADAPTIVE_SHELL") ~= "1" or os.getenv("ADAPTIVE_NOTIFICATIONS") == "0" then
|
||||
hl.exec_cmd("swaync")
|
||||
end
|
||||
hl.exec_cmd("nm-applet --indicator")
|
||||
hl.exec_cmd("uxplay")
|
||||
hl.exec_cmd("hypridle")
|
||||
|
||||
Whitespace-only changes.
Executable → Regular
File mode changed.
@@ -5,3 +5,5 @@ bold_italic_font JetBrainsMono
|
||||
window_padding_width 5
|
||||
background_blur 10
|
||||
scrollback_lines 1000000
|
||||
map ctrl+shift+a launch --stdin-source=@screen_scrollback --type=clipboard
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
/media *(rw,insecure)
|
||||
/dotfiles *(ro)
|
||||
/sshkeys *(ro)
|
||||
/music *(ro,insecure)
|
||||
@@ -0,0 +1,2 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
@@ -0,0 +1,69 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: settings
|
||||
signal navigate(string name)
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
ColumnLayout {
|
||||
width: settings.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Оболочка и внешний вид"; font.pixelSize: 22; color: Theme.primary }
|
||||
Label { text: Preferences.error; visible: text !== ""; wrapMode: Text.Wrap; Layout.fillWidth: true; color: Theme.foreground }
|
||||
Label { text: "Общий режим"; color: Theme.foreground }
|
||||
ComboBox {
|
||||
model: ["auto", "desktop", "tablet", "phone"]
|
||||
currentIndex: model.indexOf(Preferences.data.mode)
|
||||
enabled: Preferences.writable
|
||||
onActivated: Preferences.setValue("mode", currentText)
|
||||
}
|
||||
Switch {
|
||||
text: "Сенсорный ввод"
|
||||
checked: Preferences.data.touch
|
||||
enabled: Preferences.writable
|
||||
onClicked: Preferences.setValue("touch", checked)
|
||||
}
|
||||
Label { text: "Сенсорный ввод пока задаётся вручную; разрешение экрана не определяет тип устройства."; color: Theme.outline; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||||
Repeater {
|
||||
model: Quickshell.screens
|
||||
RowLayout {
|
||||
required property var modelData
|
||||
Label { text: modelData.name; color: Theme.foreground }
|
||||
ComboBox {
|
||||
model: ["auto", "desktop", "tablet", "phone"]
|
||||
currentIndex: model.indexOf(Preferences.data.outputs[modelData.name] || "auto")
|
||||
enabled: Preferences.writable
|
||||
onActivated: Preferences.setOutput(modelData.name, currentText)
|
||||
}
|
||||
}
|
||||
}
|
||||
Label { text: "Цветовая схема"; color: Theme.foreground }
|
||||
ComboBox {
|
||||
model: ["dark", "light", "amoled"]
|
||||
currentIndex: model.indexOf(Preferences.data.theme)
|
||||
enabled: Preferences.writable
|
||||
onActivated: Preferences.setValue("theme", currentText)
|
||||
}
|
||||
Switch { text: "Уменьшить движение"; checked: Preferences.data.reducedMotion; enabled: Preferences.writable; onClicked: Preferences.setValue("reducedMotion", checked) }
|
||||
Label { text: "Безопасность"; font.pixelSize: 22; color: Theme.primary }
|
||||
Label { text: "Блокировка: Hyprlock. Управление бездействием: Hypridle."; color: Theme.foreground; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||||
ActionButton { text: "Блокировка и питание…"; onClicked: settings.navigate("power") }
|
||||
Label { text: "Hardware Capabilities"; font.pixelSize: 22; color: Theme.primary }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Wi-Fi: " + Hardware.wifiState + "\nСетевые интерфейсы: " + Hardware.networks.length + "\nBluetooth-контроллеры: " + Hardware.bluetoothAdapters.length + "\nPipeWire: " + (Hardware.audioReady ? "available" : "unavailable") + "\nАудиовыход: " + (Hardware.sink ? "available" : "unavailable") + "\nМикрофон: " + (Hardware.source ? "available" : "unavailable") + "\nАккумуляторы: " + Hardware.batteries.length
|
||||
color: Theme.foreground
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
Label { Layout.fillWidth: true; text: "Другие возможности оборудования ещё не проверяются. Отсутствие backend не означает отсутствие устройства."; color: Theme.outline; wrapMode: Text.Wrap }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Services.Pipewire
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: page
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
ColumnLayout {
|
||||
width: page.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Звук"; font.pixelSize: 24; color: Theme.primary }
|
||||
Label {
|
||||
visible: !Hardware.audioReady
|
||||
text: "Аудиосервис недоступен. Проверьте PipeWire и WirePlumber."
|
||||
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground
|
||||
}
|
||||
Repeater {
|
||||
model: [{title: "Вывод", nodes: Hardware.outputs, selected: Hardware.sink, sink: true},
|
||||
{title: "Ввод", nodes: Hardware.inputs, selected: Hardware.source, sink: false}]
|
||||
ColumnLayout {
|
||||
id: group
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: group.modelData.title; font.pixelSize: 20; color: Theme.foreground }
|
||||
Label { visible: group.modelData.nodes.length === 0; text: "Нет доступных устройств"; color: Theme.outline }
|
||||
Repeater {
|
||||
model: group.modelData.nodes
|
||||
ColumnLayout {
|
||||
id: device
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
ActionButton {
|
||||
Layout.fillWidth: true
|
||||
text: (group.modelData.selected === device.modelData ? "✓ " : "") + (device.modelData.description || device.modelData.name)
|
||||
checked: group.modelData.selected === device.modelData
|
||||
enabled: device.modelData.ready
|
||||
onClicked: {
|
||||
if (group.modelData.sink) Pipewire.preferredDefaultAudioSink = device.modelData;
|
||||
else Pipewire.preferredDefaultAudioSource = device.modelData;
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
enabled: device.modelData.ready && device.modelData.audio !== null
|
||||
ActionButton {
|
||||
text: device.modelData.audio?.muted ? "Включить" : "Заглушить"
|
||||
onClicked: device.modelData.audio.muted = !device.modelData.audio.muted
|
||||
}
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 0; to: 1
|
||||
value: device.modelData.audio?.volume || 0
|
||||
onMoved: device.modelData.audio.volume = value
|
||||
Accessible.name: group.modelData.title + ": громкость " + device.modelData.description
|
||||
}
|
||||
Label { text: Math.round((device.modelData.audio?.volume || 0) * 100) + "%"; color: Theme.foreground; Layout.preferredWidth: 48 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# Исправление загрузки BrightnessController
|
||||
|
||||
Ошибка `BrightnessController is not a type` вызвана отсутствием регистрации компонента в `services/qmldir`. Добавлена строка `BrightnessController 1.0 BrightnessController.qml`.
|
||||
|
||||
Перезапустите `./hypr/bin/adaptive-shell start`. Если появится следующая ошибка, приложите новый журнал: она может относиться к иной QML-зависимости.
|
||||
@@ -0,0 +1,138 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Services.SystemTray
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
PanelWindow {
|
||||
id: bar
|
||||
signal navigate(string name)
|
||||
readonly property string mode: Preferences.modeFor(screen)
|
||||
anchors { top: true; left: true; right: true }
|
||||
implicitHeight: mode === "desktop" ? 56 : 52
|
||||
color: Theme.surfaceLow
|
||||
WlrLayershell.namespace: "adaptive-bar"
|
||||
SystemClock { id: clock; precision: SystemClock.Minutes }
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 8
|
||||
anchors.rightMargin: 8
|
||||
spacing: 4
|
||||
ActionButton { text: bar.mode === "phone" ? "☰" : "◈ Приложения"; onClicked: bar.navigate("launcher") }
|
||||
Repeater {
|
||||
model: bar.mode === "desktop" ? Hyprland.workspaces : null
|
||||
ActionButton {
|
||||
required property var modelData
|
||||
visible: modelData.id > 0 && (!modelData.monitor || modelData.monitor.name === bar.screen.name)
|
||||
text: modelData.name
|
||||
checked: modelData.active
|
||||
onClicked: modelData.activate()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
visible: bar.mode === "desktop"
|
||||
text: Hyprland.activeToplevel?.title || ""
|
||||
color: Theme.foreground
|
||||
elide: Text.ElideRight
|
||||
textFormat: Text.PlainText
|
||||
}
|
||||
Item { Layout.fillWidth: true; visible: bar.mode !== "desktop" }
|
||||
Repeater {
|
||||
model: bar.mode === "desktop" ? SystemTray.items : null
|
||||
ActionButton {
|
||||
required property var modelData
|
||||
implicitWidth: 48
|
||||
text: ""
|
||||
Image { anchors.centerIn: parent; width: 24; height: 24; source: modelData.icon }
|
||||
onClicked: modelData.onlyMenu ? modelData.display(bar, 0, bar.height) : modelData.activate()
|
||||
onPressAndHold: modelData.display(bar, 0, bar.height)
|
||||
}
|
||||
}
|
||||
// One unified status surface, not a pill containing multiple pill buttons.
|
||||
// The previous nested ActionButtons caused overlapping circles at small widths.
|
||||
Rectangle {
|
||||
id: statusSurface
|
||||
visible: bar.mode === "desktop"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: 38
|
||||
Layout.preferredWidth: statusContent.implicitWidth + 24
|
||||
radius: 19
|
||||
color: statusMouse.containsMouse ? Theme.surfaceHigh : Theme.surface
|
||||
border.width: 1
|
||||
border.color: Theme.outline
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.duration } }
|
||||
RowLayout {
|
||||
id: statusContent
|
||||
anchors.centerIn: parent
|
||||
spacing: 10
|
||||
Text {
|
||||
visible: Hardware.wiredPresent || Hardware.wifiPresent
|
||||
text: Hardware.wiredPresent ? "⇄" : "◉"
|
||||
font.pixelSize: 16
|
||||
color: Theme.foreground
|
||||
Accessible.name: Hardware.wiredPresent ? Hardware.ethernetSummary : "Wi-Fi"
|
||||
}
|
||||
Text {
|
||||
visible: Hardware.sink !== null
|
||||
text: Hardware.sink?.audio?.muted ? "◌" : "♫"
|
||||
font.pixelSize: 15
|
||||
color: Theme.foreground
|
||||
}
|
||||
Repeater {
|
||||
model: Hardware.batteries
|
||||
Text {
|
||||
required property var modelData
|
||||
text: Math.round(modelData.percentage * 100) + "%"
|
||||
color: Theme.foreground
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
visible: Hardware.wiredPresent || Hardware.wifiPresent || Hardware.sink !== null || Hardware.batteries.length > 0
|
||||
width: 1
|
||||
height: 18
|
||||
color: Theme.outline
|
||||
opacity: 0.45
|
||||
}
|
||||
Text {
|
||||
text: Qt.formatDateTime(clock.date, "HH:mm")
|
||||
color: Theme.foreground
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: statusMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: bar.navigate("quick")
|
||||
}
|
||||
}
|
||||
ActionButton {
|
||||
visible: bar.mode !== "desktop" && (Hardware.wiredPresent || Hardware.wifiPresent)
|
||||
text: "◉"
|
||||
onClicked: bar.navigate("quick")
|
||||
}
|
||||
ActionButton {
|
||||
visible: bar.mode !== "desktop"
|
||||
text: Qt.formatDateTime(clock.date, "HH:mm")
|
||||
onClicked: bar.navigate("quick")
|
||||
}
|
||||
ActionButton {
|
||||
implicitWidth: 42
|
||||
implicitHeight: 38
|
||||
text: Notifications.items.length > 0 ? "● " + Notifications.items.length : "◌"
|
||||
Accessible.name: "Уведомления"
|
||||
onClicked: bar.navigate("notifications")
|
||||
}
|
||||
ActionButton { visible: bar.mode === "desktop"; implicitWidth: 42; implicitHeight: 38; text: "⚙"; Accessible.name: "Настройки"; onClicked: bar.navigate("settings") }
|
||||
ActionButton { visible: bar.mode === "desktop"; implicitWidth: 42; implicitHeight: 38; text: "⏻"; Accessible.name: "Питание"; onClicked: bar.navigate("power") }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
BrightnessController { id: brightness }
|
||||
ColumnLayout {
|
||||
width: root.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Батарея и питание"; font.pixelSize: 24; font.bold: true; color: Theme.primary }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Данные поступают от UPower. На устройствах без аккумулятора раздел скрыт."
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Label { text: "Яркость экрана"; font.bold: true; color: Theme.foreground }
|
||||
Label { text: "Управление подсветкой через brightnessctl"; color: Theme.outline }
|
||||
Repeater {
|
||||
model: brightness.devices
|
||||
ColumnLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: modelData.name + " · " + modelData.percent + "%"; color: Theme.foreground }
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 1; to: 100; stepSize: 1
|
||||
value: modelData.percent
|
||||
enabled: !brightness.busy
|
||||
onMoved: brightness.setBrightness(modelData.name, Math.round(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
Label { visible: brightness.devices.length === 0; text: "Подсветка не обнаружена"; color: Theme.outline }
|
||||
Label { visible: brightness.error !== ""; text: brightness.error; wrapMode: Text.Wrap; color: "#d04040" }
|
||||
Repeater {
|
||||
model: Hardware.batteries
|
||||
ColumnLayout {
|
||||
id: batteryCard
|
||||
required property var modelData
|
||||
required property int index
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
Label { text: "Аккумулятор " + (index + 1); font.bold: true; color: Theme.foreground }
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
text: Math.round(batteryCard.modelData.percentage * 100) + "%"
|
||||
font.pixelSize: 22
|
||||
font.bold: true
|
||||
color: Theme.primary
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
}
|
||||
ProgressBar {
|
||||
Layout.fillWidth: true
|
||||
from: 0
|
||||
to: 1
|
||||
value: Math.max(0, Math.min(1, batteryCard.modelData.percentage || 0))
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Уровень заряда обновляется автоматически при изменении состояния устройства."
|
||||
color: Theme.outline
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: Hardware.batteries.length === 0
|
||||
text: "Аккумулятор не обнаружен."
|
||||
color: Theme.outline
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: page
|
||||
property bool active: false
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
BluetoothController { id: backend }
|
||||
onActiveChanged: if (active) backend.refresh()
|
||||
ColumnLayout {
|
||||
width: page.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Bluetooth"; font.pixelSize: 24; color: Theme.primary }
|
||||
Label {
|
||||
visible: Hardware.bluetoothAdapters.length === 0
|
||||
text: backend.readiness === "unavailable" ? "Сервис Bluetooth недоступен" : backend.readiness === "ready" && backend.adapterCount === 0 ? "Bluetooth-адаптеры не обнаружены" : "Ожидание списка адаптеров…"
|
||||
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground
|
||||
}
|
||||
Label { visible: backend.error !== ""; text: backend.error; Layout.fillWidth: true; wrapMode: Text.Wrap; textFormat: Text.PlainText; color: "#ffb4ab" }
|
||||
BusyIndicator { visible: backend.busy; running: visible }
|
||||
Repeater {
|
||||
model: Hardware.bluetoothAdapters
|
||||
Rectangle {
|
||||
id: adapterCard
|
||||
required property var modelData
|
||||
property bool confirmPowerOff: false
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: adapterContent.implicitHeight + 32
|
||||
color: Theme.surface; radius: 20
|
||||
BluetoothDiscovery { id: discovery; adapter: adapterCard.modelData; active: page.active }
|
||||
Connections { target: page; function onActiveChanged() { if (!page.active) adapterCard.confirmPowerOff = false; } }
|
||||
ColumnLayout {
|
||||
id: adapterContent
|
||||
anchors { top: parent.top; left: parent.left; right: parent.right; margins: 16 }
|
||||
spacing: 12
|
||||
Label { text: adapterCard.modelData?.name || "Bluetooth"; font.pixelSize: 20; color: Theme.primary; textFormat: Text.PlainText }
|
||||
Label { text: adapterCard.modelData ? BluetoothAdapterState.toString(adapterCard.modelData.state) : ""; color: Theme.foreground }
|
||||
ActionButton {
|
||||
text: adapterCard.modelData?.enabled ? "Выключить Bluetooth…" : "Включить Bluetooth"
|
||||
enabled: !!adapterCard.modelData && adapterCard.modelData.state !== BluetoothAdapterState.Blocked && !backend.busy
|
||||
onClicked: {
|
||||
if (adapterCard.modelData.enabled) adapterCard.confirmPowerOff = true;
|
||||
else backend.start("power-on", adapterCard.modelData.dbusPath);
|
||||
}
|
||||
}
|
||||
Label { visible: adapterCard.confirmPowerOff; text: "Выключить адаптер? Его текущие соединения будут прерваны."; Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground }
|
||||
RowLayout {
|
||||
visible: adapterCard.confirmPowerOff
|
||||
ActionButton { text: "Выключить"; enabled: !backend.busy; onClicked: { discovery.stop(); adapterCard.confirmPowerOff = false; backend.start("power-off", adapterCard.modelData.dbusPath); } }
|
||||
ActionButton { text: "Отмена"; onClicked: adapterCard.confirmPowerOff = false }
|
||||
}
|
||||
ActionButton {
|
||||
text: discovery.stopping ? "Остановка поиска…" : discovery.starting ? "Начало поиска…" : discovery.owned ? "Остановить поиск" : adapterCard.modelData?.discovering ? "Поиск уже выполняется" : "Найти устройства"
|
||||
enabled: adapterCard.modelData?.enabled === true && !backend.busy && !discovery.starting && !discovery.stopping && (discovery.owned || !adapterCard.modelData.discovering)
|
||||
onClicked: discovery.owned ? discovery.stop() : discovery.start()
|
||||
}
|
||||
Label { visible: discovery.error !== ""; text: discovery.error; wrapMode: Text.Wrap; Layout.fillWidth: true; color: "#ffb4ab" }
|
||||
Repeater {
|
||||
model: adapterCard.modelData?.devices || []
|
||||
ColumnLayout {
|
||||
id: deviceCard
|
||||
required property var modelData
|
||||
property string confirmation: ""
|
||||
Layout.fillWidth: true
|
||||
Label { text: (deviceCard.modelData?.name || deviceCard.modelData?.address || "Устройство") + (deviceCard.modelData?.paired ? " · Сопряжено" : ""); color: Theme.foreground; textFormat: Text.PlainText; Layout.fillWidth: true; wrapMode: Text.Wrap }
|
||||
Label { text: deviceCard.modelData ? BluetoothDeviceState.toString(deviceCard.modelData.state) : ""; color: Theme.outline }
|
||||
Label { visible: deviceCard.modelData?.blocked === true; text: "Устройство заблокировано"; color: Theme.outline }
|
||||
ActionButton {
|
||||
visible: deviceCard.modelData?.paired === true
|
||||
text: deviceCard.modelData?.connected ? "Отключить…" : "Подключить"
|
||||
enabled: adapterCard.modelData?.enabled === true && deviceCard.modelData?.blocked === false && !backend.busy
|
||||
onClicked: {
|
||||
if (deviceCard.modelData.connected) deviceCard.confirmation = "disconnect";
|
||||
else backend.start("connect", deviceCard.modelData.dbusPath);
|
||||
}
|
||||
}
|
||||
ActionButton { visible: deviceCard.modelData?.paired === true; text: "Забыть устройство…"; enabled: !backend.busy; onClicked: deviceCard.confirmation = "forget" }
|
||||
Label { visible: deviceCard.confirmation !== ""; text: deviceCard.confirmation === "forget" ? "Удалить сопряжение? Для следующего подключения понадобится сопряжение заново." : "Отключить устройство?"; color: Theme.foreground; Layout.fillWidth: true; wrapMode: Text.Wrap }
|
||||
RowLayout {
|
||||
visible: deviceCard.confirmation !== ""
|
||||
ActionButton { text: "Подтвердить"; enabled: !backend.busy && !!deviceCard.modelData; onClicked: { backend.start(deviceCard.confirmation, deviceCard.modelData.dbusPath); deviceCard.confirmation = ""; } }
|
||||
ActionButton { text: "Отмена"; onClicked: deviceCard.confirmation = "" }
|
||||
}
|
||||
Connections { target: page; function onActiveChanged() { if (!page.active) deviceCard.confirmation = ""; } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ActionButton { text: "Сопряжение через системный диалог…"; visible: Hardware.bluetoothAdapters.length > 0; onClicked: Quickshell.execDetached(["blueman-manager"]) }
|
||||
ActionButton { text: "Обновить доступность Bluetooth"; enabled: !backend.busy; onClicked: backend.refresh() }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
# Продолжение разработки (17 ноября 2026)
|
||||
|
||||
## Реализовано в этом изменении
|
||||
|
||||
- Добавлена чистая модель `services/HardwarePolicy.js` для различения отсутствующих и отключённых сетевых устройств.
|
||||
- В `Hardware.qml` добавлены реактивные свойства `wiredDevices`, `wiredPresent`, `ethernetSummary`.
|
||||
- `QuickSettings.qml` показывает отдельные плитки каждого обнаруженного Ethernet-интерфейса; Wi-Fi остаётся скрытым при отсутствии адаптера.
|
||||
- `Bar.qml` отображает только доступные Ethernet/Wi-Fi индикаторы; проводные сети показывают количество подключённых интерфейсов.
|
||||
- Добавлены QML unit-тесты на Ethernet-only, несколько адаптеров, выключенный Wi-Fi и hotplug-пересчёт.
|
||||
|
||||
## Проверки
|
||||
|
||||
QML-тесты требуют Qt Test runner и Quickshell на целевой машине:
|
||||
|
||||
```sh
|
||||
cd ~/dotfiles/quickshell
|
||||
qmltestrunner -input tests/tst_hardware_policy.qml
|
||||
```
|
||||
|
||||
В этой среде `qmltestrunner` и `quickshell` отсутствуют, поэтому runtime-тесты не выполнены.
|
||||
|
||||
## Дальнейшая работа
|
||||
|
||||
- Добавить ModemManager capabilities и реальную мобильную сеть.
|
||||
- Подключить единый список доступных разделов в Settings (сейчас политика подготовлена, но список ещё статический).
|
||||
- Реализовать защищённый lock screen только после проверки `ext-session-lock-v1` и PAM; до этого оставить Hyprlock.
|
||||
- Проверить глобальные сенсорные жесты на реальном телефоне; UI-жесты сами по себе не обеспечивают compositor-level interception.
|
||||
- Измерить PSS/CPU и плавность на ARM64.
|
||||
|
||||
Существующие конфигурации Hyprland, hypridle и hyprlock не изменялись этим этапом.
|
||||
|
||||
## Следующий проверенный этап: адаптивная навигация Settings
|
||||
|
||||
- `Settings.qml`: вместо фиксированного списка разделов используется реактивная политика аппаратных возможностей; отсутствующие Wi-Fi/Bluetooth/аудио не создают неработающие разделы.
|
||||
- Навигация использует стабильные идентификаторы (`appearance`, `audio`, `network`, `wallpaper`, `bluetooth`), поэтому hotplug не перепутает страницы.
|
||||
- `SettingsWindow.qml` и `shell.qml` согласованы с новой адресацией, в том числе для прямых переходов из панели и быстрых настроек.
|
||||
- Добавлены QML-тесты и независимый Node.js-тест `node tests/hardware_policy_node.cjs`.
|
||||
- Локально пройдено 29 Python unit-тестов и тест JS-политики. QML runtime и реальное оборудование здесь недоступны.
|
||||
|
||||
### Ограничения текущей реализации
|
||||
|
||||
Это не завершение всего проекта: требуется полноценная проверка в Hyprland/Quickshell, реализация ModemManager, надёжных глобальных жестов, полного приложения системных настроек и защищённой замены Hyprlock. **Hyprlock и hypridle оставлены без изменений.**
|
||||
@@ -0,0 +1,11 @@
|
||||
# Mobile data / APN stage
|
||||
|
||||
Added a constrained NetworkManager GSM profile backend (`backend/mobile_connections.py`), a singleton (`services/MobileConnections.qml`) and a profile editor in `ModemSettings.qml`.
|
||||
|
||||
Capabilities: create a GSM profile with a validated APN and name, list GSM/CDMA profiles, activate/deactivate a profile by UUID, and delete it after confirmation. Operations are restricted to mobile profiles; no arbitrary shell execution or PIN/PUK storage. NetworkManager/Polkit determines authorization. `nmcli` and NetworkManager must be installed.
|
||||
|
||||
Tests: `cd quickshell && python -m unittest discover -s tests -p 'test_*.py' -v`.
|
||||
|
||||
On the target system, check `nmcli -g UUID,TYPE,NAME connection show` and the mobile Settings page. Test activation with an actual SIM only after configuring your operator's APN. ModemManager and NetworkManager integration, Qt QML runtime, modem hotplug and user-visible auth prompts require testing on the device. A valid APN alone does not guarantee cellular connectivity.
|
||||
|
||||
Not yet implemented: SIM PIN/PUK management, multi-SIM selection, roaming policy, cellular usage metering, global compositor gestures, and secure Quickshell session lock/fprintd. Keep hyprlock enabled until the replacement is security-audited.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Battery settings stage
|
||||
|
||||
Added `BatterySettings.qml` using existing Quickshell UPower hardware discovery. The Battery and Power page appears only when `Hardware.batteries` is nonempty. Battery level is read-only; no privileged or potentially disruptive power operations are performed. The page has a fixed StackLayout index (7) so hotplug cannot redirect navigation to another page.
|
||||
|
||||
## Validation
|
||||
|
||||
Run `python3 -m unittest discover -s quickshell/tests -p "test_*.py"` and `node quickshell/tests/hardware_policy_node.cjs`. On an actual phone or laptop verify battery percentage, charging state updates, and that the page disappears when no battery is present. Note that a QML runtime test was not possible in the build container.
|
||||
|
||||
## Remaining
|
||||
|
||||
System power profiles, suspend policies, global gestures, SIM PIN/PUK and secure session locking/fingerprint authentication still require implementation and hardware validation. Keep hyprlock enabled.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Brightness stage
|
||||
|
||||
Added `backend/brightness.py`, `services/BrightnessController.qml` and backlight sliders to `BatterySettings.qml`.
|
||||
|
||||
Requires `brightnessctl` and permission to change `/sys/class/backlight` (typically udev/logind ACL or a suitable group). No sudo or shell invocation is used. Only devices reported as `backlight` by brightnessctl are offered; brightness is clamped to 1–100% to avoid an accidentally black display. Backend validates device identifiers and current enumerated devices before writes. Hardware changes refresh every 10 seconds. Multiple backlights are displayed separately.
|
||||
|
||||
Known limitations: power settings remain hidden on desktops without a battery, so this brightness UI is not accessible there; backlight controls do not apply to external DDC/CI monitors. QML was not runtime-tested in Hyprland. Test with `brightnessctl -m -l`, adjust slider, verify with `brightnessctl -m -l` and restore original brightness. Hyprlock/hypridle unchanged.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Desktop shelf — next stage
|
||||
|
||||
Added `DesktopShelf.qml`, a desktop-only floating bottom shelf inspired by ChromeOS/Material 3 Expressive. It shows an app launcher, live Wayland toplevel buttons (activate on click), and an overview entry. It is instantiated per screen in `shell.qml` and hidden in tablet/phone mode. Existing top bar, notifications, quick settings, and Hyprlock remain unchanged.
|
||||
|
||||
Test on desktop: start adaptive-shell; check bottom shelf; open two windows; click their shelf entries; click launcher and overview. Switch output to tablet/phone mode and verify shelf is hidden. Verify multi-monitor behavior.
|
||||
|
||||
Limitations: labels are text (not application icons); shelf has no pinned apps or task grouping, and QML runtime was not available in the build environment. On narrow desktops many windows may overflow; no auto-hide yet.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Desktop Launcher · Material 3 Expressive
|
||||
|
||||
- Desktop launcher widened to 580 px, keeping the existing left/top alignment.
|
||||
- Added All, Favorites and Recent chips, app counts, selected tonal tile backgrounds and hover affordances.
|
||||
- Existing application execution, keyboard navigation, favorites, search and phone/tablet views remain.
|
||||
- No bottom dock; no change to Hyprlock or Hypridle.
|
||||
|
||||
## Test
|
||||
|
||||
Run `./hypr/bin/adaptive-shell start` in Hyprland. Open the launcher from the top bar, filter by category, type a query, launch an app and pin/unpin favorites. Verify the phone/tablet launcher still works.
|
||||
|
||||
QML runtime validation was unavailable in the build environment.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Desktop without dock
|
||||
|
||||
- Removed `DesktopShelf` entirely and its `Variants` instantiation.
|
||||
- The existing top bar remains the sole desktop navigation surface.
|
||||
- Desktop system indicators are grouped in a tonal capsule: wired/Wi-Fi, audio, battery and time; clicking opens Quickshell quick settings.
|
||||
- Notification count opens the Quickshell notification center.
|
||||
- The desktop launcher is anchored near the upper-left, while quick settings and notifications remain near the upper-right.
|
||||
- Phone/tablet layout retains its prior navigation controls.
|
||||
- No changes to Hyprland, hypridle or hyprlock.
|
||||
|
||||
## Verification
|
||||
Run `./hypr/bin/adaptive-shell start` and verify desktop launcher, notifications, quick settings, settings and power buttons. Verify no bottom shelf appears. QML runtime validation must be performed on a machine with Quickshell and Hyprland.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Desktop status bar polish
|
||||
|
||||
- Replaced nested pill-shaped ActionButtons in the desktop status area with a single compact surface and text/icons.
|
||||
- Removed overlapping inner backgrounds, reduced height to 38px and spaced network, sound, battery and time consistently.
|
||||
- Unified hover and click target for Quick Settings.
|
||||
- Kept the desktop free of a bottom dock; phone/tablet behavior unchanged.
|
||||
- No changes to hyprlock, hypridle or Hyprland configuration.
|
||||
|
||||
## Manual checks
|
||||
|
||||
1. Launch `./hypr/bin/adaptive-shell start`.
|
||||
2. Confirm the right-hand cluster has a single rounded outline, without overlapping circles.
|
||||
3. Click anywhere in the cluster and confirm Quick Settings opens.
|
||||
4. Test network, audio and battery presence/absence, and narrow desktop outputs.
|
||||
|
||||
QML runtime validation requires the user's Hyprland session.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Desktop Material 3 Expressive quick settings
|
||||
|
||||
Desktop Quick Settings now uses `DesktopQuickSettings.qml`, a compact dashboard with two-column tonal tiles, brightness and volume controls, and links to existing settings. Phone and tablet still use the original `QuickSettings.qml`. No dock has been added.
|
||||
|
||||
Test on desktop: open the system area; verify Wi-Fi/Bluetooth toggles, brightness, volume and navigation. Test tablet/phone separately to ensure original layout remains. Brightness depends on `brightnessctl` and available backlight devices.
|
||||
|
||||
Known limits: controls for Cast, Quick Share, auto-rotate and camera privacy are intentionally not fabricated; these require actual system backends. QML runtime validation requires Quickshell/Hyprland on target hardware.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Display Settings stage
|
||||
|
||||
- Added an always-accessible Display and brightness section on desktop, tablet and phone, including machines without batteries.
|
||||
- Moved the existing brightnessctl UI out of BatterySettings to avoid duplication.
|
||||
- Preserved battery/UPower functionality and all existing page indices; new page index is 8.
|
||||
- DDC/CI, display modes, scale and orientation are not implemented in this stage.
|
||||
- Verify by opening Settings → Дисплей и яркость, checking brightnessctl, and verifying battery section only appears when UPower reports a battery.
|
||||
- Existing hyprlock/hypridle are unchanged.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Продолжение: мобильная навигация и Recent Apps
|
||||
|
||||
- Горизонтальный свайп **по нижней навигационной полоске** переключает окна через `ToplevelManager`.
|
||||
- Вертикальный свайп по карточке Recent Apps вверх запрашивает закрытие окна.
|
||||
- Логика выбора окна и порога закрытия вынесена в `services/WindowPolicy.js` и проверяется Node.js.
|
||||
- **Ограничение:** свайпы работают на соответствующих поверхностях Quickshell; глобальные свайпы поверх сторонних приложений требуют интеграции с Hyprland/композитором.
|
||||
- `lastCycledWindow` отслеживает индекс только для последовательных переключений. Если список окон изменился, последовательность может начать с другого окна.
|
||||
- `Hyprlock` и `Hypridle` не изменены.
|
||||
|
||||
## Проверка на устройстве
|
||||
|
||||
1. Откройте минимум три приложения, выполните горизонтальный свайп по нижней полоске в обе стороны.
|
||||
2. Откройте Recent Apps и свайпните карточку вверх; убедитесь, что закрыто только нужное окно.
|
||||
3. Проверьте на реальном touchscreen: касания кнопок «Открыть» и «Закрыть» не должны перехватываться DragHandler.
|
||||
4. Проверьте вертикальный свайп снизу: короткий — Home, с удержанием — Recent Apps.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Продолжение: домашний экран и многозадачность
|
||||
|
||||
## Изменения
|
||||
- `Home.qml`: страницы избранных приложений (12 плиток в узком режиме, 24 в широком), переход между страницами, режим редактирования, перестановка закреплённых приложений и удаление из избранного. Долгое нажатие включает редактирование; также есть кнопка «Изменить». Список и порядок сохраняются в существующем `Preferences.data.favorites`.
|
||||
- `services/Policy.js`: чистые функции `moveFavorite` и `homePages`, не зависящие от Quickshell.
|
||||
- `services/Preferences.qml`: `moveFavorite` через существующий атомарно сохраняемый файл настроек.
|
||||
- `Recent.qml`: карточки окон с заголовком, appId, поиском, активацией и закрытием через ToplevelManager.
|
||||
- `tests/home_policy_node.cjs`: тесты страниц и перестановки.
|
||||
|
||||
## Проверено в среде разработки
|
||||
- Node.js: home policy и hardware policy — PASS.
|
||||
- Python unittest: 33 теста — PASS.
|
||||
- QML/Wayland: не запускались, Quickshell отсутствует в окружении.
|
||||
|
||||
## Ограничения
|
||||
- Это НЕ полноценные глобальные жесты: `MobileNavigation.qml` всё ещё получает только события в своей панели. Для глобальных жестов требуется интеграция с Hyprland/compositor.
|
||||
- Recent Apps пока показывает карточки без живых превью, использует ToplevelManager; swipe-to-close ещё не реализован.
|
||||
- Home Screen пока не поддерживает папки, drag-and-drop и виджеты. Избранное управляется из Launcher.
|
||||
- Не менялись Hyprlock, Hypridle, PAM и запуск из TTY. Экран блокировки на Quickshell не реализован.
|
||||
|
||||
## Проверка на машине пользователя
|
||||
```
|
||||
node ~/.config/quickshell/tests/home_policy_node.cjs
|
||||
node ~/.config/quickshell/tests/hardware_policy_node.cjs
|
||||
python -m unittest discover -s ~/.config/quickshell/tests -p 'test_*.py' -q
|
||||
```
|
||||
Откройте Home, закрепите несколько приложений звёздочкой в Launcher, переключите страницы, переставьте плитки в режиме редактирования. Откройте Recent и проверьте поиск, активацию и закрытие окон.
|
||||
@@ -0,0 +1,21 @@
|
||||
# ModemManager control stage
|
||||
|
||||
- Added `backend/modem_control.py`, a strict allowlist of `enable` and `disable` operations using `mmcli` argument vectors (no shell interpolation).
|
||||
- Added a Modems service action state and refreshed modem inventory after each operation.
|
||||
- Added enable/disable buttons and a confirmation dialog before disabling a modem.
|
||||
- Added backend unit tests for argument validation and command construction.
|
||||
|
||||
## Safety and limits
|
||||
|
||||
- ModemManager/polkit performs authorization; this code does not bypass it.
|
||||
- Disabling a modem can terminate mobile connectivity.
|
||||
- SIM PIN/PUK, APN, and connection management are **not** implemented.
|
||||
- Hyprlock and hypridle are unchanged. This is not a secure Quickshell lock screen.
|
||||
- The QML UI has not been run in a Hyprland session in this environment.
|
||||
|
||||
## User verification
|
||||
|
||||
1. On a phone with ModemManager, open Settings → Mobile network and SIM.
|
||||
2. Confirm the modem ID, state and signal. Test enable and disable only when loss of mobile connectivity is acceptable.
|
||||
3. Verify the confirmation dialog cancels correctly and errors are visible.
|
||||
4. On desktop without modem, verify the mobile settings section stays hidden.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Мониторы Hyprland
|
||||
|
||||
Добавлен безопасный read-only backend `backend/displays.py`, контроллер `services/DisplayController.qml` и карточки мониторов в `DisplaySettings.qml`.
|
||||
|
||||
Показываются имя, описание, разрешение, частота, масштаб, позиция, ориентация и активный монитор. Состояние обновляется каждые пять секунд; подключение/отключение монитора отражается автоматически. Backend не меняет конфигурацию мониторов.
|
||||
|
||||
Тесты: `cd quickshell && python -m unittest discover -s tests -p 'test_*.py' -q` (52 passed).
|
||||
|
||||
Проверить на компьютере: `hyprctl -j monitors all`, открыть Settings → Дисплей и яркость, сравнить значения; подключить внешний монитор и проверить обновление. На телефоне проверить в nested Hyprland/Quickshell и на устройстве. Тесты QML на настоящем compositor здесь не выполнялись.
|
||||
|
||||
Следующий этап: изменение разрешения/масштаба с безопасным откатом и подтверждением, глобальные жесты, SIM PIN/PUK, безопасный session lock.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Monitor preview with automatic rollback
|
||||
|
||||
Settings → Дисплей и яркость now offers mode and scale choices sourced from Hyprland. Preview uses `hyprctl keyword monitor` and starts a detached 20-second rollback watcher. Confirm within 20 seconds or the previous monitor rule is restored. Changes are session-only; `hypr/monitors.lua` and `hypr/monitors.conf` are untouched.
|
||||
|
||||
**Limitations:** the preview currently restores resolution, refresh rate, scale, and position, but not all advanced monitor properties (e.g. transform, VRR, bit depth). Avoid using the preview on rotated displays until the rollback path supports those properties. A compositor crash or process termination can defeat rollback. External testing is required. Changing a mode may cause the UI to move to another monitor. If that happens, wait 20 seconds. The mode selector is populated from Hyprland `availableModes`.
|
||||
|
||||
Tests: `cd quickshell && python3 -m unittest discover -s tests -p 'test_*.py' -q`.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Display positioning stage
|
||||
|
||||
- Settings → Дисплей и яркость: X/Y position controls for each output.
|
||||
- Coordinates are passed as separate arguments (no shell interpolation), validated in the backend.
|
||||
- Existing 20-second confirmation and rollback include original X/Y and transform.
|
||||
- Changes are session-only; persistent Hyprland monitor rules are not edited.
|
||||
- Test negative coordinates carefully on multi-monitor setups. Do not reposition the only monitor without an available recovery path.
|
||||
- Existing limitation: rollback watcher relies on a running Hyprland session; multi-monitor topology changes during the countdown are not handled transactionally.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Этап: профили энергопотребления
|
||||
|
||||
Добавлен backend `backend/power_profiles.py`, сервис `services/PowerProfiles.qml` и кнопки в `BatterySettings.qml`.
|
||||
|
||||
Требуется `powerprofilesctl` и работающий системный сервис, предоставляющий профили питания. Доступность `performance` зависит от оборудования и драйверов. Если команда не установлена или профиль не поддерживается, интерфейс покажет ошибку; для применения могут потребоваться системные разрешения. Команды запускаются без shell и только с разрешёнными значениями.
|
||||
|
||||
Проверка: открыть Settings → Батарея и питание; выбрать «Экономия», «Баланс» или «Производительность»; проверить `powerprofilesctl get`. На устройствах без аккумулятора раздел пока скрыт — даже если профили питания поддерживаются. Это ограничение предстоит исправить.
|
||||
|
||||
Python unit tests: `python -m pytest -q tests` (47 passed в среде разработки). QML/Hyprland не запускались. Hyprlock и hypridle не изменены.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Quick Settings: hardware-aware brightness
|
||||
|
||||
The Quickshell Quick Settings shade now includes one brightness slider per backlight exposed by `brightnessctl`. The controls disappear on systems without a supported backlight. Changes are applied on pointer release, not continuously, to avoid spawning many subprocesses. The existing Display Settings page remains the full-featured view.
|
||||
|
||||
## Verify
|
||||
|
||||
1. Open Quick Settings on the phone/laptop; compare brightness with `brightnessctl -m -l`.
|
||||
2. Drag a slider and release; confirm brightness changes once.
|
||||
3. On a desktop with no `/sys/class/backlight` device, no brightness control should appear.
|
||||
4. Click Display Settings and confirm navigation.
|
||||
5. Check that audio, Wi-Fi, Ethernet, Bluetooth, modem and notifications still work.
|
||||
|
||||
Note: powerprofilesctl support is **not present** in this archive's BatterySettings.qml, despite an earlier development-stage claim. It has not been represented as implemented here. Hyprlock and hypridle remain unchanged.
|
||||
|
||||
Restored DisplaySettings integration: registered the three QML controllers in qmldir, added a stable `display` settings section/page, and enabled routing from Quick Settings.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Desktop Quick Settings — layout correction
|
||||
|
||||
The Desktop-only panel is now a compact, consistently spaced Material 3 dashboard:
|
||||
- One header, not duplicated by Overlay.
|
||||
- 48 px pill sliders for supported backlight and PipeWire audio.
|
||||
- 2-column, 46 px tonal tiles with consistent icon and label alignment.
|
||||
- Hardware-aware Wi-Fi and Bluetooth visibility.
|
||||
- Panel reduced to 420 px high on desktop; internal scrolling remains available.
|
||||
- All buttons use existing functional navigation/actions; no mock toggles.
|
||||
|
||||
Phone/tablet QuickSettings.qml is unchanged. Hyprlock, hypridle and Hyprland configuration are unchanged.
|
||||
|
||||
Run: ./hypr/bin/adaptive-shell start
|
||||
Check desktop right-side Quick Settings, both dark/light themes, no backlight, Wi-Fi absent, and Bluetooth absent.
|
||||
|
||||
QML runtime is unavailable in the build environment, so these changes have not been visually validated on a running compositor.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Desktop UI — Android/ChromeOS reference pass
|
||||
|
||||
- Desktop launcher is now a compact floating search-and-app grid, with 5-ish columns on typical widths and no bottom dock.
|
||||
- Desktop Quick Settings is a narrow top-right panel with a condensed header and connection controls.
|
||||
- Desktop overlays use a light dim rather than a heavy full-screen veil; mobile and tablet retain their previous full-screen behavior.
|
||||
- Existing hardware-bound controls (Wi-Fi, Bluetooth, brightness, volume, media, modem) remain functional.
|
||||
- Desktop screenshots supplied by the user are design references, not pixel-identical output.
|
||||
- Validate visually on Hyprland; no Quickshell runtime is available in the build environment.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Display orientation and rollback — 2026-11-17
|
||||
|
||||
- Settings → Display & Brightness: choose 0°, 90°, 180°, 270° alongside resolution and scale.
|
||||
- Backend `display_preview.py` accepts an optional transform (0–7), validates it, and preserves current monitor coordinates rather than using `auto`.
|
||||
- Rollback restores original resolution, refresh rate, position, scale **and transform**.
|
||||
- Existing 4-argument preview invocation remains supported.
|
||||
- No persistent Hyprland config changes. The 20-second watcher remains best-effort if the compositor/session crashes.
|
||||
- Test with `python3 -m unittest discover -s quickshell/tests -p 'test_*.py'` from dotfiles root.
|
||||
- Important: do not use rotation preview on the only display during critical work until tested on your machine. Hyprland transforms 4–7 (flipped variants) are preserved on rollback but not exposed in the UI.
|
||||
@@ -0,0 +1,5 @@
|
||||
# System information settings
|
||||
|
||||
Read-only system information page added to Material 3 Settings (desktop, tablet, phone). Shows OS, kernel, architecture, hostname, memory and uptime. Refreshes every 60 seconds, with manual refresh. Reads `/etc/os-release`, `/proc/meminfo`, `/proc/uptime` and Python platform. No privileged actions.
|
||||
|
||||
Tests: `python3 -m unittest discover -s tests -p 'test_*.py' -q` and `node tests/*node.cjs` individually. Quickshell runtime testing unavailable in build environment. Hyprlock/hypridle unchanged. Future work includes global gestures, secure session lock and SIM PIN/PUK.
|
||||
@@ -0,0 +1,197 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import "services"
|
||||
|
||||
// Compact ChromeOS/Android-inspired desktop dashboard. Real actions only.
|
||||
ScrollView {
|
||||
id: dashboard
|
||||
signal navigate(string name)
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
|
||||
BrightnessController { id: brightness }
|
||||
readonly property bool hasBacklight: brightness.devices.length > 0
|
||||
readonly property bool hasAudio: Hardware.sink !== null && Hardware.sink.audio !== null
|
||||
readonly property bool hasBluetooth: Hardware.bluetoothAdapters.length > 0
|
||||
|
||||
component Tile: Rectangle {
|
||||
id: tile
|
||||
property string title: ""
|
||||
property string symbol: ""
|
||||
property bool selected: false
|
||||
property bool usable: true
|
||||
signal activated()
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 46
|
||||
radius: 23
|
||||
color: selected ? Theme.primaryContainer : Theme.surfaceHigh
|
||||
opacity: usable ? 1 : 0.45
|
||||
Behavior on color { ColorAnimation { duration: Theme.duration } }
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 10
|
||||
spacing: 9
|
||||
Text {
|
||||
text: tile.symbol
|
||||
font.pixelSize: 16
|
||||
color: tile.selected ? Theme.onPrimaryContainer : Theme.foreground
|
||||
Layout.preferredWidth: 19
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
Text {
|
||||
text: tile.title
|
||||
font.pixelSize: 12
|
||||
font.weight: Font.DemiBold
|
||||
color: tile.selected ? Theme.onPrimaryContainer : Theme.foreground
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: tile.usable
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: tile.activated()
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
width: dashboard.availableWidth
|
||||
spacing: 10
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 36
|
||||
spacing: 8
|
||||
Text {
|
||||
text: "▦"
|
||||
color: Theme.primary
|
||||
font.pixelSize: 19
|
||||
}
|
||||
Text {
|
||||
text: "Быстрые настройки"
|
||||
color: Theme.foreground
|
||||
font.pixelSize: 16
|
||||
font.weight: Font.DemiBold
|
||||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
ToolButton {
|
||||
text: "⚙"
|
||||
Accessible.name: "Открыть настройки"
|
||||
onClicked: dashboard.navigate("settings")
|
||||
}
|
||||
}
|
||||
|
||||
// Material 3 Expressive pill-shaped sliders. Do not show unsupported hardware.
|
||||
Rectangle {
|
||||
visible: dashboard.hasBacklight
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: visible ? 48 : 0
|
||||
radius: 24
|
||||
color: Theme.secondaryContainer
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 14
|
||||
anchors.rightMargin: 12
|
||||
spacing: 8
|
||||
Text { text: "☀"; color: Theme.foreground; font.pixelSize: 18 }
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 1; to: 100; stepSize: 1
|
||||
value: dashboard.hasBacklight ? brightness.devices[0].percent : 50
|
||||
enabled: dashboard.hasBacklight && !brightness.busy
|
||||
Accessible.name: "Яркость"
|
||||
onPressedChanged: {
|
||||
if (!pressed && dashboard.hasBacklight)
|
||||
brightness.setBrightness(brightness.devices[0].name, Math.round(value))
|
||||
}
|
||||
}
|
||||
Text { text: dashboard.hasBacklight ? brightness.devices[0].percent + "%" : ""; color: Theme.foreground; font.pixelSize: 11 }
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
visible: dashboard.hasAudio
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: visible ? 48 : 0
|
||||
radius: 24
|
||||
color: Theme.surfaceHigh
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 12
|
||||
spacing: 8
|
||||
ToolButton {
|
||||
text: dashboard.hasAudio && Hardware.sink.audio.muted ? "♩" : "♫"
|
||||
Accessible.name: "Включить или выключить звук"
|
||||
onClicked: if (dashboard.hasAudio) Hardware.sink.audio.muted = !Hardware.sink.audio.muted
|
||||
}
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 0; to: 1
|
||||
value: dashboard.hasAudio ? Hardware.sink.audio.volume : 0
|
||||
enabled: dashboard.hasAudio
|
||||
Accessible.name: "Громкость"
|
||||
onMoved: if (dashboard.hasAudio) Hardware.sink.audio.volume = value
|
||||
}
|
||||
Text { text: dashboard.hasAudio ? Math.round(Hardware.sink.audio.volume * 100) + "%" : ""; color: Theme.foreground; font.pixelSize: 11 }
|
||||
}
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
columns: 2
|
||||
columnSpacing: 8
|
||||
rowSpacing: 8
|
||||
Tile {
|
||||
visible: Hardware.wifiPresent
|
||||
title: "Wi-Fi"; symbol: "◉"
|
||||
selected: Networking.wifiEnabled
|
||||
usable: Networking.wifiHardwareEnabled
|
||||
onActivated: Networking.wifiEnabled = !Networking.wifiEnabled
|
||||
}
|
||||
Tile {
|
||||
visible: dashboard.hasBluetooth
|
||||
title: "Bluetooth"; symbol: "ᛒ"
|
||||
selected: dashboard.hasBluetooth && Hardware.bluetoothAdapters[0].enabled
|
||||
onActivated: if (dashboard.hasBluetooth) Hardware.bluetoothAdapters[0].enabled = !Hardware.bluetoothAdapters[0].enabled
|
||||
}
|
||||
Tile {
|
||||
title: "Интернет"; symbol: "⌁"
|
||||
selected: Hardware.networkReady
|
||||
onActivated: dashboard.navigate("network")
|
||||
}
|
||||
Tile {
|
||||
title: "Звук"; symbol: "♫"
|
||||
selected: dashboard.hasAudio
|
||||
usable: dashboard.hasAudio
|
||||
onActivated: dashboard.navigate("audio")
|
||||
}
|
||||
Tile {
|
||||
title: "Уведомления"; symbol: "◌"
|
||||
onActivated: dashboard.navigate("notifications")
|
||||
}
|
||||
Tile {
|
||||
title: "Дисплей"; symbol: "▣"
|
||||
onActivated: dashboard.navigate("display")
|
||||
}
|
||||
}
|
||||
Text {
|
||||
visible: brightness.error !== ""
|
||||
Layout.fillWidth: true
|
||||
text: brightness.error
|
||||
color: Theme.foreground
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
// Desktop-only floating shelf. Window activation uses Wayland toplevel handles.
|
||||
PanelWindow {
|
||||
id: shelf
|
||||
signal navigate(string page)
|
||||
readonly property string mode: Preferences.modeFor(screen)
|
||||
visible: mode === "desktop"
|
||||
anchors { bottom: true; left: true; right: true }
|
||||
implicitHeight: 76
|
||||
color: "transparent"
|
||||
WlrLayershell.namespace: "adaptive-desktop-shelf"
|
||||
WlrLayershell.layer: WlrLayer.Top
|
||||
Rectangle {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 8
|
||||
width: Math.min(shelf.width - 24, Math.max(330, content.implicitWidth + 28))
|
||||
height: 60
|
||||
radius: 30
|
||||
color: Theme.surface
|
||||
border.color: Theme.outline
|
||||
border.width: 1
|
||||
RowLayout {
|
||||
id: content
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
ActionButton { text: "◈"; ToolTip.text: "Все приложения"; ToolTip.visible: hovered; onClicked: shelf.navigate("launcher") }
|
||||
Rectangle { width: 1; height: 28; color: Theme.outline; opacity: 0.5 }
|
||||
Repeater {
|
||||
model: ToplevelManager.toplevels.values
|
||||
ActionButton {
|
||||
required property var modelData
|
||||
readonly property var window: modelData
|
||||
text: window.appId ? window.appId.split(".").pop().slice(0, 14) : "Окно"
|
||||
ToolTip.text: window.title || window.appId || "Приложение"
|
||||
ToolTip.visible: hovered
|
||||
onClicked: window.activate()
|
||||
}
|
||||
}
|
||||
Rectangle { width: 1; height: 28; color: Theme.outline; opacity: 0.5 }
|
||||
ActionButton { text: "▣"; ToolTip.text: "Обзор окон"; ToolTip.visible: hovered; onClicked: shelf.navigate("recent") }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
BrightnessController { id: brightness }
|
||||
DisplayController { id: displays }
|
||||
DisplayPreview { id: preview }
|
||||
ColumnLayout {
|
||||
width: root.availableWidth
|
||||
spacing: 16
|
||||
Label { text: "Дисплей и яркость"; font.pixelSize: 24; font.bold: true; color: Theme.primary }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Управление подсветкой встроенных дисплеев через brightnessctl. Внешние мониторы DDC/CI пока не поддерживаются."
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Label { text: "Подключённые мониторы"; font.pixelSize: 20; font.bold: true; color: Theme.foreground }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Изменения разрешения, масштаба, ориентации и позиции применяются временно. Если не подтвердить их за 20 секунд, исходные параметры будут восстановлены. Постоянные правила Hyprland не изменяются."
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Repeater {
|
||||
model: displays.monitors
|
||||
ColumnLayout {
|
||||
id: monitorCard
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: monitorCard.modelData.name + (monitorCard.modelData.focused ? " · активный" : "")
|
||||
font.bold: true
|
||||
color: Theme.foreground
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: monitorCard.modelData.description
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
Label {
|
||||
text: monitorCard.modelData.width + " × " + monitorCard.modelData.height + " · " + monitorCard.modelData.refreshRate + " Гц · масштаб " + monitorCard.modelData.scale
|
||||
color: Theme.foreground
|
||||
}
|
||||
Label {
|
||||
text: "Позиция: " + monitorCard.modelData.x + ", " + monitorCard.modelData.y + " · transform: " + monitorCard.modelData.transform
|
||||
color: Theme.outline
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label { text: "Позиция X:"; color: Theme.foreground }
|
||||
SpinBox {
|
||||
id: posX
|
||||
from: -100000; to: 100000
|
||||
value: monitorCard.modelData.x
|
||||
editable: true
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
Label { text: "Y:"; color: Theme.foreground }
|
||||
SpinBox {
|
||||
id: posY
|
||||
from: -100000; to: 100000
|
||||
value: monitorCard.modelData.y
|
||||
editable: true
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
id: modePicker
|
||||
Layout.fillWidth: true
|
||||
model: monitorCard.modelData.availableModes
|
||||
enabled: !preview.busy && preview.token === "" && count > 0
|
||||
}
|
||||
ComboBox {
|
||||
id: scalePicker
|
||||
model: ["1", "1.25", "1.5", "1.75", "2", "2.5", "3"]
|
||||
Component.onCompleted: currentIndex = Math.max(0, model.indexOf(String(monitorCard.modelData.scale)))
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
ComboBox {
|
||||
id: rotationPicker
|
||||
model: ["0°", "90°", "180°", "270°"]
|
||||
Component.onCompleted: currentIndex = Math.max(0, Math.min(3, Number(monitorCard.modelData.transform)))
|
||||
enabled: !preview.busy && preview.token === ""
|
||||
}
|
||||
Button {
|
||||
text: "Применить"
|
||||
enabled: modePicker.currentText !== "" && !preview.busy && preview.token === ""
|
||||
onClicked: preview.preview(monitorCard.modelData.name, modePicker.currentText.replace("Hz", ""), scalePicker.currentText, rotationPicker.currentIndex, posX.value, posY.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: preview.token !== ""
|
||||
text: "Подтвердите новые параметры дисплея: осталось " + preview.secondsRemaining + " с"
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.foreground
|
||||
}
|
||||
Button {
|
||||
text: "Сохранить текущие параметры"
|
||||
visible: preview.token !== ""
|
||||
enabled: !preview.busy && preview.secondsRemaining > 0
|
||||
onClicked: preview.confirm()
|
||||
}
|
||||
Label { Layout.fillWidth: true; visible: preview.error !== ""; text: preview.error; wrapMode: Text.Wrap; color: "#d04040" }
|
||||
Label { visible: displays.monitors.length === 0 && displays.error === ""; text: "Мониторы не обнаружены"; color: Theme.outline }
|
||||
Label { Layout.fillWidth: true; visible: displays.error !== ""; text: displays.error; wrapMode: Text.Wrap; color: "#d04040" }
|
||||
Button { text: "Обновить дисплеи"; enabled: !displays.busy; onClicked: displays.refresh() }
|
||||
Label { text: "Яркость"; font.pixelSize: 20; font.bold: true; color: Theme.foreground }
|
||||
Repeater {
|
||||
model: brightness.devices
|
||||
ColumnLayout {
|
||||
id: displayCard
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: displayCard.modelData.name + " · " + displayCard.modelData.percent + "%"; color: Theme.foreground }
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 1; to: 100; stepSize: 1
|
||||
value: displayCard.modelData.percent
|
||||
enabled: !brightness.busy
|
||||
onMoved: brightness.setBrightness(displayCard.modelData.name, Math.round(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: brightness.devices.length === 0
|
||||
text: "Управляемая подсветка не обнаружена."
|
||||
color: Theme.outline
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
visible: brightness.error !== ""
|
||||
text: brightness.error
|
||||
wrapMode: Text.Wrap
|
||||
color: "#d04040"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# Material 3 Expressive UI integration
|
||||
|
||||
Desktop uses a ChromeOS-inspired Material 3 Expressive panel, tonal controls and compact right-side notifications/quick settings. Tablet and phone use Android-inspired larger surfaces and full-screen sheets on phone. This is an original adaptation, not an assertion of pixel-perfect Android 17 or GooglebookOS parity.
|
||||
|
||||
The existing Quickshell `NotificationServer` is the sole notifications owner when `ADAPTIVE_SHELL=1` (unless `ADAPTIVE_NOTIFICATIONS=0` explicitly opts out). Hyprland startup does not launch SwayNC in that mode. Do not run SwayNC and Quickshell's notification server together; only one can own `org.freedesktop.Notifications`. In an already-running session, stop SwayNC before starting the Quickshell notification server, then reload Quickshell.
|
||||
|
||||
`ADAPTIVE_SHELL=1 Hyprland` starts the adaptive shell. The original TTY login and Hypridle/Hyprlock are unchanged. If Quickshell fails, launch the legacy session without ADAPTIVE_SHELL.
|
||||
|
||||
Desktop: compact top bar and right-aligned notification/quick-setting cards. Tablet: centered wider sheets. Phone: full-width, full-height sheets. Hardware-driven controls remain governed by existing Hardware/Modems services.
|
||||
|
||||
Runtime validation requires a Hyprland + Quickshell environment. Static checks cannot prove Android 17 visual parity or notification D-Bus ownership in a live session.
|
||||
@@ -0,0 +1,109 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "services"
|
||||
import "services/Policy.js" as Policy
|
||||
|
||||
Item {
|
||||
id: home
|
||||
signal launchRequested()
|
||||
signal openLauncher()
|
||||
property int pageIndex: 0
|
||||
property bool editing: false
|
||||
readonly property int pageSize: width < 600 ? 12 : 24
|
||||
readonly property var installed: DesktopEntries.applications.values.filter(app => !app.noDisplay)
|
||||
readonly property var favoriteIds: Preferences.data.favorites || []
|
||||
readonly property var pages: Policy.homePages(favoriteIds, pageSize)
|
||||
readonly property var currentIds: pages[Math.min(pageIndex, pages.length - 1)] || []
|
||||
readonly property var currentApps: currentIds.map(id => installed.find(app => app.id === id)).filter(app => app !== undefined)
|
||||
onPagesChanged: if (pageIndex >= pages.length) pageIndex = Math.max(0, pages.length - 1)
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
spacing: 14
|
||||
Item { Layout.fillHeight: true }
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "Главный экран"
|
||||
font.pixelSize: 28
|
||||
font.weight: Font.DemiBold
|
||||
color: Theme.foreground
|
||||
}
|
||||
GridView {
|
||||
id: grid
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.min(540, Math.max(120, Math.ceil(home.currentApps.length / Math.max(1, Math.floor(width / 94))) * 112))
|
||||
clip: true
|
||||
model: home.currentApps
|
||||
cellWidth: width / Math.max(1, Math.floor(width / 94))
|
||||
cellHeight: 112
|
||||
delegate: Item {
|
||||
id: tile
|
||||
required property var modelData
|
||||
width: grid.cellWidth
|
||||
height: grid.cellHeight
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: 7
|
||||
Image {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 52; height: 52
|
||||
source: Quickshell.iconPath(tile.modelData.icon, "application-x-executable")
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
Label {
|
||||
width: grid.cellWidth - 8
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
text: tile.modelData.name
|
||||
color: Theme.foreground
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressAndHold: home.editing = true
|
||||
onClicked: {
|
||||
if (home.editing) return;
|
||||
tile.modelData.execute();
|
||||
Preferences.recordLaunch(tile.modelData.id);
|
||||
home.launchRequested();
|
||||
}
|
||||
}
|
||||
Row {
|
||||
visible: home.editing
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 2
|
||||
Button { text: "←"; enabled: Preferences.writable; onClicked: Preferences.moveFavorite(tile.modelData.id, -1) }
|
||||
Button { text: "×"; enabled: Preferences.writable; onClicked: Preferences.toggleFavorite(tile.modelData.id) }
|
||||
Button { text: "→"; enabled: Preferences.writable; onClicked: Preferences.moveFavorite(tile.modelData.id, 1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Button { text: "‹"; enabled: home.pageIndex > 0; onClicked: home.pageIndex-- }
|
||||
Label { text: (home.pageIndex + 1) + " / " + home.pages.length; color: Theme.foreground }
|
||||
Button { text: "›"; enabled: home.pageIndex + 1 < home.pages.length; onClicked: home.pageIndex++ }
|
||||
}
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Button { text: "Все приложения"; onClicked: home.openLauncher() }
|
||||
Button {
|
||||
text: home.editing ? "Готово" : "Изменить"
|
||||
onClicked: home.editing = !home.editing
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: home.favoriteIds.length === 0
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: "Закрепите приложения через ☆ в списке приложений"
|
||||
color: Theme.outline
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Implementation status — 2026-11-17
|
||||
|
||||
## Implemented in this iteration
|
||||
- Read-only ModemManager discovery via `mmcli --output-json`; missing backend and no-modem are distinct.
|
||||
- Dynamic SIM/mobile-network settings section, modem information, and Quick Settings entry.
|
||||
- Basic phone home view with favorites, application launching and App Drawer entry.
|
||||
- Bottom navigation pill with local swipe/hold recognition (NOT global compositor gestures).
|
||||
- Unit tests for modem parser and existing hardware policy.
|
||||
|
||||
## Not implemented / not validated
|
||||
- Full ModemManager controls (APN, PIN, eSIM, data connection), requires authorization and D-Bus integration.
|
||||
- Global left/right back gesture, gestures over fullscreen applications, bottom pill application cycling.
|
||||
- Complete persistent home-screen grids, folders, widgets, multi-page drag/drop.
|
||||
- Recent Apps thumbnails and card swipe interactions, compositor-aware window overview.
|
||||
- Full Settings modules for displays, input, security, power, notifications.
|
||||
- Quickshell secure session lock and fingerprint authentication: current Hyprlock + Hypridle remain untouched.
|
||||
- Real Quickshell/Hyprland runtime testing, ARM device testing and hardware integration.
|
||||
|
||||
## Security
|
||||
Do not replace Hyprlock with a fullscreen QML overlay. Any future locker must implement ext-session-lock-v1 with verified PAM authorization, crash recovery, and robust suspend handling. fprintd enrollment/verification must be performed by a trusted backend, not by the UI.
|
||||
|
||||
## Local tests
|
||||
`cd quickshell && python -m unittest discover -s tests -p 'test_*.py'`
|
||||
`cd quickshell && node tests/hardware_policy_node.cjs`
|
||||
|
||||
The shell still needs manual Quickshell/QML runtime validation before deployment.
|
||||
@@ -0,0 +1,138 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "services"
|
||||
import "services/Policy.js" as Policy
|
||||
import "components"
|
||||
|
||||
FocusScope {
|
||||
id: launcher
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
signal done()
|
||||
property string category: "all"
|
||||
readonly property bool desktop: width >= 400 && height >= 360
|
||||
readonly property var categories: [
|
||||
{ key: "all", label: "Все" },
|
||||
{ key: "favorites", label: "Избранное" },
|
||||
{ key: "recent", label: "Недавние" }
|
||||
]
|
||||
readonly property var rankedApps: Policy.rankApps(DesktopEntries.applications.values.filter(app => !app.noDisplay && (app.name + " " + app.genericName + " " + app.keywords.join(" ")).toLowerCase().includes(search.text.toLowerCase())), Preferences.data.favorites, Preferences.data.appHistory)
|
||||
readonly property var apps: rankedApps.filter(app => category === "all" ||
|
||||
(category === "favorites" && (Preferences.data.favorites || []).includes(app.id)) ||
|
||||
(category === "recent" && (Preferences.data.appHistory || []).some(entry => (typeof entry === "string" ? entry : entry.id) === app.id)))
|
||||
onVisibleChanged: if (visible) { search.forceActiveFocus(); grid.currentIndex = 0; }
|
||||
function launch(app) {
|
||||
if (app) {
|
||||
app.execute();
|
||||
Preferences.recordLaunch(app.id);
|
||||
done();
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 26
|
||||
color: Theme.surfaceLow
|
||||
}
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: launcher.desktop ? 12 : 0
|
||||
spacing: 10
|
||||
TextField {
|
||||
id: search
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Поиск в приложениях и интернете"
|
||||
font.pixelSize: 15
|
||||
leftPadding: 18
|
||||
background: Rectangle { radius: 24; color: Theme.surfaceHigh; border.color: Theme.outline; border.width: 1 }
|
||||
focus: true
|
||||
onTextChanged: grid.currentIndex = 0
|
||||
onAccepted: launcher.launch(launcher.apps[Math.max(0, grid.currentIndex)])
|
||||
Keys.onDownPressed: grid.forceActiveFocus()
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
visible: launcher.desktop
|
||||
spacing: 6
|
||||
Repeater {
|
||||
model: launcher.categories
|
||||
delegate: Rectangle {
|
||||
id: chip
|
||||
required property var modelData
|
||||
implicitWidth: chipLabel.implicitWidth + 30
|
||||
implicitHeight: 36
|
||||
radius: 18
|
||||
color: launcher.category === modelData.key ? Theme.secondaryContainer : Theme.surfaceHigh
|
||||
border.width: launcher.category === modelData.key ? 1 : 0
|
||||
border.color: Theme.primary
|
||||
Text {
|
||||
id: chipLabel
|
||||
anchors.centerIn: parent
|
||||
text: chip.modelData.label
|
||||
color: Theme.foreground
|
||||
font.pixelSize: 13
|
||||
font.weight: launcher.category === chip.modelData.key ? Font.DemiBold : Font.Normal
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: { launcher.category = chip.modelData.key; grid.currentIndex = 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
Text {
|
||||
text: launcher.apps.length + " приложений"
|
||||
color: Theme.outline
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
GridView {
|
||||
id: grid
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
model: launcher.visible ? launcher.apps : []
|
||||
cellWidth: width / Math.max(1, Math.floor(width / (launcher.desktop ? 82 : 140)))
|
||||
cellHeight: launcher.desktop ? 90 : 120
|
||||
keyNavigationEnabled: true
|
||||
highlight: Rectangle { color: Theme.surface; radius: 16; border.color: Theme.primary }
|
||||
Keys.onSpacePressed: if (launcher.apps[currentIndex]) Preferences.toggleFavorite(launcher.apps[currentIndex].id)
|
||||
Keys.onReturnPressed: launcher.launch(launcher.apps[currentIndex])
|
||||
delegate: Item {
|
||||
id: tile
|
||||
required property var modelData
|
||||
required property int index
|
||||
width: grid.cellWidth
|
||||
height: grid.cellHeight
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 18
|
||||
color: tile.index === grid.currentIndex ? Theme.secondaryContainer : "transparent"
|
||||
Behavior on color { ColorAnimation { duration: Theme.duration } }
|
||||
}
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: 8
|
||||
Image { anchors.horizontalCenter: parent.horizontalCenter; width: launcher.desktop ? 40 : 48; height: launcher.desktop ? 40 : 48; fillMode: Image.PreserveAspectFit; source: Quickshell.iconPath(tile.modelData.icon, "application-x-executable") }
|
||||
Text { width: grid.cellWidth - 16; text: tile.modelData.name; font.pixelSize: launcher.desktop ? 11 : 14; color: Theme.foreground; horizontalAlignment: Text.AlignHCenter; elide: Text.ElideRight; textFormat: Text.PlainText }
|
||||
}
|
||||
MouseArea { anchors.fill: parent; cursorShape: Qt.PointingHandCursor; onClicked: { grid.currentIndex = tile.index; launcher.launch(tile.modelData); } }
|
||||
ActionButton {
|
||||
anchors { top: parent.top; right: parent.right }
|
||||
text: (Preferences.data.favorites || []).includes(tile.modelData.id) ? "★" : "☆"
|
||||
enabled: Preferences.writable
|
||||
Accessible.name: "Избранное: " + tile.modelData.name
|
||||
onClicked: Preferences.toggleFavorite(tile.modelData.id)
|
||||
}
|
||||
}
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
}
|
||||
Label { visible: !launcher.desktop; text: "★ — избранное · Пробел — закрепить выбранное приложение"; Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.outline }
|
||||
Label { visible: launcher.apps.length === 0; text: "Приложения не найдены"; color: Theme.foreground }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
PanelWindow {
|
||||
id: navigation
|
||||
signal navigate(string name)
|
||||
signal cycleApplication(int direction)
|
||||
required property var output
|
||||
screen: output
|
||||
visible: Preferences.modeFor(output) !== "desktop"
|
||||
anchors { left: true; right: true; bottom: true }
|
||||
implicitHeight: 38
|
||||
color: Theme.background
|
||||
WlrLayershell.namespace: "adaptive-navigation"
|
||||
Rectangle {
|
||||
id: pill
|
||||
anchors.centerIn: parent
|
||||
width: 108; height: 5; radius: 3
|
||||
color: Theme.foreground
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
property real startY: 0
|
||||
property real startX: 0
|
||||
property double startAt: 0
|
||||
onPressed: mouse => { startX = mouse.x; startY = mouse.y; startAt = Date.now(); }
|
||||
onReleased: mouse => {
|
||||
const dy = startY - mouse.y;
|
||||
const dx = mouse.x - startX;
|
||||
// Only gestures that reach this panel are captured. Global edge
|
||||
// interception requires explicit compositor support.
|
||||
const elapsed = Date.now() - startAt;
|
||||
// A horizontal swipe on the navigation handle cycles open windows.
|
||||
if (Math.abs(dx) > 55 && Math.abs(dx) > Math.abs(dy) * 1.3)
|
||||
navigation.cycleApplication(dx < 0 ? 1 : -1);
|
||||
else if (dy > 14 && elapsed >= 450)
|
||||
navigation.navigate("recent");
|
||||
else if (dy > 14)
|
||||
navigation.navigate("home");
|
||||
else if (Math.abs(dx) < 12 && Math.abs(dy) < 12)
|
||||
navigation.navigate("home");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
ColumnLayout {
|
||||
width: root.availableWidth
|
||||
spacing: 14
|
||||
Label { text: "Мобильная сеть и SIM"; font.pixelSize: 22; color: Theme.primary }
|
||||
Label { visible: Modems.error !== ""; text: Modems.error; wrapMode: Text.Wrap; color: Theme.outline; Layout.fillWidth: true }
|
||||
Label { visible: Modems.actionError !== ""; text: Modems.actionError; wrapMode: Text.Wrap; color: Theme.outline; Layout.fillWidth: true }
|
||||
Repeater {
|
||||
model: Modems.devices
|
||||
ColumnLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: (modelData.manufacturer || "Модем") + " " + (modelData.model || modelData.id); color: Theme.foreground; font.bold: true }
|
||||
Label { text: "Состояние: " + modelData.state + (modelData.simPresent ? " · SIM обнаружена" : " · SIM не обнаружена"); color: Theme.foreground }
|
||||
Label { text: "Оператор: " + (modelData.operator || "неизвестен") + " · Сигнал: " + modelData.signal + "%"; color: Theme.foreground }
|
||||
RowLayout {
|
||||
Button {
|
||||
text: "Включить модем"
|
||||
enabled: !Modems.actionBusy && modelData.state !== "error"
|
||||
onClicked: Modems.setEnabled(modelData.id, true)
|
||||
}
|
||||
Button {
|
||||
text: "Отключить модем"
|
||||
enabled: !Modems.actionBusy && modelData.state !== "error"
|
||||
onClicked: confirmDisable.open()
|
||||
}
|
||||
Dialog {
|
||||
id: confirmDisable
|
||||
title: "Отключить модем?"
|
||||
modal: true
|
||||
standardButtons: Dialog.Yes | Dialog.Cancel
|
||||
onAccepted: Modems.setEnabled(modelData.id, false)
|
||||
Label { text: "Мобильное соединение может прерваться." }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Label { text: "Мобильные подключения (NetworkManager)"; font.pixelSize: 19; color: Theme.primary }
|
||||
Label { visible: MobileConnections.error !== ""; text: MobileConnections.error; wrapMode: Text.Wrap; color: Theme.outline; Layout.fillWidth: true }
|
||||
TextField { id: profileName; Layout.fillWidth: true; placeholderText: "Имя подключения"; text: "Мобильный интернет"; maximumLength: 64 }
|
||||
TextField { id: apnField; Layout.fillWidth: true; placeholderText: "APN оператора (например, internet)"; maximumLength: 100 }
|
||||
Button {
|
||||
text: "Создать профиль APN"
|
||||
enabled: !MobileConnections.busy && profileName.text.trim().length > 0 && /^[a-zA-Z0-9][a-zA-Z0-9.-]{0,99}$/.test(apnField.text)
|
||||
onClicked: MobileConnections.perform("create", profileName.text.trim(), apnField.text)
|
||||
}
|
||||
Repeater {
|
||||
model: MobileConnections.profiles
|
||||
RowLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { text: modelData.name; color: Theme.foreground; Layout.fillWidth: true; elide: Text.ElideRight }
|
||||
Button { text: "Подключить"; enabled: !MobileConnections.busy; onClicked: MobileConnections.perform("activate", modelData.uuid) }
|
||||
Button { text: "Отключить"; enabled: !MobileConnections.busy; onClicked: MobileConnections.perform("deactivate", modelData.uuid) }
|
||||
Button { text: "Удалить"; enabled: !MobileConnections.busy; onClicked: deleteConfirm.open() }
|
||||
Dialog {
|
||||
id: deleteConfirm
|
||||
title: "Удалить профиль мобильной сети?"
|
||||
modal: true
|
||||
standardButtons: Dialog.Yes | Dialog.Cancel
|
||||
onAccepted: MobileConnections.perform("delete", modelData.uuid)
|
||||
Label { text: "Профиль будет удалён из NetworkManager." }
|
||||
}
|
||||
}
|
||||
}
|
||||
Label { text: "PIN/PUK не запрашиваются и не сохраняются. Подключение выполняется NetworkManager с системной авторизацией; наличие SIM и поддержка модема обязательны."; wrapMode: Text.Wrap; color: Theme.outline; Layout.fillWidth: true }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: page
|
||||
property bool active: false
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
ColumnLayout {
|
||||
width: page.availableWidth
|
||||
spacing: 20
|
||||
Label { text: "Сеть"; font.pixelSize: 24; color: Theme.primary }
|
||||
Label {
|
||||
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground
|
||||
text: Networking.backend === NetworkBackendType.None ? "Сетевой сервис недоступен" : !Networking.canCheckConnectivity ? "Проверка Интернета недоступна" : !Networking.connectivityCheckEnabled ? "Проверка Интернета отключена" : ({0: "Состояние Интернета неизвестно", 1: "Нет подключения к Интернету", 2: "Нужен вход в сеть", 3: "Ограниченное подключение", 4: "Есть доступ к Интернету"})[Networking.connectivity] || "Состояние Интернета неизвестно"
|
||||
}
|
||||
Switch {
|
||||
visible: Hardware.wifiPresent
|
||||
text: Networking.wifiHardwareEnabled ? "Wi-Fi" : "Wi-Fi заблокирован оборудованием"
|
||||
enabled: Networking.wifiHardwareEnabled
|
||||
checked: Networking.wifiEnabled
|
||||
onClicked: Networking.wifiEnabled = checked
|
||||
}
|
||||
Label { visible: Networking.backend !== NetworkBackendType.None && Hardware.networks.length === 0; text: "Сетевые интерфейсы не обнаружены"; color: Theme.outline }
|
||||
Repeater {
|
||||
model: Hardware.networks
|
||||
Rectangle {
|
||||
id: adapter
|
||||
required property var modelData
|
||||
property bool confirmDisconnect: false
|
||||
readonly property bool wifi: modelData?.type === DeviceType.Wifi
|
||||
readonly property bool wired: modelData?.type === DeviceType.Wired
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: content.implicitHeight + 32
|
||||
color: Theme.surface; radius: 20
|
||||
NetworkController { id: networkController; device: adapter.modelData }
|
||||
Binding {
|
||||
target: adapter.wifi ? adapter.modelData : null
|
||||
property: "scannerEnabled"
|
||||
when: adapter.wifi
|
||||
value: page.active && Networking.wifiEnabled && Networking.wifiHardwareEnabled
|
||||
restoreMode: Binding.RestoreBindingOrValue
|
||||
}
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors { top: parent.top; left: parent.left; right: parent.right; margins: 16 }
|
||||
spacing: 12
|
||||
Label { text: (adapter.modelData?.name || "") + " · " + (adapter.wifi ? "Wi-Fi" : adapter.wired ? "Ethernet" : "Другой интерфейс"); font.pixelSize: 20; color: Theme.primary; textFormat: Text.PlainText }
|
||||
Label { text: adapter.modelData ? ConnectionState.toString(adapter.modelData.state) : ""; color: Theme.foreground }
|
||||
Label { visible: !!adapter.modelData?.address; text: "MAC: " + adapter.modelData?.address; color: Theme.outline; textFormat: Text.PlainText }
|
||||
Label { visible: !adapter.modelData?.nmManaged; text: "Интерфейс не управляется NetworkManager"; color: Theme.outline; Layout.fillWidth: true; wrapMode: Text.Wrap }
|
||||
Label { visible: adapter.wired; text: adapter.wired ? (adapter.modelData?.hasLink ? "Кабель подключён" : "Кабель не подключён") : ""; color: Theme.foreground }
|
||||
Label { visible: adapter.wired && adapter.modelData?.linkSpeed > 0; text: adapter.wired ? "Скорость линии: " + adapter.modelData?.linkSpeed + " Мбит/с" : ""; color: Theme.outline }
|
||||
Repeater {
|
||||
model: adapter.modelData?.networks || []
|
||||
NetworkCard {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
network: modelData; device: adapter.modelData; controller: networkController
|
||||
active: page.active
|
||||
onEditRequested: Quickshell.execDetached(["nm-connection-editor"])
|
||||
}
|
||||
}
|
||||
BusyIndicator { visible: networkController.busy; running: visible }
|
||||
Label { Layout.fillWidth: true; wrapMode: Text.Wrap; visible: networkController.error !== ""; text: networkController.error; color: "#ffb4ab"; textFormat: Text.PlainText }
|
||||
ActionButton {
|
||||
visible: adapter.modelData?.connected && !adapter.confirmDisconnect
|
||||
text: "Отключить интерфейс…"
|
||||
enabled: adapter.modelData?.nmManaged && !networkController.busy
|
||||
onClicked: adapter.confirmDisconnect = true
|
||||
}
|
||||
Label { visible: adapter.confirmDisconnect; text: "Подтвердите отключение. Соединения через этот интерфейс будут прерваны."; Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground }
|
||||
RowLayout {
|
||||
visible: adapter.confirmDisconnect
|
||||
ActionButton { text: "Отключить"; enabled: !networkController.busy; onClicked: { adapter.confirmDisconnect = false; networkController.requestDisconnect(); } }
|
||||
ActionButton { text: "Отмена"; onClicked: adapter.confirmDisconnect = false }
|
||||
}
|
||||
}
|
||||
Connections { target: page; function onActiveChanged() { if (!page.active) adapter.confirmDisconnect = false; } }
|
||||
}
|
||||
}
|
||||
ActionButton { text: "Профили, IP, DNS и VPN…"; onClicked: Quickshell.execDetached(["nm-connection-editor"]) }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: center
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
ColumnLayout {
|
||||
width: center.availableWidth
|
||||
spacing: 14
|
||||
Label { text: "Центр уведомлений"; font.pixelSize: 24; font.weight: Font.DemiBold; color: Theme.foreground; Layout.fillWidth: true }
|
||||
Switch { text: "Не беспокоить"; checked: Notifications.dnd; enabled: Preferences.writable; onClicked: Notifications.setDnd(checked) }
|
||||
Switch { text: "Сохранять историю уведомлений"; checked: Notifications.saveHistory; enabled: Preferences.writable; onClicked: Notifications.setSaveHistory(checked) }
|
||||
ActionButton { text: "Очистить всё"; enabled: Notifications.items.length + Notifications.history.length > 0; onClicked: Notifications.clear() }
|
||||
Label { visible: Notifications.error !== ""; text: Notifications.error; color: Theme.outline; Layout.fillWidth: true; wrapMode: Text.Wrap }
|
||||
Repeater {
|
||||
model: Notifications.groups
|
||||
ColumnLayout {
|
||||
id: group
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 8
|
||||
Label { Layout.fillWidth: true; text: group.modelData.name + " · " + group.modelData.entries.length; font.pixelSize: 20; color: Theme.primary; textFormat: Text.PlainText }
|
||||
Repeater {
|
||||
model: group.modelData.entries
|
||||
NotificationCard {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
notification: modelData.notification || null
|
||||
record: modelData.record || null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Label { visible: Notifications.groups.length === 0; text: "Всё чисто — новых уведомлений нет"; color: Theme.foreground }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
PanelWindow {
|
||||
id: overlay
|
||||
property string page: ""
|
||||
signal closeRequested()
|
||||
signal navigate(string name)
|
||||
readonly property string mode: screen ? Preferences.modeFor(screen) : "desktop"
|
||||
visible: page !== ""
|
||||
anchors { top: true; bottom: true; left: true; right: true }
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||
WlrLayershell.namespace: "adaptive-overlay"
|
||||
color: overlay.mode === "desktop" ? "#22000000" : "#80000000"
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
MouseArea { anchors.fill: parent; onClicked: overlay.closeRequested() }
|
||||
Rectangle {
|
||||
id: card
|
||||
anchors.centerIn: parent
|
||||
anchors.horizontalCenterOffset: overlay.mode === "desktop" && (overlay.page === "notifications" || overlay.page === "quick") ? Math.max(0, (overlay.width - width) / 2 - 20) : overlay.mode === "desktop" && overlay.page === "launcher" ? -Math.max(0, (overlay.width - width) / 2 - 20) : 0
|
||||
anchors.verticalCenterOffset: overlay.mode === "desktop" && (["notifications", "quick", "launcher"].includes(overlay.page)) ? -Math.max(0, (overlay.height - height) / 2 - 64) : 0
|
||||
width: overlay.mode === "phone" ? parent.width : Math.min(parent.width - 32, overlay.mode === "tablet" ? 900 : (overlay.page === "launcher" ? 420 : (["notifications", "quick"].includes(overlay.page) ? 390 : 760)))
|
||||
height: overlay.mode === "phone" ? parent.height : Math.min(parent.height - 64, overlay.mode === "desktop" && overlay.page === "quick" ? 420 : overlay.mode === "desktop" && overlay.page === "notifications" ? 680 : (overlay.mode === "desktop" && overlay.page === "launcher" ? 560 : 780))
|
||||
radius: overlay.mode === "phone" ? 0 : 28
|
||||
color: Theme.surfaceLow
|
||||
MouseArea { anchors.fill: parent }
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: overlay.mode === "desktop" ? 14 : 20
|
||||
RowLayout {
|
||||
visible: overlay.mode !== "desktop" || !["launcher", "quick"].includes(overlay.page)
|
||||
Layout.fillWidth: true
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
text: ({launcher: "Приложения", settings: "Settings", quick: "Быстрые настройки", recent: "Открытые окна", home: "Главный экран", notifications: "Уведомления", power: "Питание"})[overlay.page] || ""
|
||||
color: Theme.foreground
|
||||
font.pixelSize: overlay.mode === "desktop" ? 25 : 30
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
ActionButton { text: "Закрыть"; onClicked: overlay.closeRequested() }
|
||||
}
|
||||
StackLayout {
|
||||
id: content
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
currentIndex: ["launcher", "settings", "quick", "recent", "power", "notifications", "home"].indexOf(overlay.page)
|
||||
Launcher { onDone: overlay.closeRequested() }
|
||||
Item {}
|
||||
Item {
|
||||
QuickSettings {
|
||||
anchors.fill: parent
|
||||
visible: overlay.mode !== "desktop"
|
||||
onNavigate: name => overlay.navigate(name)
|
||||
}
|
||||
DesktopQuickSettings {
|
||||
anchors.fill: parent
|
||||
visible: overlay.mode === "desktop"
|
||||
onNavigate: name => overlay.navigate(name)
|
||||
}
|
||||
}
|
||||
Recent { onDone: overlay.closeRequested() }
|
||||
Power { onDone: overlay.closeRequested() }
|
||||
NotificationCenter {}
|
||||
Home { onLaunchRequested: overlay.closeRequested(); onOpenLauncher: overlay.navigate("launcher") }
|
||||
}
|
||||
}
|
||||
}
|
||||
Shortcut { sequence: "Escape"; enabled: overlay.visible; onActivated: overlay.closeRequested() }
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ColumnLayout {
|
||||
id: power
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
signal done()
|
||||
property string pending: ""
|
||||
readonly property var actions: [
|
||||
{id: "lock", title: "Заблокировать", question: ""},
|
||||
{id: "suspend", title: "Сон", question: "Заблокировать компьютер и перейти в сон?"},
|
||||
{id: "logout", title: "Выйти из сессии", question: "Завершить сессию? Несохранённые изменения могут быть потеряны."},
|
||||
{id: "reboot", title: "Перезагрузка", question: "Перезагрузить компьютер?"},
|
||||
{id: "poweroff", title: "Выключение", question: "Выключить компьютер?"}
|
||||
]
|
||||
PowerController {
|
||||
id: controller
|
||||
onSucceeded: action => { power.pending = ""; if (power.visible) power.done(); }
|
||||
}
|
||||
onVisibleChanged: {
|
||||
if (visible) controller.refresh();
|
||||
else pending = "";
|
||||
}
|
||||
spacing: 12
|
||||
Repeater {
|
||||
model: power.actions
|
||||
ColumnLayout {
|
||||
id: row
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
ActionButton {
|
||||
text: row.modelData.title + (controller.capabilities[row.modelData.id]?.state === "challenge" ? " · Авторизация" : "")
|
||||
enabled: !controller.busy && controller.available(row.modelData.id)
|
||||
onClicked: {
|
||||
if (row.modelData.id === "lock") controller.start("lock");
|
||||
else power.pending = row.modelData.id;
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: !controller.available(row.modelData.id) && !controller.busy
|
||||
text: controller.capabilities[row.modelData.id]?.reason || "Недоступно в текущей сессии"
|
||||
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.outline; textFormat: Text.PlainText
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true; wrapMode: Text.Wrap; color: Theme.foreground
|
||||
visible: power.pending !== ""
|
||||
text: power.actions.find(a => a.id === power.pending)?.question || ""
|
||||
}
|
||||
RowLayout {
|
||||
visible: power.pending !== ""
|
||||
ActionButton { text: "Подтвердить"; enabled: !controller.busy; onClicked: controller.start(power.pending) }
|
||||
ActionButton { text: "Отмена"; enabled: !controller.busy; onClicked: power.pending = "" }
|
||||
}
|
||||
BusyIndicator { visible: controller.busy; running: visible }
|
||||
Label { visible: controller.busy; text: "Ожидание ответа системы…"; color: Theme.foreground }
|
||||
Label { Layout.fillWidth: true; wrapMode: Text.Wrap; text: controller.error || controller.capabilityError; visible: text !== ""; color: "#ffb4ab"; textFormat: Text.PlainText }
|
||||
ActionButton { text: "Обновить доступность действий"; enabled: !controller.busy; onClicked: controller.refresh() }
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import Quickshell.Bluetooth
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
ScrollView {
|
||||
id: quick
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
signal navigate(string name)
|
||||
clip: true
|
||||
contentWidth: availableWidth
|
||||
BrightnessController { id: brightnessControl }
|
||||
readonly property bool desktop: width >= 350
|
||||
ColumnLayout {
|
||||
width: quick.availableWidth
|
||||
spacing: 10
|
||||
RowLayout {
|
||||
visible: quick.desktop
|
||||
Layout.fillWidth: true
|
||||
Label { text: "Быстрые настройки"; font.pixelSize: 17; font.bold: true; color: Theme.foreground; Layout.fillWidth: true }
|
||||
ActionButton { text: "⚙"; onClicked: quick.navigate("settings") }
|
||||
}
|
||||
Rectangle {
|
||||
visible: quick.desktop
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 8
|
||||
radius: 4
|
||||
color: Theme.secondaryContainer
|
||||
}
|
||||
Label { visible: quick.desktop; text: "Подключения"; font.pixelSize: 13; color: Theme.outline }
|
||||
Label { visible: !quick.desktop; text: "Сеть"; color: Theme.primary; font.pixelSize: 20 }
|
||||
Rectangle {
|
||||
visible: quick.desktop && (Hardware.wifiPresent || Hardware.bluetoothAdapters.length > 0)
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 1
|
||||
color: Theme.outline
|
||||
opacity: 0.25
|
||||
}
|
||||
Switch {
|
||||
visible: Hardware.wifiPresent
|
||||
text: Hardware.wifiState === "blocked" ? "Wi-Fi заблокирован оборудованием" : "Wi-Fi"
|
||||
checked: Networking.wifiEnabled
|
||||
enabled: Networking.wifiHardwareEnabled
|
||||
onClicked: Networking.wifiEnabled = checked
|
||||
}
|
||||
Repeater {
|
||||
model: Hardware.wiredDevices
|
||||
ActionButton {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
text: "Ethernet · " + modelData.name + (modelData.connected ? " · подключено" : modelData.hasLink ? " · кабель подключён" : " · нет кабеля")
|
||||
onClicked: quick.navigate("network")
|
||||
}
|
||||
}
|
||||
ActionButton {
|
||||
visible: Hardware.networkReady && (Hardware.networks.length > 0 || Networking.canCheckConnectivity)
|
||||
text: "Сетевые подключения…"
|
||||
onClicked: quick.navigate("network")
|
||||
}
|
||||
ActionButton { visible: Modems.present; text: "Мобильная сеть · " + Modems.devices.length + " модем(ов)"; onClicked: quick.navigate("modem") }
|
||||
Repeater {
|
||||
model: Hardware.bluetoothAdapters
|
||||
Switch {
|
||||
required property var modelData
|
||||
text: "Bluetooth · " + modelData.name
|
||||
checked: modelData.enabled
|
||||
onClicked: modelData.enabled = checked
|
||||
}
|
||||
}
|
||||
ActionButton { visible: Hardware.bluetoothAdapters.length > 0; text: "Устройства Bluetooth"; onClicked: quick.navigate("bluetooth") }
|
||||
// Brightness is hardware-dependent: no dead slider on desktop monitors
|
||||
// without a kernel backlight. Changes are committed on release, avoiding
|
||||
// a burst of brightnessctl processes while dragging.
|
||||
Label {
|
||||
visible: brightnessControl.devices.length > 0
|
||||
text: "Яркость экрана"
|
||||
color: Theme.primary
|
||||
font.pixelSize: 20
|
||||
}
|
||||
Repeater {
|
||||
model: brightnessControl.devices
|
||||
ColumnLayout {
|
||||
id: backlightRow
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: backlightRow.modelData.name + " · " + backlightRow.modelData.percent + "%"
|
||||
color: Theme.foreground
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Slider {
|
||||
id: brightnessSlider
|
||||
Layout.fillWidth: true
|
||||
from: 1
|
||||
to: 100
|
||||
stepSize: 1
|
||||
value: backlightRow.modelData.percent
|
||||
enabled: !brightnessControl.busy
|
||||
onPressedChanged: {
|
||||
if (!pressed)
|
||||
brightnessControl.setBrightness(backlightRow.modelData.name, Math.round(value))
|
||||
}
|
||||
Accessible.name: "Яркость " + backlightRow.modelData.name
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: brightnessControl.error !== ""
|
||||
Layout.fillWidth: true
|
||||
text: brightnessControl.error
|
||||
wrapMode: Text.Wrap
|
||||
color: Theme.outline
|
||||
}
|
||||
ActionButton {
|
||||
visible: brightnessControl.devices.length > 0
|
||||
text: "Настройки дисплея…"
|
||||
onClicked: quick.navigate("display")
|
||||
}
|
||||
Label { visible: Hardware.sink !== null; text: "Громкость"; color: Theme.primary; font.pixelSize: quick.desktop ? 14 : 20 }
|
||||
RowLayout {
|
||||
visible: Hardware.sink !== null
|
||||
Layout.fillWidth: true
|
||||
ActionButton {
|
||||
text: Hardware.sink?.audio?.muted ? "Включить звук" : "Без звука"
|
||||
onClicked: if (Hardware.sink?.audio) Hardware.sink.audio.muted = !Hardware.sink.audio.muted
|
||||
}
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
from: 0; to: 1
|
||||
value: Hardware.sink?.audio?.volume || 0
|
||||
onMoved: if (Hardware.sink?.audio) Hardware.sink.audio.volume = value
|
||||
}
|
||||
}
|
||||
Switch {
|
||||
visible: Hardware.source !== null
|
||||
text: "Микрофон"
|
||||
checked: Hardware.source?.audio ? !Hardware.source.audio.muted : false
|
||||
onClicked: if (Hardware.source?.audio) Hardware.source.audio.muted = !checked
|
||||
}
|
||||
ActionButton { visible: Hardware.audioReady; text: "Аудиоустройства"; onClicked: quick.navigate("audio") }
|
||||
Repeater {
|
||||
model: Hardware.players
|
||||
ColumnLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
Label { Layout.fillWidth: true; text: modelData.trackTitle || modelData.identity; color: Theme.foreground; elide: Text.ElideRight; textFormat: Text.PlainText }
|
||||
RowLayout {
|
||||
ActionButton { text: "Назад"; enabled: modelData.canGoPrevious; onClicked: modelData.previous() }
|
||||
ActionButton { text: modelData.isPlaying ? "Пауза" : "Играть"; enabled: modelData.canTogglePlaying; onClicked: modelData.togglePlaying() }
|
||||
ActionButton { text: "Далее"; enabled: modelData.canGoNext; onClicked: modelData.next() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Wayland
|
||||
import "services"
|
||||
import "services/WindowPolicy.js" as WindowPolicy
|
||||
import "components"
|
||||
|
||||
Item {
|
||||
id: recent
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
signal done()
|
||||
readonly property var windows: ToplevelManager.toplevels.values
|
||||
readonly property var filtered: windows.filter(window =>
|
||||
((window.title || "") + " " + (window.appId || "")).toLowerCase().includes(search.text.toLowerCase()))
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 12
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: "Открытые приложения · " + recent.windows.length
|
||||
font.pixelSize: 20
|
||||
color: Theme.foreground
|
||||
}
|
||||
TextField {
|
||||
id: search
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Поиск среди открытых окон"
|
||||
}
|
||||
ScrollView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
contentWidth: availableWidth
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
Repeater {
|
||||
model: recent.filtered
|
||||
Rectangle {
|
||||
id: windowCard
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: actions.implicitHeight + 24
|
||||
radius: Theme.radius
|
||||
color: Theme.surfaceHigh
|
||||
// Gesture recognition does not steal taps from the action buttons.
|
||||
DragHandler {
|
||||
id: dismissDrag
|
||||
target: null
|
||||
xAxis.enabled: false
|
||||
onActiveChanged: {
|
||||
if (!active && WindowPolicy.shouldDismissSwipe(activeTranslation.x, activeTranslation.y, windowCard.width))
|
||||
windowCard.modelData.close();
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
id: actions
|
||||
anchors.fill: parent
|
||||
anchors.margins: 12
|
||||
spacing: 8
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: windowCard.modelData.title || windowCard.modelData.appId || "Окно"
|
||||
color: Theme.foreground
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: windowCard.modelData.appId || ""
|
||||
color: Theme.outline
|
||||
font.pixelSize: 12
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
ActionButton { text: "Открыть"; onClicked: { windowCard.modelData.activate(); recent.done(); } }
|
||||
ActionButton { text: "Закрыть"; onClicked: windowCard.modelData.close() }
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: recent.filtered.length === 0
|
||||
text: search.text ? "Окна не найдены" : "Нет открытых окон"
|
||||
color: Theme.foreground
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
import "services/HardwarePolicy.js" as HardwarePolicy
|
||||
import "components"
|
||||
|
||||
Item {
|
||||
id: settings
|
||||
signal navigate(string name)
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
property bool active: visible
|
||||
readonly property bool wide: width >= 700
|
||||
// Keep a stable identifier when devices appear/disappear. Never persist a
|
||||
// numeric index: hotplug would otherwise open an unrelated settings page.
|
||||
property string selectedSection: "appearance"
|
||||
readonly property var sections: HardwarePolicy.visibleSettingsSections(
|
||||
Hardware.outputs.length > 0 || Hardware.inputs.length > 0 || Hardware.sink !== null || Hardware.source !== null,
|
||||
Hardware.networkReady && (Hardware.networks.length > 0 || Hardware.wifiPresent),
|
||||
Hardware.bluetoothAdapters.length > 0, Modems.present, Hardware.batteries.length > 0)
|
||||
readonly property int selectedIndex: HardwarePolicy.sectionIndex(sections, selectedSection)
|
||||
readonly property string currentSection: selectedIndex >= 0 ? selectedSection : "appearance"
|
||||
readonly property int currentPage: HardwarePolicy.pageIndex(currentSection)
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 24
|
||||
ColumnLayout {
|
||||
visible: settings.wide
|
||||
Layout.preferredWidth: 190
|
||||
Layout.fillHeight: true
|
||||
Repeater {
|
||||
model: settings.sections
|
||||
ActionButton {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
text: modelData.title
|
||||
checked: settings.currentSection === modelData.id
|
||||
onClicked: settings.selectedSection = modelData.id
|
||||
}
|
||||
}
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
ComboBox {
|
||||
visible: !settings.wide
|
||||
Layout.fillWidth: true
|
||||
textRole: "title"
|
||||
model: settings.sections
|
||||
currentIndex: settings.selectedIndex >= 0 ? settings.selectedIndex : 0
|
||||
onActivated: index => settings.selectedSection = settings.sections[index].id
|
||||
}
|
||||
StackLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
currentIndex: settings.currentPage
|
||||
AppearanceSettings { onNavigate: name => settings.navigate(name) }
|
||||
AudioSettings {}
|
||||
NetworkSettings { active: settings.active && settings.currentSection === "network" }
|
||||
WallpaperSettings {}
|
||||
BluetoothSettings { active: settings.active && settings.currentSection === "bluetooth" }
|
||||
ModemSettings {}
|
||||
SystemSettings {}
|
||||
BatterySettings {}
|
||||
DisplaySettings {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "services"
|
||||
import "components"
|
||||
|
||||
FloatingWindow {
|
||||
id: window
|
||||
signal closeRequested()
|
||||
signal navigate(string name)
|
||||
property alias section: settings.selectedSection
|
||||
title: "Settings"
|
||||
implicitWidth: 1000
|
||||
implicitHeight: 760
|
||||
minimumSize: Qt.size(360, 400)
|
||||
color: Theme.background
|
||||
Material.theme: Theme.dark ? Material.Dark : Material.Light
|
||||
Material.accent: Theme.primary
|
||||
onClosed: closeRequested()
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 24
|
||||
spacing: 20
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Text { text: "Settings"; color: Theme.foreground; font.pixelSize: 28; Layout.fillWidth: true }
|
||||
ActionButton { text: "Закрыть"; onClicked: window.closeRequested() }
|
||||
}
|
||||
Settings { id: settings; active: window.visible; Layout.fillWidth: true; Layout.fillHeight: true; onNavigate: name => window.navigate(name) }
|
||||
}
|
||||
Shortcut { sequence: "Escape"; onActivated: window.closeRequested() }
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import "services"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
contentWidth: availableWidth
|
||||
clip: true
|
||||
ColumnLayout {
|
||||
width: root.availableWidth
|
||||
spacing: 12
|
||||
Label { text: "О системе"; font.pixelSize: 24; font.bold: true; color: Theme.primary }
|
||||
Label { text: "Сведения обновляются автоматически. Изменение параметров системы здесь не выполняется."; wrapMode: Text.Wrap; Layout.fillWidth: true; color: Theme.outline }
|
||||
Label { visible: SystemInfo.error.length > 0; text: SystemInfo.error; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||||
Repeater {
|
||||
model: [
|
||||
{label: "Операционная система", value: SystemInfo.details.os || "—"},
|
||||
{label: "Ядро Linux", value: SystemInfo.details.kernel || "—"},
|
||||
{label: "Архитектура", value: SystemInfo.details.architecture || "—"},
|
||||
{label: "Имя устройства", value: SystemInfo.details.hostname || "—"},
|
||||
{label: "Оперативная память", value: SystemInfo.details.memoryTotalMiB ? (Math.round(SystemInfo.details.memoryTotalMiB / 102.4) / 10) + " ГиБ" : "—"},
|
||||
{label: "Доступная память", value: SystemInfo.details.memoryAvailableMiB ? (Math.round(SystemInfo.details.memoryAvailableMiB / 102.4) / 10) + " ГиБ" : "—"},
|
||||
{label: "Время работы", value: SystemInfo.details.uptimeSeconds !== undefined ? Math.floor(SystemInfo.details.uptimeSeconds / 3600) + " ч " + Math.floor(SystemInfo.details.uptimeSeconds % 3600 / 60) + " мин" : "—"}
|
||||
]
|
||||
ColumnLayout {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
spacing: 2
|
||||
Label { text: modelData.label; font.pixelSize: 12; color: Theme.outline }
|
||||
Label { text: modelData.value; font.pixelSize: 16; color: Theme.foreground; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||||
}
|
||||
}
|
||||
Button { text: "Обновить"; enabled: !SystemInfo.busy; onClicked: SystemInfo.refresh() }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "services"
|
||||
import "services/NotificationPolicy.js" as Policy
|
||||
import "components"
|
||||
|
||||
PanelWindow {
|
||||
id: toast
|
||||
property var notification: null
|
||||
visible: notification !== null && !Notifications.dnd
|
||||
anchors { top: true; right: true }
|
||||
margins { top: 64; right: 12 }
|
||||
implicitWidth: Math.min(360, screen.width - 24)
|
||||
implicitHeight: labels.implicitHeight + 32
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.namespace: "adaptive-notification"
|
||||
color: "transparent"
|
||||
Connections {
|
||||
target: Notifications
|
||||
function onPresent(n) {
|
||||
toast.notification = n;
|
||||
hide.stop();
|
||||
const duration = Policy.timeoutMs(n.expireTimeout, n.urgency);
|
||||
// Persistent normal notifications stay in the center, but their popup is bounded.
|
||||
if (n.urgency !== 2) { hide.interval = duration || 6000; hide.start(); }
|
||||
}
|
||||
function onRemoved(id) { if (toast.notification?.id === id) toast.notification = null; }
|
||||
function onDndChanged() { if (Notifications.dnd) { toast.notification = null; hide.stop(); } }
|
||||
}
|
||||
Timer { id: hide; onTriggered: toast.notification = null }
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.surfaceHigh
|
||||
radius: Theme.radiusLarge
|
||||
Column {
|
||||
id: labels
|
||||
anchors { left: parent.left; right: parent.right; top: parent.top; margins: 16 }
|
||||
spacing: 8
|
||||
Text { width: parent.width; text: toast.notification?.appName || ""; color: Theme.primary; textFormat: Text.PlainText; elide: Text.ElideRight }
|
||||
ActionButton { text: "Убрать"; onClicked: if (toast.notification) Notifications.dismiss(toast.notification.id) }
|
||||
Text { width: parent.width; text: toast.notification?.summary || ""; color: Theme.foreground; textFormat: Text.PlainText; wrapMode: Text.Wrap; maximumLineCount: 3; elide: Text.ElideRight }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 189 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user