Compare commits

...
5 Commits
Author SHA1 Message Date
Sweetbread 2608e1b547 fixup! fixup! fixup! fixup! Install lucid 2026-11-02 23:15:26 +03:00
Sweetbread d37cfd92dd fixup! fixup! fixup! Install lucid 2026-11-02 22:44:34 +03:00
Sweetbread 6d61c18792 fixup! fixup! Install lucid 2026-11-02 22:26:43 +03:00
Sweetbread cb90233704 fixup! Install lucid 2026-11-02 21:08:04 +03:00
Sweetbread 517f779e52 Install lucid 2026-11-02 21:08:04 +03:00
9 changed files with 1517 additions and 11 deletions

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
./user/helix.nix
./user/hyprland.nix
./user/hyprlock.nix
../user/sweetbread/modules/lucid.nix
./user/mako.nix
./user/neofetch.nix
./user/qt.nix
File diff suppressed because it is too large. Load diff
+6
View File
@@ -32,6 +32,7 @@ in {
ghostty
pamixer
clipse
cliphist
wl-clipboard
wl-clip-persist
xclip
@@ -152,6 +153,11 @@ in {
bind = [
(bind "SUPER + V" (exec "ghostty --title=clipse -e clipse"))
(bind "SUPER + SHIFT + V" (exec "qs ipc call launcher clipboard"))
(bind "Print" (exec "qs ipc call snap toggle"))
(bind "SUPER + Print" (exec "qs ipc call screenshot full"))
(bind "CTRL + Print" (exec "qs ipc call snap region"))
(bind "ALT + Print" (exec "qs ipc call snap window"))
(bind "SUPER + RETURN" (exec "ghostty"))
(bind "SUPER + Q" "hl.dsp.window.close()")
(bind "SUPER + M" "hl.dsp.exit()")
+3
View File
@@ -0,0 +1,3 @@
{
"pinnedApps": []
}
+12
View File
@@ -0,0 +1,12 @@
{
"barEnabled": true,
"dockEnabled": true,
"widgetsEnabled": true,
"widgetOnTop": false,
"widgetHideFullscreen": true,
"desktopIcons": false,
"toastEnabled": true,
"liveWallpapers": true,
"wallpaperFolder": "/home/sweetbread/Wallpapers",
"fontFamily": "Pixeloid Sans"
}
+138
View File
@@ -0,0 +1,138 @@
import "./luciddocks"
import "./lucidedit"
import "./lucidosd"
import "./lucidprefs"
import "./lucidshot"
import "./lucidwidgets"
import QtQuick
import Quickshell
import qs
ShellRoot {
id: root
Component.onCompleted: {
void Clip.probed;
void Capture.state;
}
function announceShot(entry) {
if (Prefs.shotPreview === "preview") {
shotCards.show(entry);
return;
}
if (Prefs.shotPreview !== "notify")
return;
const where = String(entry.file).replace(Quickshell.env("HOME"), "~");
if (entry.kind === "video")
Quickshell.execDetached(["notify-send", "-a", "LucidShot", "-i", "media-record", "Recording saved", where]);
else
Quickshell.execDetached(["sh", "-c", "a=$(notify-send -a LucidShot -i \"$1\" -A 'edit=Mark up' -A 'open=Open' --wait \"$2\" \"$3\"); case \"$a\" in edit) qs ipc call snap edit \"$1\" ;; open) xdg-open \"$1\" ;; esac; true", "sh", entry.file, entry.temp ? "Screenshot copied" : "Screenshot saved", entry.temp ? "It is on the clipboard only" : where]);
}
ShotEngine {
id: shotEngine
cards: shotCards
onReady: (entry) => {
if (entry.owner === "overlay") {
shotCards.update(entry);
return;
}
if (entry.owner === "pin")
return;
root.announceShot(entry);
}
onFailed: (id, why) => toastMod.popup("warning", why, true)
onTextRead: (r) => {
if (!shotEngine.claim(r.id))
return;
if (r.status === "ok") {
if (Prefs.shotPreview === "preview")
shotCards.show({ "id": r.id, "kind": "text", "text": r.text, "codes": r.codes, "screen": Monitors.focusedScreen ? Monitors.focusedScreen.name : "" });
else
toastMod.popup("copy", "Text copied", false);
} else if (r.status === "notool") {
toastMod.popup("alert", "Install tesseract to copy text", true);
} else {
toastMod.popup("alert", "No text found", true);
}
}
}
ShotOverlay {
id: shotOverlay
engine: shotEngine
cards: shotCards
pins: shotPins
onNotify: (icon, text, warn) => toastMod.popup(icon, text, warn)
onSwatch: (hex, text) => toastMod.popupSwatch(hex, text)
onFreezeFailed: (why) => toastMod.popup("alert", "Couldn't capture the screen", true)
}
ShotCards {
id: shotCards
engine: shotEngine
pins: shotPins
overlay: shotOverlay
}
PinBoard {
id: shotPins
engine: shotEngine
}
RecordHud {}
Connections {
target: Capture
function onSaved(file, seconds) {
root.announceShot({ "id": "rec-" + Date.now(), "kind": "video", "file": file, "duration": seconds, "screen": Capture.output });
}
function onFailed(why) {
toastMod.popup("warning", why, true);
}
}
LucidBar {
id: barRoot
dock: dockRoot
toastMod: toastMod
}
Dock {
id: dockRoot
}
Toast {
id: toastMod
}
ToastEvents {
toast: toastMod
}
Binding {
target: toastMod
property: "screen"
value: Monitors.shellPlacement
when: Monitors.shellPlacement !== null
}
WidgetLayer {
}
WidgetIpc {
}
EditLayer {
}
SettingsHost {
}
Binding {
target: Monitors
property: "barWindows"
value: barRoot.instances
}
}
+20
View File
@@ -0,0 +1,20 @@
{
"nextId": 3,
"boardFull": true,
"instances": [
{
"uid": "w1",
"type": "clock",
"variant": "digital",
"wx": 40,
"wy": 70
},
{
"uid": "w2",
"type": "system",
"variant": "rings",
"wx": 40,
"wy": 250
}
]
}
+8 -11
View File
@@ -1,4 +1,4 @@
{ pkgs, lib, config, osConfig, inputs, ... }: {
{ pkgs, lib, config, osConfig, ... }: {
wayland.windowManager.hyprland = let
colors = config.lib.stylix.colors;
accent = colors.${config.stylix.accent};
@@ -10,7 +10,7 @@
} /*py*/ ''
import requests as requests
from random import choice
from os import listdir, makedirs, remove, replace, system
from os import listdir, makedirs, remove, replace
from os.path import exists
from subprocess import run
@@ -123,7 +123,10 @@
finally:
if filename is not None:
notify("Applying wallpaper", 100)
system(f"awww img {folder}/{filename} --transition-type center")
run([
"${config.home.homeDirectory}/.config/hypr/scripts/wallpaper/set-wallpaper.sh",
f"{folder}/{filename}",
], check=False)
'';
in {
settings = {
@@ -188,10 +191,6 @@
{ leaf = "workspaces"; enabled = true; speed = 6; bezier = "default"; }
];
on = [
(hyprLua.onStart [ "${lib.getExe wallpaper_changer}" ])
];
workspace_rule = [
{
workspace = "2";
@@ -200,10 +199,8 @@
];
bind = [
(hyprLua.bind "Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m output"))
(hyprLua.bind "CTRL + Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m region"))
(hyprLua.bind "ALT + Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m window"))
(hyprLua.bind "SUPER + W" (hyprLua.exec "${lib.getExe wallpaper_changer}"))
(hyprLua.bind "SUPER + W" (hyprLua.exec "qs ipc call launcher wallpaper"))
(hyprLua.bind "SUPER + SHIFT + W" (hyprLua.exec "${lib.getExe wallpaper_changer}"))
];
};
};
+238
View File
@@ -0,0 +1,238 @@
{ config, lib, osConfig, pkgs, ... }:
let
liveDecoder = if builtins.elem osConfig.networking.hostName [ "Rias" "Eclipse" ] then "cuda" else "vaapi";
source = pkgs.fetchgit {
url = "https://github.com/Sn3akyy1/lucid.git";
rev = "bdd7f79da18efd837f79dcecbe5d2ec178abc10c";
hash = "sha256-b6qylKjCGYy2Yo64i1w9g4oGrYgcXf502jY9qNNWhSI=";
sparseCheckout = [
"/*"
"!/wallpapers/*"
"!/assets/*.webp"
];
nonConeMode = true;
};
wallpapers = pkgs.fetchgit {
url = "https://github.com/Sn3akyy1/lucid.git";
rev = "bdd7f79da18efd837f79dcecbe5d2ec178abc10c";
hash = "sha256-rXEYlr2bSe6EP6vxyayK7iXHk+Mmqs7duiE0pweIozI=";
sparseCheckout = [ "/wallpapers/catppuccin-mocha/*" ];
nonConeMode = true;
};
wallpaperDir = "${config.home.homeDirectory}/Pictures/wallpapers/stylix";
wallpaperScript = "${config.home.homeDirectory}/.config/hypr/scripts/wallpaper/set-wallpaper.sh";
defaultWallpaper = "${wallpaperDir}/bluehour.jpg";
hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; };
colors = config.lib.stylix.colors.withHashtag;
paletteFile = pkgs.runCommand "lucid-stylix-palette.json" {
nativeBuildInputs = [ pkgs.python3 ];
} ''
python3 - "$out" ${lib.escapeShellArg config.stylix.base16Scheme} \
${lib.escapeShellArg "${source}/support/lucid"} \
${lib.escapeShellArg config.stylix.accent} <<'PY'
import json
import runpy
import sys
from pathlib import Path
output, scheme_path, scripts, accent_key = sys.argv[1:]
sys.path.insert(0, scripts)
from lucid_palette import at_tone
importer = runpy.run_path(str(Path(scripts) / "add-theme.py"))
scheme = importer["parse_base16"](scheme_path, Path(scheme_path).read_text())
if scheme is None:
raise SystemExit("Stylix scheme is not valid Base16")
bg, fg, accents, hints = importer["to_palette"](scheme)
accent_key = accent_key.lower()
hints["primary"] = scheme["colors"][accent_key]
hints["secondary"] = scheme["colors"]["base0d" if accent_key != "base0d" else "base0e"]
hints["tertiary"] = scheme["colors"]["base0c" if accent_key == "base0b" else "base0b"]
palette = importer["build_palette"](
bg, fg, accents, hints, mode="dark" if importer["is_dark"](bg) else "light"
)
if importer["is_dark"](bg):
colors = scheme["colors"]
# Keep the Base16 dark surface ladder. Lucid's built-in Mocha uses base00
# for its main panels, with base01/base02 as the raised surfaces; the
# generic Material builder starts at base02 and makes the whole shell pale.
background_tone = importer["tone"](bg)
darkest = importer["hx"](at_tone(bg, background_tone - 4))
near_background = importer["hx"](at_tone(bg, background_tone - 2))
palette.update({
"surface": colors["base00"],
"surface_dim": darkest,
"surface_bright": importer["hx"](at_tone(bg, background_tone + 8)),
"surface_container_lowest": darkest,
"surface_container_low": near_background,
"surface_container": colors["base00"],
"surface_container_high": colors["base01"],
"surface_container_highest": colors["base02"],
"surface_variant": colors["base01"],
"on_surface_variant": colors["base04"],
"outline": colors["base03"],
"outline_variant": colors["base01"],
})
Path(output).write_text(json.dumps(palette, indent=2) + "\n")
PY
'';
themeMeta = pkgs.writeText "lucid-stylix-meta.json" (builtins.toJSON {
id = "stylix";
name = "Stylix";
desc = "Active Stylix palette";
swatchBg = colors.base00;
swatchAccent = colors.${config.stylix.accent};
source = "Home Manager";
detected = "base16";
user = true;
});
themeName = pkgs.writeText "lucid-current-theme" "stylix\n";
applyTheme = pkgs.writeShellScript "lucid-apply-theme" ''
exec "$HOME/.config/lucid/apply-theme-upstream.sh" --shell-only "$@"
'';
qmlPackages = with pkgs.qt6; [ qt5compat qtmultimedia ];
tesseract = pkgs.tesseract4.override { enableLanguages = [ "eng" "rus" ]; };
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"
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"
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")
if [ -f "$saved" ]; then
selected="$saved"
fi
fi
if [ -s "${config.home.homeDirectory}/.cache/current_wallpaper" ]; then
saved=$(${pkgs.coreutils}/bin/cat "${config.home.homeDirectory}/.cache/current_wallpaper")
if [ "$selected" = "${defaultWallpaper}" ] && [ -f "$saved" ]; then
selected="$saved"
fi
fi
exec "${wallpaperScript}" "$selected"
'';
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.activation.installLucid = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
target="${config.home.homeDirectory}/.config/quickshell"
$DRY_RUN_CMD mkdir -p "$target"
$DRY_RUN_CMD ${pkgs.rsync}/bin/rsync -rltp --chmod=Du+rwx,Fu+rw \
--exclude='/shell.qml' \
--exclude='/LucidBar.qml' \
--exclude='/lucidprefs/prefs.json' \
--exclude='/lucidbar/blur.json' \
--exclude='/lucidbar/clock_reminders.json' \
--exclude='/lucidbar/mpris_shazam.json' \
--exclude='/luciddocks/pinned.json' \
--exclude='/luciddocks/usage.json' \
--exclude='/luciddocks/wallpaper.json' \
--exclude='/lucidmoji/config.json' \
--exclude='/lucidmoji/state.json' \
--exclude='/lucidkeys/state.json' \
--exclude='/lucidwidgets/widgets.json' \
"${source}/" "$target/"
$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 mkdir -p "${wallpaperDir}" \
"${config.home.homeDirectory}/.config/hypr/scripts/wallpaper"
$DRY_RUN_CMD ${pkgs.rsync}/bin/rsync -rltp --chmod=Du+rwx,Fu+rw --ignore-existing \
"${wallpapers}/wallpapers/catppuccin-mocha/" "${wallpaperDir}/"
$DRY_RUN_CMD install -m755 "${source}/support/wallpaper/set-wallpaper.sh" \
"${wallpaperScript}"
lucid_dir="${config.home.homeDirectory}/.config/lucid"
$DRY_RUN_CMD mkdir -p "$lucid_dir/themes"
$DRY_RUN_CMD ${pkgs.rsync}/bin/rsync -rltp --chmod=Du+rwx,Fu+rw --ignore-existing \
"${source}/support/lucid/themes/" "$lucid_dir/themes/"
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
$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"
fi
if [ -z "''${DRY_RUN_CMD:-}" ] && [ -f "$target/lucidprefs/prefs.json" ]; then
prefs_tmp=$(${pkgs.coreutils}/bin/mktemp "$target/lucidprefs/prefs.json.XXXXXX")
if ${pkgs.jq}/bin/jq --arg font ${lib.escapeShellArg config.stylix.fonts.sansSerif.name} \
--arg wallpaperDir ${lib.escapeShellArg wallpaperDir} \
--arg decoder ${lib.escapeShellArg liveDecoder} \
'.barEnabled = true | .widgetOnTop = false | .widgetHideFullscreen = true | .fontFamily = $font | .wallpaperFolder = $wallpaperDir | .liveDecoder = $decoder' \
"$target/lucidprefs/prefs.json" > "$prefs_tmp"; then
${pkgs.coreutils}/bin/chmod 644 "$prefs_tmp"
${pkgs.coreutils}/bin/mv "$prefs_tmp" "$target/lucidprefs/prefs.json"
else
${pkgs.coreutils}/bin/rm -f "$prefs_tmp"
exit 1
fi
fi
if [ ! -e "$target/luciddocks/pinned.json" ]; then
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid-pinned.json} "$target/luciddocks/pinned.json"
fi
if [ ! -e "$target/lucidwidgets/widgets.json" ]; then
$DRY_RUN_CMD install -m644 ${../../../modules/user/lucid-widgets.json} "$target/lucidwidgets/widgets.json"
fi
for pair in \
'blur.json lucidbar/blur.json' \
'clock_reminders.json lucidbar/clock_reminders.json' \
'mpris_shazam.json lucidbar/mpris_shazam.json' \
'usage.json luciddocks/usage.json' \
'wallpaper.json luciddocks/wallpaper.json' \
'moji-config.json lucidmoji/config.json' \
'moji-state.json lucidmoji/state.json' \
'keys-state.json lucidkeys/state.json'; do
set -- $pair
if [ ! -e "$target/$2" ]; then
$DRY_RUN_CMD install -m644 "${source}/defaults/$1" "$target/$2"
fi
done
$DRY_RUN_CMD mkdir -p "${config.home.homeDirectory}/.config/lucid/themes/stylix" \
"${config.home.homeDirectory}/.cache/quickshell"
$DRY_RUN_CMD install -m644 ${paletteFile} \
"${config.home.homeDirectory}/.config/lucid/themes/stylix/quickshell.json"
$DRY_RUN_CMD install -m644 ${themeMeta} \
"${config.home.homeDirectory}/.config/lucid/themes/stylix/meta.json"
if [ ! -e "${config.home.homeDirectory}/.cache/current_theme" ]; then
$DRY_RUN_CMD install -m644 ${themeName} \
"${config.home.homeDirectory}/.cache/current_theme"
fi
if [ ! -e "${config.home.homeDirectory}/.cache/current_theme" ] || \
[ "$(${pkgs.coreutils}/bin/cat "${config.home.homeDirectory}/.cache/current_theme")" = stylix ]; then
$DRY_RUN_CMD install -m644 ${paletteFile} \
"${config.home.homeDirectory}/.cache/quickshell/matugen.json"
fi
'';
systemd.user.services.lucid = {
Unit = {
Description = "Lucid bar, dock and desktop widgets";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStartPre = "${startWallpaper}";
ExecStart = "${lucid}";
Restart = "on-failure";
RestartSec = 2;
};
Install.WantedBy = [ "hyprland-session.target" ];
};
wayland.windowManager.hyprland.settings = {
on = [ (hyprLua.onStart [ "systemctl --user start lucid.service" ]) ];
bind = [
(hyprLua.bind "SUPER + SHIFT + G" (hyprLua.exec "qs ipc call widgets panel"))
];
};
}