fixup! fixup! fixup! fixup! Install lucid
This commit is contained in:
4 files changed
+94
-5
No files matched your search
@@ -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()")
|
||||
|
||||
@@ -2,12 +2,97 @@ 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
|
||||
|
||||
Reference in new issue
Block a user