Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/etc/sleex/hyprland/execs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ exec-once = wl-paste --type image --watch cliphist store

# Cursor
exec-once = hyprctl setcursor Bibata-Modern-Classic 24

# Onscreen Keyboard
exec-once = /usr/share/sleex/modules/virtualKeyboard/VirtualKeyboard.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a QS module, I don't understand why a script is necessary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for my ignorance and naivete.
The shell script detects multiple monitors and executes "quickshell -q [QML FILE]" but I infer from your comment that it is not the proper way of doing things.

Thank you for making me aware, I will certainly work on it to make the necessary changes.

128 changes: 128 additions & 0 deletions src/share/sleex/modules/virtualKeyboard/Notification.qml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it called Notification.qml ?

Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import Quickshell
import Quickshell.Io
import QtQuick

ShellRoot {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're creating a new shell instead of a shell element. Take inspiration on the dashboard to see how to make panels.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for providing your valued guidance. I truly appreciate these remarks of yours.

// Get the directory where this QML file is located
readonly property string configDir: Qt.resolvedUrl(".").toString().replace("file://", "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why asking where you currently are ?


PanelWindow {
id: buttonPanel

// **FIX:** Set the width and height of the PanelWindow
// to be exactly the same as its child (the pillButton).
// This stops the invisible PanelWindow from blocking clicks
// in a larger area than intended.
width: pillButton.width
height: pillButton.height
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so if I understand, you did a shell above the shell to put a floating button to open the keyboard ? You should have made a RippleButton on the bar to call a PanelWindow.


// Position at top-left of current monitor
anchors {
top: true
left: true
}
margins {
top: -35
left: 25
}

// Make the panel itself transparent
color: "transparent"

Rectangle {
id: pillButton

// Position with margin inside the panel
anchors {
top: parent.top
left: parent.left
}

// Pill dimensions
width: 70
height: 30
radius: 30

// Toggle between transparent and solid
color: isActive ? "#004F57" : "transparent"

// Track active state
property bool isActive: false

// The image inside
Image {
id: icon
anchors.centerIn: parent
source: configDir + "/icon.png"
width: 34
height: 34
}

// Click handler
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor

onClicked: {
// Toggle the active state
pillButton.isActive = !pillButton.isActive
console.log("Button clicked! Active state:", pillButton.isActive)

// Always run close first
processRunner.shouldRunOpen = pillButton.isActive
processRunner.runClose()
}
}
}

// Process runner
Item {
id: processRunner
property bool shouldRunOpen: false

function runClose() {
console.log("Running close...")
var closeProc = closeComponent.createObject(processRunner)
closeProc.running = true
}

function runOpen() {
console.log("Running open...")
var openProc = openComponent.createObject(processRunner)
openProc.running = true
}
}

// Close process component
Component {
id: closeComponent
Process {
command: ["sh", "-c", configDir + "/close"]

onExited: {
console.log("Close exited with code:", exitCode)

// If button is active, run open after close finishes
if (processRunner.shouldRunOpen) {
processRunner.runOpen()
}

destroy()
}
}
}

// Open process component
Component {
id: openComponent
Process {
command: ["sh", "-c", configDir + "/open"]

onExited: {
console.log("Open exited with code:", exitCode)
destroy()
}
}
}
}
}
Loading