feat(terra): launcher most-used sort, power buttons, SUPER opens rail
- Launcher sorts by launch count by default (persisted in quickshell's state dir); Ctrl+S or the sort chip toggles A–Z. - Logout/Reboot/Shutdown in the footer, each needing a confirming click. - SUPER now opens the launcher with the rail expanded; closing the launcher collapses the rail again unless it was already open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import Quickshell.Wayland
|
||||
import QtQuick
|
||||
import qs.HyprChrome.Theme
|
||||
|
||||
// Primary application launcher — the one on SUPER_L.
|
||||
// Primary application launcher — the one on SUPER_L (via HyprChromeShell).
|
||||
//
|
||||
// Migrated from widgets/launcher/ApplicationLauncher.qml. Two things changed in
|
||||
// the move, both because HyprChromeShell now owns the state its surfaces share:
|
||||
@@ -34,11 +34,8 @@ Scope {
|
||||
function toggle() { root.active = !root.active; }
|
||||
function close() { root.active = false; }
|
||||
|
||||
// The name is legacy: this was "variant 8" of eleven, and both SUPER_L (via
|
||||
// open_launcher.sh) and SUPER CTRL 8 still dispatch quickshell:launcher8.
|
||||
// Renaming it means editing hosts/terra/home/hyprland.nix AND the script
|
||||
// together, and neither takes effect until a deploy — so the shortcut would
|
||||
// be dead in the running session in between. Kept as-is deliberately.
|
||||
// Launcher alone, on SUPER CTRL 8. SUPER_L goes through the shell's
|
||||
// `command` shortcut instead, which also expands the rail.
|
||||
GlobalShortcut {
|
||||
name: "launcher8"
|
||||
description: "Toggle dense application command index"
|
||||
@@ -83,9 +80,22 @@ Scope {
|
||||
root.active = false;
|
||||
}
|
||||
|
||||
// Hyprland runs a Lua config, which rejects a bare `dispatch exit`.
|
||||
readonly property var powerCommands: ({
|
||||
logout: ["hyprctl", "dispatch", "hl.dsp.exit()"],
|
||||
reboot: ["systemctl", "reboot"],
|
||||
shutdown: ["systemctl", "poweroff"]
|
||||
})
|
||||
|
||||
function power(action) {
|
||||
root.active = false;
|
||||
Quickshell.execDetached(win.powerCommands[action]);
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
content.clearSearch();
|
||||
content.disarmPower();
|
||||
selectedIndex = 0;
|
||||
content.focusSearch();
|
||||
}
|
||||
@@ -115,11 +125,17 @@ Scope {
|
||||
transformOrigin: Item.Center
|
||||
apps: model.apps
|
||||
selectedIndex: win.selectedIndex
|
||||
sortMode: model.sortMode
|
||||
|
||||
onSelectionRequested: index => win.selectedIndex = win.clampSelection(index)
|
||||
onMoveRequested: delta => win.move(delta)
|
||||
onLaunchRequested: index => win.launch(index)
|
||||
onDismissRequested: root.close()
|
||||
onSortToggleRequested: {
|
||||
model.toggleSort();
|
||||
win.selectedIndex = 0;
|
||||
}
|
||||
onPowerRequested: action => win.power(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user