Rename appLauncher IPC to launcher, add calculator IPC
This commit is contained in:
parent
1f9dec3e4c
commit
c3515ddcc0
3 changed files with 69 additions and 37 deletions
|
|
@ -8,7 +8,6 @@ Item {
|
|||
|
||||
IpcHandler {
|
||||
target: "settings"
|
||||
|
||||
function toggle() {
|
||||
settingsPanel.toggle(Quickshell.screens[0])
|
||||
}
|
||||
|
|
@ -16,18 +15,16 @@ Item {
|
|||
|
||||
IpcHandler {
|
||||
target: "notifications"
|
||||
|
||||
function toggleHistory() {
|
||||
notificationHistoryPanel.toggle(Quickshell.screens[0])
|
||||
}
|
||||
|
||||
function toggleDoNotDisturb() {// TODO
|
||||
function toggleDoNotDisturb() {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "idleInhibitor"
|
||||
|
||||
function toggle() {
|
||||
return IdleInhibitorService.manualToggle()
|
||||
}
|
||||
|
|
@ -35,28 +32,48 @@ Item {
|
|||
|
||||
IpcHandler {
|
||||
target: "appLauncher"
|
||||
|
||||
function toggle() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
}
|
||||
|
||||
function clipboard() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
launcherPanel.searchText = ">clip "
|
||||
// Use the setSearchText function to set clipboard mode
|
||||
Qt.callLater(() => {
|
||||
launcherPanel.setSearchText(">clip ")
|
||||
})
|
||||
}
|
||||
function calculator() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
// Use the setSearchText function to set calculator mode
|
||||
Qt.callLater(() => {
|
||||
launcherPanel.setSearchText(">calc ")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "launcher"
|
||||
|
||||
function toggle() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
}
|
||||
function clipboard() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
// Use the setSearchText function to set clipboard mode
|
||||
Qt.callLater(() => {
|
||||
launcherPanel.setSearchText(">clip ")
|
||||
})
|
||||
}
|
||||
function calculator() {
|
||||
launcherPanel.toggle(Quickshell.screens[0])
|
||||
// Use the setSearchText function to set calculator mode
|
||||
Qt.callLater(() => {
|
||||
launcherPanel.setSearchText(">calc ")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "lockScreen"
|
||||
|
||||
function toggle() {
|
||||
// Only lock if not already locked (prevents the red screen issue)
|
||||
// Note: No unlock via IPC for security reasons
|
||||
|
|
@ -68,11 +85,9 @@ Item {
|
|||
|
||||
IpcHandler {
|
||||
target: "brightness"
|
||||
|
||||
function increase() {
|
||||
BrightnessService.increaseBrightness()
|
||||
}
|
||||
|
||||
function decrease() {
|
||||
BrightnessService.decreaseBrightness()
|
||||
}
|
||||
|
|
@ -80,11 +95,8 @@ Item {
|
|||
|
||||
IpcHandler {
|
||||
target: "powerPanel"
|
||||
|
||||
function toggle() {
|
||||
powerPanel.toggle(Quickshell.screens[0])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -24,11 +24,29 @@ NPanel {
|
|||
panelAnchorLeft: launcherPosition !== "center" && (launcherPosition.endsWith("_left"))
|
||||
panelAnchorRight: launcherPosition !== "center" && (launcherPosition.endsWith("_right"))
|
||||
|
||||
// Properties
|
||||
property string searchText: ""
|
||||
|
||||
// Add function to set search text programmatically
|
||||
function setSearchText(text) {
|
||||
searchText = text
|
||||
if (searchInput) {
|
||||
searchInput.text = text
|
||||
searchInput.cursorPosition = text.length
|
||||
searchInput.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
onOpened: {
|
||||
// Reset state when panel opens to avoid sticky modes
|
||||
if (searchText === "") {
|
||||
searchText = ""
|
||||
selectedIndex = 0
|
||||
}
|
||||
if (searchInput) {
|
||||
searchInput.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
// Import modular components
|
||||
Calculator {
|
||||
|
|
@ -50,7 +68,6 @@ NPanel {
|
|||
|
||||
// Properties
|
||||
property var desktopEntries: DesktopEntries.applications.values
|
||||
property string searchText: ""
|
||||
property int selectedIndex: 0
|
||||
|
||||
// Refresh clipboard when user starts typing clipboard commands
|
||||
|
|
@ -141,15 +158,11 @@ NPanel {
|
|||
|
||||
// Command execution functions
|
||||
function executeCalcCommand() {
|
||||
searchText = ">calc "
|
||||
searchInput.text = searchText
|
||||
searchInput.cursorPosition = searchText.length
|
||||
setSearchText(">calc ")
|
||||
}
|
||||
|
||||
function executeClipCommand() {
|
||||
searchText = ">clip "
|
||||
searchInput.text = searchText
|
||||
searchInput.cursorPosition = searchText.length
|
||||
setSearchText(">clip ")
|
||||
}
|
||||
|
||||
// Navigation functions
|
||||
|
|
@ -252,8 +265,12 @@ NPanel {
|
|||
anchors.leftMargin: Style.marginS * scaling
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: searchText
|
||||
onTextChanged: {
|
||||
// Update the parent searchText property
|
||||
if (searchText !== text) {
|
||||
searchText = text
|
||||
}
|
||||
// Defer selectedIndex reset to avoid binding loops
|
||||
Qt.callLater(() => selectedIndex = 0)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,10 +101,13 @@ mkdir -p ~/.config/quickshell && curl -sL https://github.com/noctalia-dev/noctal
|
|||
qs
|
||||
|
||||
# Launcher
|
||||
qs ipc call appLauncher toggle
|
||||
qs ipc call launcher toggle
|
||||
|
||||
# Clipboard History
|
||||
qs ipc call appLauncher clipboard
|
||||
qs ipc call launcher clipboard
|
||||
|
||||
# Calculator
|
||||
qs ipc call launcher calculator
|
||||
|
||||
# Brightness
|
||||
qs ipc call brightness increase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue