fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Install lucid

This commit is contained in:
Sweetbread committed 2026-11-04 06:41:43 +03:00
1 parent 49dbc262df
commit 09178a7f3a
15 files changed
+394 -25

No files matched your search

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -21,18 +21,23 @@ Variants {
active: layer.visible
}
readonly property bool suppressed: Prefs.widgetHideFullscreen && layer.fullscreenUp
readonly property bool suppressed: Prefs.widgetHideFullscreen && layer.windowUp
readonly property var workspaceMonitor: Hyprland.monitorFor(layer.screen)
readonly property var activeWorkspace: workspaceMonitor ? workspaceMonitor.activeWorkspace : null
readonly property bool fullscreenUp: {
readonly property bool windowUp: {
const workspace = layer.activeWorkspace;
if (!workspace)
return false;
return Hyprland.toplevels.values.some((t) => {
const o = t.lastIpcObject || {};
return o.workspace && o.workspace.id === workspace.id &&
(o.fullscreen || 0) > 0 && o.mapped !== false;
if (!o.workspace || o.workspace.id !== workspace.id || o.mapped === false || o.hidden === true)
return false;
if (o.size && (o.size[0] <= 0 || o.size[1] <= 0))
return false;
return (o.fullscreen || 0) > 0 || o.floating === false;
});
}
@@ -54,12 +59,12 @@ Variants {
right: true
}
// lastIpcObject only moves when something asks it to, so nudge it on the
// events that can change whether a window is fullscreen
// lastIpcObject only moves when something asks it to, so nudge it on
// the events that can change whether a tiled or fullscreen window exists.
Connections {
function onRawEvent(event) {
if (event.name === "fullscreen" || event.name === "activewindowv2" || event.name === "closewindow" || event.name === "workspace" || event.name === "focusedmon")
fullscreenPoll.restart();
if (event.name === "fullscreen" || event.name === "activewindowv2" || event.name === "closewindow" || event.name === "openwindow" || event.name === "workspace" || event.name === "focusedmon" || event.name === "movewindow" || event.name === "changefloatingmode")
windowPoll.restart();
}
@@ -74,7 +79,7 @@ Variants {
}
Timer {
id: fullscreenPoll
id: windowPoll
interval: 120
onTriggered: Hyprland.refreshToplevels()
@@ -266,6 +271,7 @@ Variants {
WidgetFrame {
board: deck
updatesEnabled: layer.visible
}
}
+136
View File
@@ -0,0 +1,136 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs
Column {
id: page
// the map is drawn over this
property string wallpaper: ""
spacing: Theme.dp(26)
// the header switch turns the whole layer off, so the page has nothing left to set
enabled: Prefs.widgetsEnabled
opacity: Prefs.widgetsEnabled ? 1 : 0.38
Behavior on opacity {
NumberAnimation {
duration: Theme.durShort
}
}
FileView {
path: Quickshell.env("HOME") + "/.cache/current_wallpaper"
blockLoading: true
printErrors: false
watchChanges: true
onFileChanged: reload()
onLoaded: page.wallpaper = text().trim()
}
WidgetsMap {
width: parent.width
wallpaper: page.wallpaper
}
SettingCard {
title: "ON THE DESKTOP"
SettingRow {
title: "Widget panel"
description: "Every widget there is, to drag out onto the desktop or click in, the ones already out there, and layouts to start from or save. It opens from the desktop's right-click menu too."
showDivider: false
M3Button {
text: "Open the panel"
variant: "tonal"
iconPath: "widgets"
onClicked: {
Prefs.settingsHideRequested();
Widgets.openPanel(Monitors.mainScreen ? Monitors.mainScreen.name : "");
}
}
}
SettingRow {
title: "Edit mode"
description: "The desktop shades over and everything on it can be moved: widgets, the bar's modules and the dock. Right-click anything for its options."
showDivider: false
M3Button {
text: "Edit the desktop"
variant: "tonal"
iconPath: "edit"
onClicked: Edit.enterFromSettings("widgets", "")
}
}
}
SettingCard {
title: "BEHAVIOUR"
SettingRow {
title: "Snap while dragging"
resetKey: "widgetSnap"
description: "Widgets catch on the screen's edges and centre lines, and line up with each other, so a hand-placed arrangement still looks deliberate."
M3Switch {
checked: Prefs.widgetSnap
onToggled: (v) => {
return Prefs.widgetSnap = v;
}
}
}
SettingRow {
title: "Pin everything"
resetKey: "widgetLockAll"
description: "Locks every widget where it stands, including the ones that are not individually pinned. Useful once the layout is settled."
M3Switch {
checked: Prefs.widgetLockAll
onToggled: (v) => {
return Prefs.widgetLockAll = v;
}
}
}
SettingRow {
title: "Keep above windows"
resetKey: "widgetOnTop"
description: "Off, widgets live on the desktop and windows cover them. On, they float over everything - handy for a clock or a timer you always want in sight."
M3Switch {
checked: Prefs.widgetOnTop
onToggled: (v) => {
return Prefs.widgetOnTop = v;
}
}
}
SettingRow {
title: "Hide when tiled or fullscreen windows are open"
resetKey: "widgetHideFullscreen"
description: "Widgets step aside while a tiled or fullscreen window is on the workspace; they return on empty workspaces and stay over floating windows."
showDivider: false
M3Switch {
checked: Prefs.widgetHideFullscreen
onToggled: (v) => {
return Prefs.widgetHideFullscreen = v;
}
}
}
}
}
+218
View File
@@ -0,0 +1,218 @@
--- a/lucidbar/Clock.qml
+++ b/lucidbar/Clock.qml
@@ -94,7 +94,7 @@
Timer {
interval: 1000
repeat: true
- running: true
+ running: root.visible && root.hostWindow !== null && root.hostWindow.visible
triggeredOnStart: true
onTriggered: root.now = Loc.now()
}
@@ -477,36 +477,7 @@
color: Theme.accent
transformOrigin: Item.Top
- SequentialAnimation on rotation {
- loops: Animation.Infinite
- running: bell.visible
-
- NumberAnimation {
- from: 0
- to: -14
- duration: Theme.barMs(100)
- easing.type: Easing.OutQuad
- }
-
- NumberAnimation {
- from: -14
- to: 14
- duration: Theme.barMs(160)
- easing.type: Easing.InOutQuad
- }
-
- NumberAnimation {
- from: 14
- to: 0
- duration: Theme.barMs(140)
- easing.type: Easing.OutQuad
- }
-
- PauseAnimation {
- duration: Theme.barMs(2800)
- }
-
- }
+
}
--- a/lucidbar/Mpris.qml
+++ b/lucidbar/Mpris.qml
@@ -649,7 +649,7 @@
// media card, both closed most of the time. a per-frame interpolation behind
// a closed panel measured ~18% of a core, so it waits until something shows it
FrameAnimation {
- running: root.isPlaying && !trackHitArea.dragging && (root.expanded || root.posWanted)
+ running: root.visible && root.hostWindow !== null && root.hostWindow.visible && root.isPlaying && !trackHitArea.dragging && (root.expanded || root.posWanted)
onTriggered: root.livePosSec = Math.min(root.lenSec, root.posBase + (Date.now() - root.posTimestamp) / 1000)
}
@@ -731,7 +731,7 @@
// silence costs the same as sound to capture and parse, so only listen
// while the pill's bars can dance or the panel is open on the waveform
- running: (root.isPlaying && compactBars.visible) || root.expanded
+ running: root.visible && root.hostWindow !== null && root.hostWindow.visible && ((root.isPlaying && compactBars.visible) || root.expanded)
command: ["cava", "-p", Quickshell.env('HOME') + "/.config/cava/quickshell.conf"]
onRunningChanged: {
if (!cavaProc.running && root.bars.length > 0)
@@ -948,7 +948,7 @@
to: 360
duration: 14000
loops: Animation.Infinite
- running: root.isPlaying && compactArt.visible
+ running: root.isPlaying && compactArt.visible && root.hostWindow !== null && root.hostWindow.visible
}
}
@@ -2906,7 +2906,7 @@
readonly property real segmentWidth: measure.implicitWidth
readonly property real naturalWidth: bare.implicitWidth
readonly property bool overflowing: mq.naturalWidth > mq.width
- readonly property bool animating: mq.scrolling && mq.overflowing
+ readonly property bool animating: mq.scrolling && mq.overflowing && mq.visible && mq.opacity > 0
property real currentX: 0
function updateScroll() {
--- a/lucidwidgets/WidgetFrame.qml
+++ b/lucidwidgets/WidgetFrame.qml
@@ -4,6 +4,8 @@
Item {
id: frame
+
+ property bool updatesEnabled: true
required property string uid
required property string wtype
--- a/lucidwidgets/WidgetBody.qml
+++ b/lucidwidgets/WidgetBody.qml
@@ -6,6 +6,7 @@
// set by the frame once the loader is ready
property var host: null
+ readonly property bool updatesEnabled: !body.host || (body.host.updatesEnabled !== false && body.host.onThisScreen !== false)
// a variant that draws straight onto the wallpaper with no container behind it
property bool bare: false
// a body with nothing worth showing right now: the frame fades the whole card
--- a/lucidwidgets/ClockWidget.qml
+++ b/lucidwidgets/ClockWidget.qml
@@ -43,7 +43,7 @@
Timer {
interval: 1000
repeat: true
- running: true
+ running: w.updatesEnabled && w.visible
triggeredOnStart: true
onTriggered: w.now = Loc.now()
}
--- a/lucidwidgets/SystemWidget.qml
+++ b/lucidwidgets/SystemWidget.qml
@@ -127,17 +127,23 @@
return w.inkAccent;
}
- Component.onCompleted: {
- if (!w.preview)
- Sys.hold(w.uid || "w", true, w.pollMs);
-
- }
- Component.onDestruction: Sys.hold(w.uid || "w", false)
- onPollMsChanged: {
- if (!w.preview)
- Sys.hold(w.uid || "w", true, w.pollMs);
-
- }
+ property string pollingTag: ""
+
+ function syncPolling() {
+ const tag = w.uid;
+ if (w.pollingTag !== "" && w.pollingTag !== tag)
+ Sys.hold(w.pollingTag, false);
+ w.pollingTag = tag;
+ if (tag !== "")
+ Sys.hold(tag, !w.preview && w.updatesEnabled, w.pollMs);
+ }
+
+ Component.onCompleted: w.syncPolling()
+ Component.onDestruction: Sys.hold(w.pollingTag, false)
+ onUidChanged: w.syncPolling()
+ onPollMsChanged: w.syncPolling()
+ onUpdatesEnabledChanged: w.syncPolling()
+ onPreviewChanged: w.syncPolling()
// rings: one thick m3 ring per reading, the icon inside, the number under it
Row {
--- a/lucidwidgets/FetchWidget.qml
+++ b/lucidwidgets/FetchWidget.qml
@@ -49,12 +49,22 @@
readonly property var swatches: [Theme.primary, Theme.secondary, Theme.tertiary, Theme.error, Theme.primaryContainer, Theme.secondaryContainer, Theme.tertiaryContainer, Theme.surfaceHighest]
defaultTone: "surface"
- Component.onCompleted: {
- if (!w.preview)
- Sys.hold("fetch-" + w.uid, true, 5000);
-
- }
- Component.onDestruction: Sys.hold("fetch-" + w.uid, false)
+ property string pollingTag: ""
+
+ function syncPolling() {
+ const tag = w.uid === "" ? "" : "fetch-" + w.uid;
+ if (w.pollingTag !== "" && w.pollingTag !== tag)
+ Sys.hold(w.pollingTag, false);
+ w.pollingTag = tag;
+ if (tag !== "")
+ Sys.hold(tag, !w.preview && w.updatesEnabled, 5000);
+ }
+
+ Component.onCompleted: w.syncPolling()
+ Component.onDestruction: Sys.hold(w.pollingTag, false)
+ onUidChanged: w.syncPolling()
+ onUpdatesEnabledChanged: w.syncPolling()
+ onPreviewChanged: w.syncPolling()
// card: the mark and who you are, then a labelled list
Item {
--- a/lucidwidgets/VisualiserWidget.qml
+++ b/lucidwidgets/VisualiserWidget.qml
@@ -50,6 +50,11 @@
if (w.preview || w.uid === "")
return ;
+ if (!w.updatesEnabled) {
+ Cava.drop(w.filed);
+ w.filed = "";
+ return;
+ }
Cava.want(w.uid, w.barCount);
w.filed = w.uid;
}
@@ -124,6 +129,7 @@
onWantCountChanged: w.refreshCount()
onResizingChanged: w.refreshCount()
onBarCountChanged: w.file()
+ onUpdatesEnabledChanged: w.file()
onUidChanged: {
if (w.filed !== "" && w.filed !== w.uid)
Cava.drop(w.filed);
@@ -158,7 +164,7 @@
Timer {
interval: 55
repeat: true
- running: w.preview
+ running: w.preview && w.updatesEnabled && w.visible
onTriggered: w.phase += 0.055
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2 -2
View File
@@ -150,8 +150,8 @@
blur = {
enabled = true;
size = 16;
passes = 2;
size = 8;
passes = 1;
new_optimizations = true;
};
+23 -14
View File
@@ -15,8 +15,8 @@ let
wallpaperDir = "${config.home.homeDirectory}/Wallpapers";
wallpaperScript = "${config.home.homeDirectory}/.config/hypr/scripts/wallpaper/set-wallpaper.sh";
widgetLayout = if osConfig.networking.hostName == "Rias"
then ../../../modules/user/lucid-widgets-rias.json
else ../../../modules/user/lucid-widgets.json;
then ../../../modules/user/lucid/lucid-widgets-rias.json
else ../../../modules/user/lucid/lucid-widgets.json;
defaultWallpaper = "${wallpaperDir}/bluehour.jpg";
hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; };
colors = config.lib.stylix.colors.withHashtag;
@@ -83,6 +83,10 @@ PY
});
themeName = pkgs.writeText "lucid-current-theme" "stylix\n";
applyTheme = pkgs.writeShellScript "lucid-apply-theme" ''
case "''${1:-}" in
--apps-only) exit 0 ;;
--shell-only) shift ;;
esac
exec "$HOME/.config/lucid/apply-theme-upstream.sh" --shell-only "$@"
'';
qmlPackages = with pkgs.qt6; [ qt5compat qtmultimedia ];
@@ -90,11 +94,11 @@ PY
lucid = pkgs.writeShellScript "lucid" ''
export NIXPKGS_QT6_QML_IMPORT_PATH="${lib.makeSearchPath "lib/qt-6/qml" qmlPackages}:''${NIXPKGS_QT6_QML_IMPORT_PATH:-}"
export QT_PLUGIN_PATH="${lib.makeSearchPath "lib/qt-6/plugins" qmlPackages}:''${QT_PLUGIN_PATH:-}"
export PATH="${lib.makeBinPath (with pkgs; [ bash cliphist coreutils curl ffmpeg grim imagemagick jq libnotify pulseaudio python3 wf-recorder wl-clipboard xdg-utils ])}:${tesseract}/bin:$PATH"
export PATH="${lib.makeBinPath (with pkgs; [ bash cliphist coreutils curl ffmpeg grim imagemagick jq libnotify pulseaudio python3 pywal16 wf-recorder wl-clipboard xdg-utils ])}:${tesseract}/bin:$PATH"
exec ${pkgs.quickshell}/bin/qs --no-duplicate --path "${config.home.homeDirectory}/.config/quickshell"
'';
startWallpaper = pkgs.writeShellScript "lucid-wallpaper-start" ''
export PATH="${lib.makeBinPath (with pkgs; [ awww bash coreutils ffmpeg imagemagick jq util-linux ])}:$PATH"
export PATH="${lib.makeBinPath (with pkgs; [ awww bash coreutils ffmpeg imagemagick jq python3 pywal16 util-linux ])}:$PATH"
selected="${defaultWallpaper}"
if [ -s "${config.home.homeDirectory}/.cache/current_live_wallpaper" ]; then
saved=$(${pkgs.coreutils}/bin/head -n1 "${config.home.homeDirectory}/.cache/current_live_wallpaper")
@@ -117,7 +121,7 @@ PY
in {
programs.waybar.enable = lib.mkForce false;
services.mako.enable = lib.mkForce false;
home.packages = with pkgs; [ cliphist ffmpeg grim imagemagick libnotify wf-recorder tesseract ];
home.packages = with pkgs; [ cliphist ffmpeg grim imagemagick libnotify pywal16 wf-recorder tesseract ];
home.activation.installLucid = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
target="${config.home.homeDirectory}/.config/quickshell"
@@ -137,6 +141,7 @@ in {
--exclude='/lucidkeys/state.json' \
--exclude='/lucidwidgets/widgets.json' \
"${source}/" "$target/"
$DRY_RUN_CMD ${pkgs.patch}/bin/patch --batch -p1 -d "$target" < ${../../../modules/user/lucid/idle-work.patch}
dock_qml="$target/luciddocks/Dock.qml"
if grep -Fq '/var/lib/snapd/desktop/applications; do' "$dock_qml"; then
$DRY_RUN_CMD sed -i \
@@ -165,13 +170,14 @@ in {
// Nix focus workaround for Hyprland 0.57: detach pointer and keyboard focus while menus are open.\
Quickshell.execDetached(["hyprctl", "eval", "hl.config({ input = { follow_mouse = " + (dockWindow.menuOpen ? 2 : 1) + " } })"]);' "$dock_qml"
fi
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid-shell.qml} "$target/shell.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/LucidBar.qml} "$target/LucidBar.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/Agenda.qml} "$target/Agenda.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/CalendarSource.qml} "$target/CalendarSource.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/ClockCalendar.qml} "$target/lucidbar/ClockCalendar.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/thunderbird-calendar.py} "$target/thunderbird-calendar.py"
$DRY_RUN_CMD install -m644 ${../../../modules/user/WidgetLayer.qml} "$target/lucidwidgets/WidgetLayer.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/lucid-shell.qml} "$target/shell.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/LucidBar.qml} "$target/LucidBar.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/Agenda.qml} "$target/Agenda.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/CalendarSource.qml} "$target/CalendarSource.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/ClockCalendar.qml} "$target/lucidbar/ClockCalendar.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/thunderbird-calendar.py} "$target/thunderbird-calendar.py"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/WidgetLayer.qml} "$target/lucidwidgets/WidgetLayer.qml"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/WidgetsPage.qml} "$target/lucidprefs/WidgetsPage.qml"
$DRY_RUN_CMD mkdir -p "${wallpaperDir}" \
"${config.home.homeDirectory}/.config/hypr/scripts/wallpaper"
$DRY_RUN_CMD install -m755 "${source}/support/wallpaper/set-wallpaper.sh" \
@@ -184,13 +190,16 @@ in {
for script in palette-edit.py lucid_palette.py add-theme.py scheme-gallery.py gen-light-palette.py; do
$DRY_RUN_CMD install -m644 "${source}/support/lucid/$script" "$lucid_dir/$script"
done
for script in gen-pywal-palette.py set-mode.sh wallpaper-mode.sh; do
$DRY_RUN_CMD install -m755 "${source}/support/lucid/$script" "$lucid_dir/$script"
done
$DRY_RUN_CMD install -m755 "${source}/support/lucid/apply-theme.sh" \
"$lucid_dir/apply-theme-upstream.sh"
$DRY_RUN_CMD install -m755 ${applyTheme} \
"$lucid_dir/apply-theme.sh"
if [ ! -e "$target/lucidprefs/prefs.json" ]; then
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid-prefs.json} "$target/lucidprefs/prefs.json"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/lucid-prefs.json} "$target/lucidprefs/prefs.json"
fi
if [ -z "''${DRY_RUN_CMD:-}" ] && [ -f "$target/lucidprefs/prefs.json" ]; then
prefs_tmp=$(${pkgs.coreutils}/bin/mktemp "$target/lucidprefs/prefs.json.XXXXXX")
@@ -207,7 +216,7 @@ in {
fi
fi
if [ ! -e "$target/luciddocks/pinned.json" ]; then
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid-pinned.json} "$target/luciddocks/pinned.json"
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid/lucid-pinned.json} "$target/luciddocks/pinned.json"
fi
if [ ! -e "$target/lucidwidgets/widgets.json" ]; then
$DRY_RUN_CMD install -m644 ${widgetLayout} "$target/lucidwidgets/widgets.json"