quickshell: a bunch of changes
This commit is contained in:
parent
8c6b9f65c9
commit
b82a3580ec
11 changed files with 137 additions and 100 deletions
|
@ -19,6 +19,11 @@ in {
|
||||||
qt6.qt5compat
|
qt6.qt5compat
|
||||||
qt6.qtmultimedia
|
qt6.qtmultimedia
|
||||||
qt6.qtdeclarative
|
qt6.qtdeclarative
|
||||||
|
qt6.qtsvg
|
||||||
|
qt6.qtwayland
|
||||||
|
qt6.qtbase
|
||||||
|
kdePackages.breeze
|
||||||
|
kdePackages.breeze-icons
|
||||||
];
|
];
|
||||||
|
|
||||||
# taken from outfoxxed.
|
# taken from outfoxxed.
|
||||||
|
|
|
@ -1,103 +1,105 @@
|
||||||
pragma Singleton
|
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Services.Pipewire
|
import Quickshell.Services.Pipewire
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
|
import qs.config
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: audioPopup
|
id: root
|
||||||
property bool popupOpen: true
|
|
||||||
|
|
||||||
property var volume: sink.ready ? audioPopup.sink.audio.volume : 0
|
property real volume: Pipewire.defaultAudioSink?.audio?.volume ?? 0
|
||||||
|
property real popupOpacity: 0
|
||||||
|
|
||||||
property var visible: volume
|
|
||||||
|
|
||||||
property PwNode sink: Pipewire.defaultAudioSink
|
|
||||||
|
|
||||||
// bind the node so we can read its properties
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: [audioPopup.sink]
|
objects: [Pipewire.defaultAudioSink]
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
onVolumeChanged: {
|
||||||
id: timer
|
root.popupOpacity = 1;
|
||||||
interval: 3000
|
loader.activeAsync = true;
|
||||||
running: false
|
timer.restart();
|
||||||
repeat: false
|
timer_opacity.restart();
|
||||||
|
|
||||||
onTriggered: audioPopup.visible = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LazyLoader {
|
LazyLoader {
|
||||||
id: loader
|
id: loader
|
||||||
activeAsync: audioPopup.popupOpen
|
activeAsync: false
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: popup
|
id: popup
|
||||||
width: 400
|
|
||||||
height: 30
|
|
||||||
visible: true
|
visible: true
|
||||||
|
implicitWidth: rect.implicitWidth
|
||||||
// Give the window an empty click mask so all clicks pass through it.
|
implicitHeight: 50
|
||||||
|
color: "transparent"
|
||||||
mask: Region {}
|
mask: Region {}
|
||||||
|
exclusionMode: ExclusionMode.Ignore
|
||||||
// Use the wlroots specific layer property to ensure it displays over
|
|
||||||
// fullscreen windows.
|
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
|
|
||||||
color: "transparent"
|
anchors.bottom: true
|
||||||
|
margins.bottom: 100
|
||||||
anchors {
|
|
||||||
bottom: true
|
|
||||||
}
|
|
||||||
|
|
||||||
margins {
|
|
||||||
bottom: 250
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rect
|
id: rect
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.fill: parent
|
||||||
color: "white"
|
color: Colors.surface0
|
||||||
height: parent.height
|
implicitWidth: 300
|
||||||
width: parent.width
|
implicitHeight: parent.implicitHeight
|
||||||
radius: 5
|
radius: 5
|
||||||
opacity: 0
|
opacity: root.popupOpacity
|
||||||
|
|
||||||
anchors {
|
Behavior on opacity {
|
||||||
left: parent.left
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on width {
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 200
|
duration: 500
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "black"
|
id: bar
|
||||||
height: 20
|
color: Colors.blue
|
||||||
radius: height / 2
|
implicitWidth: rect.implicitWidth * root.volume - 20
|
||||||
|
implicitHeight: 30
|
||||||
|
topRightRadius: 5
|
||||||
|
bottomRightRadius: 5
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
topLeftRadius: 0
|
Behavior on implicitWidth {
|
||||||
bottomLeftRadius: 0
|
NumberAnimation {
|
||||||
|
duration: 300
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
easing.type: Easing.OutCubic
|
||||||
width: parent.width * audioPopup.sink.audio.volume
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: timer
|
||||||
|
interval: 2000
|
||||||
|
running: false
|
||||||
|
onTriggered: loader.activeAsync = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: timer_opacity
|
||||||
|
interval: 1500
|
||||||
|
running: false
|
||||||
|
onTriggered: {
|
||||||
|
root.popupOpacity = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,9 +49,9 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: 450
|
width: 450
|
||||||
color: Config.catppuccin.base
|
color: Colors.base
|
||||||
radius: 5
|
radius: 5
|
||||||
border.color: Config.catppuccin.mantle
|
border.color: Colors.mantle
|
||||||
border.width: 2
|
border.width: 2
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
@ -64,9 +64,9 @@ Singleton {
|
||||||
id: searchContainer
|
id: searchContainer
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: searchbox.implicitHeight + 10
|
implicitHeight: searchbox.implicitHeight + 10
|
||||||
color: Config.catppuccin.base
|
color: Colors.base
|
||||||
radius: 3
|
radius: 3
|
||||||
border.color: Config.catppuccin.mantle
|
border.color: Colors.mantle
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: searchbox
|
id: searchbox
|
||||||
|
@ -76,7 +76,7 @@ Singleton {
|
||||||
TextInput {
|
TextInput {
|
||||||
id: search
|
id: search
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Config.catppuccin.text
|
color: Colors.text
|
||||||
font.pointSize: 13
|
font.pointSize: 13
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
|
@ -252,7 +252,7 @@ Singleton {
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
radius: 5
|
radius: 5
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.color: Config.catppuccin.lavender
|
border.color: Colors.lavender
|
||||||
border.width: 2
|
border.width: 2
|
||||||
}
|
}
|
||||||
keyNavigationEnabled: true
|
keyNavigationEnabled: true
|
||||||
|
@ -293,7 +293,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
text: modelData.name
|
text: modelData.name
|
||||||
color: Config.catppuccin.text
|
color: Colors.text
|
||||||
font.family: "JetBrainsMono Nerd Font Mono"
|
font.family: "JetBrainsMono Nerd Font Mono"
|
||||||
font.pointSize: 13
|
font.pointSize: 13
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
|
@ -106,7 +106,7 @@ Scope {
|
||||||
property: "width"
|
property: "width"
|
||||||
from: rect.width
|
from: rect.width
|
||||||
to: 0
|
to: 0
|
||||||
duration: failed ? 10000 : 800
|
duration: root.failed ? 10000 : 800
|
||||||
onFinished: popupLoader.active = false
|
onFinished: popupLoader.active = false
|
||||||
|
|
||||||
// Pause the animation when the mouse is hovering over the popup,
|
// Pause the animation when the mouse is hovering over the popup,
|
||||||
|
|
25
modules/style/quickshell/shell/config/Colors.qml
Normal file
25
modules/style/quickshell/shell/config/Colors.qml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property color base: "#1e1e2e"
|
||||||
|
readonly property color mantle: "#181825"
|
||||||
|
readonly property color surface0: "#313244"
|
||||||
|
readonly property color surface1: "#45475a"
|
||||||
|
readonly property color surface2: "#585b70"
|
||||||
|
readonly property color text: "#cdd6f4"
|
||||||
|
readonly property color rosewater: "#f5e0dc"
|
||||||
|
readonly property color lavender: "#b4befe"
|
||||||
|
readonly property color red: "#f38ba8"
|
||||||
|
readonly property color peach: "#fab387"
|
||||||
|
readonly property color yellow: "#f9e2af"
|
||||||
|
readonly property color green: "#a6e3a1"
|
||||||
|
readonly property color teal: "#a6e3a1"
|
||||||
|
readonly property color blue: "#89b4fa"
|
||||||
|
readonly property color mauve: "#cba6f7"
|
||||||
|
readonly property color flamingo: "#f2cdcd"
|
||||||
|
}
|
|
@ -25,24 +25,6 @@ Singleton {
|
||||||
readonly property int rounding: 0
|
readonly property int rounding: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property QtObject catppuccin: QtObject {
|
|
||||||
readonly property color base: "#1e1e2e"
|
|
||||||
readonly property color mantle: "#181825"
|
|
||||||
readonly property color surface0: "#313244"
|
|
||||||
readonly property color surface1: "#45475a"
|
|
||||||
readonly property color surface2: "#585b70"
|
|
||||||
readonly property color text: "#cdd6f4"
|
|
||||||
readonly property color rosewater: "#f5e0dc"
|
|
||||||
readonly property color lavender: "#b4befe"
|
|
||||||
readonly property color red: "#f38ba8"
|
|
||||||
readonly property color peach: "#fab387"
|
|
||||||
readonly property color yellow: "#f9e2af"
|
|
||||||
readonly property color green: "#a6e3a1"
|
|
||||||
readonly property color teal: "#a6e3a1"
|
|
||||||
readonly property color blue: "#89b4fa"
|
|
||||||
readonly property color mauve: "#cba6f7"
|
|
||||||
readonly property color flamingo: "#f2cdcd"
|
|
||||||
}
|
|
||||||
readonly property QtObject volumeslider: QtObject {
|
readonly property QtObject volumeslider: QtObject {
|
||||||
readonly property int width: 50
|
readonly property int width: 50
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
import Qt.labs.folderlistmodel 2.9
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
|
@ -9,6 +10,24 @@ PanelWindow {
|
||||||
WlrLayershell.layer: WlrLayer.Background
|
WlrLayershell.layer: WlrLayer.Background
|
||||||
WlrLayershell.namespace: "shell:background"
|
WlrLayershell.namespace: "shell:background"
|
||||||
|
|
||||||
|
// property string basePath: "file:///home/cr/Documents/Backgrounds/"
|
||||||
|
// property var absPath: folderModel.get(Math.floor(Math.random() * folderModel.count), "filePath")
|
||||||
|
// property var finalPath: absPath
|
||||||
|
|
||||||
|
// property bool _: log()
|
||||||
|
// function log() {
|
||||||
|
// console.log(absPath);
|
||||||
|
// console.log(folderModel.count);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
FolderListModel {
|
||||||
|
id: folderModel
|
||||||
|
// folder: root.basePath
|
||||||
|
nameFilters: ["*.png"]
|
||||||
|
showDirs: false
|
||||||
|
showFiles: true
|
||||||
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
bottom: true
|
bottom: true
|
||||||
|
@ -16,13 +35,21 @@ PanelWindow {
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
// Item {
|
||||||
id: background
|
// id: background
|
||||||
anchors.fill: parent
|
// anchors.fill: parent
|
||||||
Image {
|
// Image {
|
||||||
id: image
|
// id: image
|
||||||
asynchronous: true
|
// source: Qt.resolvedUrl(root.finalPath)
|
||||||
source: "/home/cr/repos/projects/nichts/modules/style/wholefoods.png"
|
// }
|
||||||
|
// }
|
||||||
|
Timer {
|
||||||
|
id: timer
|
||||||
|
// 10 minutes
|
||||||
|
interval: 1000 * 60 * 10
|
||||||
|
running: false
|
||||||
|
onTriggered: {
|
||||||
|
root.popupOpacity = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ Rectangle {
|
||||||
width: text.width + 5
|
width: text.width + 5
|
||||||
height: text.height + 5
|
height: text.height + 5
|
||||||
implicitWidth: width
|
implicitWidth: width
|
||||||
border.color: Config.catppuccin.rosewater
|
border.color: Colors.rosewater
|
||||||
border.width: 0
|
border.width: 0
|
||||||
radius: 5
|
radius: 5
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
@ -24,7 +24,7 @@ Rectangle {
|
||||||
font.family: "JetBrainsMono NF Mono"
|
font.family: "JetBrainsMono NF Mono"
|
||||||
font.pointSize: 15
|
font.pointSize: 15
|
||||||
|
|
||||||
color: Config.catppuccin.text
|
color: Colors.text
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemClock {
|
SystemClock {
|
||||||
|
|
|
@ -36,7 +36,7 @@ Rectangle {
|
||||||
// height: workspaces.length * root.wsItemHeight
|
// height: workspaces.length * root.wsItemHeight
|
||||||
implicitWidth: list.implicitWidth
|
implicitWidth: list.implicitWidth
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.color: Config.catppuccin.rosewater
|
border.color: Colors.rosewater
|
||||||
border.width: 0
|
border.width: 0
|
||||||
radius: 7
|
radius: 7
|
||||||
|
|
||||||
|
@ -93,9 +93,9 @@ Rectangle {
|
||||||
height: wsItem.height - 5
|
height: wsItem.height - 5
|
||||||
width: parent.width * wsItem.animActive
|
width: parent.width * wsItem.animActive
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
border.color: Config.catppuccin.mantle
|
border.color: Colors.mantle
|
||||||
border.width: 0
|
border.width: 0
|
||||||
color: Config.catppuccin.blue
|
color: Colors.blue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ import Quickshell.Wayland
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
|
|
||||||
import "../bar"
|
import qs.modules.bar
|
||||||
|
|
||||||
import "../../config"
|
import qs.config
|
||||||
import "../"
|
import qs.modules
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||||
//@ pragma Env QT_QML_GENERATE_QMLLS_INI
|
|
||||||
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
@ -10,10 +9,7 @@ import qs
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
id: shellroot
|
id: shellroot
|
||||||
|
|
||||||
Component.onCompleted: [Launcher.init()]
|
Component.onCompleted: [Launcher.init(), AudioPopup.init()]
|
||||||
|
|
||||||
Drawers {}
|
Drawers {}
|
||||||
// Background {}Popup
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue