refine screen logic
This commit is contained in:
parent
d72adec2ef
commit
b6ae60e97c
@ -2,6 +2,6 @@ pragma Singleton
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
readonly property string font: "Iosevka Nerd Font Propo"
|
||||
readonly property string font: "CommitMono Nerd Font Propo"
|
||||
readonly property real fontSize: 14
|
||||
}
|
||||
|
||||
@ -2,12 +2,26 @@ pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import qs
|
||||
import "."
|
||||
import QtQuick.Layouts
|
||||
|
||||
WlrLayershell {
|
||||
id: root
|
||||
screen: {
|
||||
// Iterate through all connected Quickshell screens
|
||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||
let screenCandidate = Quickshell.screens[i];
|
||||
console.log(Quickshell.screens[i])
|
||||
|
||||
// Ask: "Is this screen the one Hyprland is currently focusing?"
|
||||
if (Hyprland.monitorFor(screenCandidate) === Hyprland.focusedMonitor) {
|
||||
return screenCandidate;
|
||||
}
|
||||
}
|
||||
return null; // Fallback (should rarely happen)
|
||||
}
|
||||
|
||||
// 1. Position: Top Right Corner, covering the full height
|
||||
// We make it a fixed width (e.g., 400px) so it doesn't block the whole screen
|
||||
|
||||
@ -5,6 +5,7 @@ import "../../"
|
||||
import "."
|
||||
|
||||
WlrLayershell {
|
||||
required property var modelData
|
||||
id: overlayRoot
|
||||
|
||||
// 1. Fill the entire screen
|
||||
|
||||
@ -15,8 +15,7 @@ WlrLayershell {
|
||||
}
|
||||
|
||||
// We need to accept the screen from Variants
|
||||
property var screen
|
||||
property var modelData
|
||||
required property var modelData
|
||||
|
||||
// 1. The StackView manages the images
|
||||
StackView {
|
||||
|
||||
@ -21,7 +21,7 @@ QtObject {
|
||||
JsonAdapter {
|
||||
id: adapter
|
||||
// This property corresponds to a key in your JSON file!
|
||||
property string lastWallpaper: "/home/lucy/.walls/frieren_river.jpg"
|
||||
property string lastWallpaper: "/home/lucy/.walls/mooon.png"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
29
shell.qml
29
shell.qml
@ -1,23 +1,32 @@
|
||||
//@ pragma UseQApplication
|
||||
//pragma ComponentBehavior: Bound
|
||||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import "./modules/bar/"
|
||||
import "./modules/wallpaper/"
|
||||
import "./modules/notifications/"
|
||||
|
||||
Scope {
|
||||
ShellRoot {
|
||||
WallSwitcher {}
|
||||
Variants {
|
||||
id: wallVariants
|
||||
model: Quickshell.screens
|
||||
delegate: Wallpaper {}
|
||||
}
|
||||
Variants {
|
||||
id: barVariants
|
||||
model: Quickshell.screens
|
||||
delegate: Bar {}
|
||||
delegate: Bar {
|
||||
screen: modelData
|
||||
}
|
||||
}
|
||||
NotiPopup {}
|
||||
Overlay {}
|
||||
Variants {
|
||||
id: overlayVariants
|
||||
model: Quickshell.screens
|
||||
delegate: Overlay {
|
||||
screen: modelData
|
||||
}
|
||||
}
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
id: wallVariants
|
||||
delegate: Wallpaper {
|
||||
screen: modelData
|
||||
}
|
||||
}
|
||||
NotiPopup { }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user