diff --git a/config/hosts/aspects/doloro-desktop/home.nix b/config/hosts/aspects/doloro-desktop/home.nix index 3a16969..2d8f1b0 100644 --- a/config/hosts/aspects/doloro-desktop/home.nix +++ b/config/hosts/aspects/doloro-desktop/home.nix @@ -23,6 +23,7 @@ modules.helium modules.stylix + modules.quickshell ]; nixos = { config, pkgs, ... }: diff --git a/config/modules/quickshell/quickshell.nix b/config/modules/quickshell/quickshell.nix index bdc2059..a0e7906 100644 --- a/config/modules/quickshell/quickshell.nix +++ b/config/modules/quickshell/quickshell.nix @@ -2,11 +2,16 @@ { modules.quickshell = { homeManager = - { pkgs, ... }: + { + pkgs, + lib, + config, + ... + }: { xdg.configFile."quickshell" = { recursive = true; - source = pkgs.lib.file.mkOutOfStoreSymlink ./quickshell; + source = config.lib.file.mkOutOfStoreSymlink ./quickshell; }; systemd.user.services.quickshell = { Unit = { diff --git a/config/modules/quickshell/quickshell/Bar.qml b/config/modules/quickshell/quickshell/Bar.qml new file mode 100644 index 0000000..000541b --- /dev/null +++ b/config/modules/quickshell/quickshell/Bar.qml @@ -0,0 +1,36 @@ +// Bar.qml +import Quickshell +import Quickshell.Io +import QtQuick + +Scope { + id: root + + PanelWindow { + required property var modelData + screen: modelData + color: "transparent" + + anchors { + top: true + left: true + right: true + } + + implicitHeight: 20 + + Rectangle { + width: meow.width + height: meow.height + radius: 3.5 + + color: "white" + + anchors.centerIn: parent + Text { + id: meow + text: Clock.time + } + } + } +} diff --git a/config/modules/quickshell/quickshell/Clock.qml b/config/modules/quickshell/quickshell/Clock.qml new file mode 100644 index 0000000..11320c9 --- /dev/null +++ b/config/modules/quickshell/quickshell/Clock.qml @@ -0,0 +1,20 @@ +// Time.qml +pragma Singleton + +import Quickshell +import QtQuick + +Singleton { + id: root + // an expression can be broken across multiple lines using {} + readonly property string time: { + // The passed format string matches the default output of + // the `date` command. + Qt.formatDateTime(clock.date, "ddd MMM d hh:mm:ss AP t yyyy"); + } + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +} diff --git a/config/modules/quickshell/quickshell/shell.qml b/config/modules/quickshell/quickshell/shell.qml new file mode 100644 index 0000000..de0527e --- /dev/null +++ b/config/modules/quickshell/quickshell/shell.qml @@ -0,0 +1,5 @@ +import Quickshell + +Scope { + Bar {} +} diff --git a/config/modules/quickshell/quickshell/widgets/clock.qml b/config/modules/quickshell/quickshell/widgets/clock.qml new file mode 100644 index 0000000..4f6d4de --- /dev/null +++ b/config/modules/quickshell/quickshell/widgets/clock.qml @@ -0,0 +1,19 @@ +pragma Singleton + +import Quickshell +import QtQuick + +Singleton { + id: root + // an expression can be broken across multiple lines using {} + readonly property string time: { + // The passed format string matches the default output of + // the `date` command. + Qt.formatDateTime(clock.date, "ddd MMM d hh:mm:ss AP t yyyy"); + } + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +}