diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfbea23 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.qmlls.ini diff --git a/shell/ReloadPopup.qml b/ReloadPopup.qml similarity index 100% rename from shell/ReloadPopup.qml rename to ReloadPopup.qml diff --git a/shell/assets/triangle-alert.svg b/assets/triangle-alert.svg similarity index 100% rename from shell/assets/triangle-alert.svg rename to assets/triangle-alert.svg diff --git a/shell/assets/triangle-dashed.svg b/assets/triangle-dashed.svg similarity index 100% rename from shell/assets/triangle-dashed.svg rename to assets/triangle-dashed.svg diff --git a/shell/assets/triangle.svg b/assets/triangle.svg similarity index 100% rename from shell/assets/triangle.svg rename to assets/triangle.svg diff --git a/config/Paths.qml b/config/Paths.qml new file mode 100644 index 0000000..3e93bf5 --- /dev/null +++ b/config/Paths.qml @@ -0,0 +1,13 @@ +import Quickshell + +Singleton { + id: root + + readonly property url home: StandardPaths.standardLocations(StandardPaths.)[0] + readonly property url wallpapers: `${StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]}/Wallpapers` + + readonly property url data: `${StandardPaths.standardLocations(StandardPaths.GenericDataLocation)[0]}/lux` + readonly property url state: `${StandardPaths.standardLocations(StandardPaths.GenericStateLocation)[0]}/lux` + readonly property url cache: `${StandardPaths.standardLocations(StandardPaths.GenericCacheLocation)[0]}/lux` + readonly property url config: `${StandardPaths.standardLocations(StandardPaths.GenericConfigLocation)[0]}/quickshell` +} diff --git a/config/Theme.qml b/config/Theme.qml new file mode 100644 index 0000000..5bf1bf5 --- /dev/null +++ b/config/Theme.qml @@ -0,0 +1,29 @@ +pragma Singleton + +import QtQml +import QtQuick +import Quickshell + +Singleton { + id: root + + property string fontFamily: "JetBrainsMono Nerd Font" + property Palette palette: Palette {} + + component Palette: QtObject { + id: palette + + property color primary: "#1fb854" + property color secondary: "#1eb88e" + property color accent: "#1fb8ab" + property color neutral: "#19362d" + property color base100: "#1b1717" + property color base200: "#161212" + property color base300: "#110d0d" + property color basecontent: "#cac9c9" + property color info: "#00b5ff" + property color success: "#00a96e" + property color warning: "#ffbe00" + property color error: "#ff5861" + } +} diff --git a/shell/modules/background/Background.qml b/modules/background/Background.qml similarity index 96% rename from shell/modules/background/Background.qml rename to modules/background/Background.qml index 343ff38..bc4bc35 100644 --- a/shell/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -1,7 +1,7 @@ import QtQuick import Quickshell import Quickshell.Wayland -import "../../widgets" +import "root:styled" Variants { model: Quickshell.screens diff --git a/shell/modules/bar/Bar.qml b/modules/bar/Bar.qml similarity index 89% rename from shell/modules/bar/Bar.qml rename to modules/bar/Bar.qml index cbc1717..e3de268 100644 --- a/shell/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -1,7 +1,7 @@ import QtQuick import Quickshell import "components" -import "../../config" +import "../../config/" Scope { PanelWindow { @@ -13,13 +13,14 @@ Scope { right: true } - implicitHeight: 30 + implicitHeight: 40 color: 'transparent' Rectangle { + id: background anchors.fill: parent - color: Colours.palette.base100 + color: Theme.palette.base300 } Row { diff --git a/shell/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml similarity index 90% rename from shell/modules/bar/components/Clock.qml rename to modules/bar/components/Clock.qml index d5df94b..fbb65fa 100644 --- a/shell/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -1,6 +1,7 @@ import Quickshell import Quickshell.Io import QtQuick +import "root:styled" Item { id: clock @@ -8,19 +9,14 @@ Item { implicitWidth: 200 implicitHeight: 30 - Rectangle { + StyledLabel { anchors.fill: parent - color: "#333" - opacity: 0.5 - radius: 5 } - Text { + StyledText { id: text anchors.centerIn: parent - color: "white" - Process { // give the process object an id so we can talk // about it from the timer diff --git a/modules/bar/components/Workspace.qml b/modules/bar/components/Workspace.qml new file mode 100644 index 0000000..e48780d --- /dev/null +++ b/modules/bar/components/Workspace.qml @@ -0,0 +1,38 @@ +import QtQuick +import QtQuick.Controls +import Quickshell.Hyprland +import "../../../config" + +Item { + id: workspace + + required property HyprlandWorkspace modelData + + visible: modelData.id > 0 + + width: 30 + height: 30 + + Button { + id: button + anchors.centerIn: parent + + padding: 6 + leftPadding: 7 + rightPadding: 7 + + background: Rectangle { + id: rectangle + anchors.fill: parent + color: "#161212" + radius: 8 + } + + rotation: workspace.modelData.active ? 0 : 180 + + icon.source: "/home/baobeld/dotfiles/quickshell/assets/triangle.svg" + icon.color: workspace.modelData.active ? Theme.palette.primary : Theme.palette.basecontent + + onClicked: workspace.modelData.activate() + } +} diff --git a/modules/bar/components/Workspaces.qml b/modules/bar/components/Workspaces.qml new file mode 100644 index 0000000..ceef72b --- /dev/null +++ b/modules/bar/components/Workspaces.qml @@ -0,0 +1,16 @@ +import QtQuick +import QtQuick.Controls +import Quickshell.Hyprland + +Row { + id: root + + spacing: 4 + + Repeater { + + model: Hyprland.workspaces + + Workspace {} + } +} diff --git a/shell/shell.qml b/shell.qml similarity index 100% rename from shell/shell.qml rename to shell.qml diff --git a/shell/modules/bar/components/Workspaces.qml b/shell/modules/bar/components/Workspaces.qml deleted file mode 100644 index 4a69735..0000000 --- a/shell/modules/bar/components/Workspaces.qml +++ /dev/null @@ -1,51 +0,0 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.VectorImage -import Quickshell.Hyprland -import "../../../config" - -Row { - id: root - - spacing: 4 - - Repeater { - - model: Hyprland.workspaces - - Item { - id: workspace - - required property HyprlandWorkspace modelData - - visible: modelData.id > 0 - - width: 25 - height: 25 - - Rectangle { - id: rectangle - - anchors.verticalCenter: parent.verticalCenter - anchors.fill: parent - color: "#161212" - radius: 8 - } - - Button { - id: button - anchors.centerIn: parent - anchors.fill: parent - - rotation: workspace.modelData.active ? 0 : 180 - - icon.source: "/home/baobeld/dotfiles/quickshell/shell/assets/triangle.svg" - icon.color: "#1fb854" - - // palette.button: QtColor. - - onClicked: workspace.modelData.activate() - } - } - } -} diff --git a/styled/StyledLabel.qml b/styled/StyledLabel.qml new file mode 100644 index 0000000..9e785ac --- /dev/null +++ b/styled/StyledLabel.qml @@ -0,0 +1,8 @@ +import QtQuick +import "root:config" + +Rectangle { + color: Theme.palette.base100 + + radius: 5 +} diff --git a/styled/StyledText.qml b/styled/StyledText.qml new file mode 100644 index 0000000..838d6ef --- /dev/null +++ b/styled/StyledText.qml @@ -0,0 +1,6 @@ +import QtQuick +import "root:config" + +Text { + color: Theme.palette.basecontent +} diff --git a/shell/widgets/StyledWindow.qml b/styled/StyledWindow.qml similarity index 100% rename from shell/widgets/StyledWindow.qml rename to styled/StyledWindow.qml