Files
att_menu/shell.qml
T
2026-08-02 12:16:23 +02:00

103 lines
2.2 KiB
QML

import Quickshell
import Quickshell.Io
import qs.modules
import qs.services
ShellRoot {
// One panel per screen. Variants tracks screen hotplug, so panels appear and
// disappear with monitors without a reload.
Variants {
model: Quickshell.screens
Bar {}
}
// Lets the menus be bound to keys in the compositor, e.g.
// bindsym $mod+d exec qs -c att_menu ipc call launcher toggle
// `close` closes whichever menu is open — only one ever is.
IpcHandler {
target: "launcher"
function toggle(): void {
Session.toggle("launcher", "");
}
function open(): void {
Session.open("launcher", "");
}
function close(): void {
Session.close();
}
}
IpcHandler {
target: "power"
function toggle(): void {
Session.toggle("power", "");
}
function open(): void {
Session.open("power", "");
}
function close(): void {
Session.close();
}
}
IpcHandler {
target: "wifi"
function toggle(): void {
Session.toggle("wifi", "");
}
function open(): void {
Session.open("wifi", "");
}
function close(): void {
Session.close();
}
}
// Not a menu: this one drives squeekboard, so it is worth binding to a
// hardware key or a tablet-mode switch as well as clicking.
IpcHandler {
target: "osk"
function toggle(): void {
Osk.toggle();
}
// Named to match the menu targets above: `qs ipc call` swallows a
// function called `show` — it collides with the `ipc show` subcommand
// — and a lone `hide` next to `open` would read oddly anyway.
function open(): void {
Osk.show();
}
function close(): void {
Osk.hide();
}
}
IpcHandler {
target: "bluetooth"
function toggle(): void {
Session.toggle("bluetooth", "");
}
function open(): void {
Session.open("bluetooth", "");
}
function close(): void {
Session.close();
}
}
}