forked from Shinonome/alt-illogical-impulse
Make flake self-contained - consolidate installer-replication
BREAKING CHANGE: Remove external dots-hyprland dependency - Imported all essential configs from dots-hyprland/installer-replication - Added complete configs/ directory with: - hypr/ - Hyprland configuration - quickshell/ - Quickshell widgets and config - applications/ - Application configurations - scripts/ - Utility scripts - matugen/ - Material You theming - Updated flake.nix to use local ./configs instead of external repo - Simplified update-flake script (removed external repo management) - Updated README to reflect self-contained architecture - All builds pass with local configurations Benefits: - No external repository dependencies - Faster builds (no network dependencies) - Version controlled configs in single repo - Easier maintenance and development - Complete installer replication in one place
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
import qs
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Io
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Scope { // Scope
|
||||
id: root
|
||||
property bool pinned: Config.options?.osk.pinnedOnStartup ?? false
|
||||
|
||||
component OskControlButton: GroupButton { // Pin button
|
||||
baseWidth: 40
|
||||
baseHeight: 40
|
||||
clickedWidth: baseWidth
|
||||
clickedHeight: baseHeight + 20
|
||||
buttonRadius: Appearance.rounding.normal
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: oskLoader
|
||||
active: GlobalStates.oskOpen
|
||||
onActiveChanged: {
|
||||
if (!oskLoader.active) {
|
||||
Ydotool.releaseAllKeys();
|
||||
}
|
||||
}
|
||||
|
||||
sourceComponent: PanelWindow { // Window
|
||||
id: oskRoot
|
||||
visible: oskLoader.active && !GlobalStates.screenLocked
|
||||
|
||||
anchors {
|
||||
bottom: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
oskLoader.active = false
|
||||
}
|
||||
exclusiveZone: root.pinned ? implicitHeight - Appearance.sizes.hyprlandGapsOut : 0
|
||||
implicitWidth: oskBackground.width + Appearance.sizes.elevationMargin * 2
|
||||
implicitHeight: oskBackground.height + Appearance.sizes.elevationMargin * 2
|
||||
WlrLayershell.namespace: "quickshell:osk"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
// Hyprland 0.49: Focus is always exclusive and setting this breaks mouse focus grab
|
||||
// WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||
color: "transparent"
|
||||
|
||||
mask: Region {
|
||||
item: oskBackground
|
||||
}
|
||||
|
||||
|
||||
// Background
|
||||
StyledRectangularShadow {
|
||||
target: oskBackground
|
||||
}
|
||||
Rectangle {
|
||||
id: oskBackground
|
||||
anchors.centerIn: parent
|
||||
color: Appearance.colors.colLayer0
|
||||
radius: Appearance.rounding.windowRounding
|
||||
property real padding: 10
|
||||
implicitWidth: oskRowLayout.implicitWidth + padding * 2
|
||||
implicitHeight: oskRowLayout.implicitHeight + padding * 2
|
||||
|
||||
Keys.onPressed: (event) => { // Esc to close
|
||||
if (event.key === Qt.Key_Escape) {
|
||||
oskRoot.hide()
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: oskRowLayout
|
||||
anchors.centerIn: parent
|
||||
spacing: 5
|
||||
VerticalButtonGroup {
|
||||
OskControlButton { // Pin button
|
||||
toggled: root.pinned
|
||||
onClicked: root.pinned = !root.pinned
|
||||
contentItem: MaterialSymbol {
|
||||
text: "keep"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
iconSize: Appearance.font.pixelSize.larger
|
||||
color: root.pinned ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer0
|
||||
}
|
||||
}
|
||||
OskControlButton {
|
||||
onClicked: () => {
|
||||
oskRoot.hide()
|
||||
}
|
||||
contentItem: MaterialSymbol {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "keyboard_hide"
|
||||
iconSize: Appearance.font.pixelSize.larger
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
Layout.topMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: 1
|
||||
color: Appearance.colors.colOutlineVariant
|
||||
}
|
||||
OskContent {
|
||||
id: oskContent
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "osk"
|
||||
|
||||
function toggle(): void {
|
||||
GlobalStates.oskOpen = !GlobalStates.oskOpen;
|
||||
}
|
||||
|
||||
function close(): void {
|
||||
GlobalStates.oskOpen = false
|
||||
}
|
||||
|
||||
function open(): void {
|
||||
GlobalStates.oskOpen = true
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "oskToggle"
|
||||
description: "Toggles on screen keyboard on press"
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.oskOpen = !GlobalStates.oskOpen;
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "oskOpen"
|
||||
description: "Opens on screen keyboard on press"
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.oskOpen = true
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "oskClose"
|
||||
description: "Closes on screen keyboard on press"
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.oskOpen = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user