dotfiles
bugabingas dorkfiles
owned by bugabinga
fix nuguland calendar popup
72542113b311bacf5d1f4411e3cd1f5b667e9bbe
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (4)
quickshell/nuguland/Bar.qml
Modified287 287 id:
workspaceChip 289 289 readonly property bool active:
!!pillWrap.modelData.is_focused
290 - readonly property string idxStr:
String(pillWrap.modelData.idx
|| pillWrap.modelData.id
|| "?")
290 + readonly property string idxStr:
String(pillWrap.modelData.shortcut
|| pillWrap.modelData.idx
|| pillWrap.modelData.id
|| "?")
291 291 readonly property string nameStr: pillWrap.modelData.name
? String(pillWrap.modelData.name).toLowerCase()
: "" 292 292 readonly property string abbrName: root.formatService
&& workspaceChip.nameStr
? root.formatService.abbreviate(workspaceChip.nameStr)
: "" 331 331 hoverEnabled:
true 332 332 cursorShape:
Qt.PointingHandCursor
336 334 if (root.niriService)
337 335 root.niriService.focusWorkspace(pillWrap.modelData.name
|| pillWrap.modelData.idx
|| pillWrap.modelData.id);
quickshell/nuguland/CalDav.qml
Modified 37 37 secretError: secretError
, 39 39 username: config
? config.username
: "", 40 + setupDraftUrl: setupUrlDraft
, 41 + setupDraftUsername: setupUsernameDraft
, 42 + setupDraftHasPassword: setupPasswordDraft.length
> 0, 40 43 calendarCount: config
&& config.calendars
? config.calendars.length
: 0, 41 44 eventCount: events
? events.length
: 0 73 76 const back
= new Date(
Date.
UTC(
+w.start.slice(
0,
4),
+w.start.slice(
4,
6)
- 1,
+w.start.slice(
6,
8),
+w.start.slice(
9,
11),
+w.start.slice(
11,
13),
+w.start.slice(
13,
15)));
74 77 const spanDays
= (
Date.
UTC(
+w.end.slice(
0,
4),
+w.end.slice(
4,
6)
- 1,
+w.end.slice(
6,
8),
+w.end.slice(
9,
11))
- Date.
UTC(
+w.start.slice(
0,
4),
+w.start.slice(
4,
6)
- 1,
+w.start.slice(
6,
8),
+w.start.slice(
9,
11)))
/ 86400000;
75 78 ok(
"window", shape.test(w.start)
&& shape.test(w.end)
&& back.getFullYear()
=== 2026 && back.getMonth()
=== 5 && back.getDate()
=== 8 && back.getHours()
=== 0 && spanDays
=== 42);
79 + const oldUrlDraft
= root.setupUrlDraft;
80 + const oldUserDraft
= root.setupUsernameDraft;
81 + const oldPwDraft
= root.setupPasswordDraft;
83 + root.setSetupDraft(
"https://dav.example",
"alice",
"pw");
84 + ok(
"setup-draft", root.setupUrlDraft
=== "https://dav.example" && root.setupUsernameDraft
=== "alice" && root.setupPasswordDraft
=== "pw");
86 + root.setSetupDraft(oldUrlDraft, oldUserDraft, oldPwDraft);
77 89 ok(
"threw:" + e,
false);
94 106 root.config.url
= String(data.url
|| "");
95 107 root.config.username
= String(data.username
|| "");
96 108 root.config.calendars
= data.calendars
|| [];
109 + if (
!root.setupUrlDraft)
110 + root.setupUrlDraft
= root.config.url;
111 + if (
!root.setupUsernameDraft)
112 + root.setupUsernameDraft
= root.config.username;
99 115 function persistConfig() {
277 293 property string secretError:
"" 294 + property string setupUrlDraft:
"" 295 + property string setupUsernameDraft:
"" 296 + property string setupPasswordDraft:
"" 298 + function setSetupDraft(url, username, password) {
299 + root.setupUrlDraft
= String(url
|| "");
300 + root.setupUsernameDraft
= String(username
|| "");
301 + root.setupPasswordDraft
= String(password
|| "");
282 307 function saveSetup(url, username, password) {
283 308 root.secretError
= "";
309 + root.setSetupDraft(url, username, password);
284 310 const u
= String(url
|| "").trim().replace(
/\/+$/,
"");
285 311 const user
= String(username
|| "").trim();
286 312 if (
!u
|| !user
|| !password) {
293 319 root.secretError
= "URL ungültig (https://… erwartet)";
322 + root.setupUrlDraft
= u;
323 + root.setupUsernameDraft
= user;
296 324 root.config.url
= u;
297 325 root.config.username
= user;
298 326 root.config.calendars
= [];
351 379 function onExited(code) {
352 380 if (code
=== 0) {
353 381 root.secretError
= "";
382 + root.setupPasswordDraft
= "";
354 383 root.discoverAndFetch();
356 385 root.status
= "needs-setup";
quickshell/nuguland/Niri.qml
Modified 20 20 readonly property string focusedTitle: focusedWindowRecord
? (focusedWindowRecord.title
|| "")
: "" 21 21 readonly property string focusedAppId: focusedWindowRecord
? (focusedWindowRecord.app_id
|| focusedWindowRecord.appId
|| "")
: "" 22 22 readonly property string focusedOutputName:
focusedOutputNameFromWorkspaces(workspaces)
23 + readonly property string keybindConfigPath: {
24 + const xdg
= String(
Quickshell.env(
"XDG_CONFIG_HOME")
|| "");
25 + const home
= String(
Quickshell.env(
"HOME")
|| "");
26 + return (xdg.length
> 0 ? xdg
: home
+ "/.config")
+ "/niri/cfg/keybinds.kdl";
28 + property var workspaceShortcuts: ({})
24 30 function refresh() {
25 31 if (
!available
|| query.running)
101 + function shortcutKey(sequence) {
102 + const parts
= String(sequence
|| "").split(
"+");
103 + return parts.length
> 0 ? parts[parts.length
- 1]
: "";
106 + function parseWorkspaceShortcuts(text) {
108 + const re
= /(?:^|\n)\s*([^\s{]+)[^{]*\{([^{}]*)\}/g;
110 + while ((match
= re.exec(
String(text
|| "")))
!== null) {
111 + const focus
= /\bfocus-workspace\s+(?:"([^"]+)"|([^\s}]+))/.exec(match[
2]);
115 + const name
= String(focus[
1]
|| focus[
2]
|| "");
116 + if (name.length
> 0 && !map[name])
117 + map[name]
= shortcutKey(match[
1]);
122 + function reloadWorkspaceShortcuts() {
123 + workspaceShortcuts
= parseWorkspaceShortcuts(keybindFile.text());
126 + function workspaceShortcut(name) {
127 + return workspaceShortcuts[
String(name
|| "")]
|| "";
105 140 byOutput[name]
= [];
106 141 order.push(name);
108 - byOutput[name].push(vis[i]);
143 + byOutput[name].push(
Object.
assign({}, vis[i], {
144 + "shortcut": workspaceShortcut(vis[i].name)
110 147 return order.map(name
=> {
219 256 failures.push(
`focused output helper missing: ${error}
`);
260 + const shortcuts
= parseWorkspaceShortcuts(
'binds {\n Mod+1 { focus-workspace "code" }\n Mod+4 { focus-workspace "browser" }\n Mod+Shift+4 { move-column-to-workspace "browser" }\n}');
261 + if (shortcuts.code
!== "1" || shortcuts.browser
!== "4")
262 + failures.push(
`workspace shortcuts ${
JSON.
stringify(shortcuts)}
!= code/browser 1/4`);
264 + failures.push(
`workspace shortcut parser missing: ${error}
`);
223 268 "pass": failures.length
=== 0, 224 269 "failures": failures
406 451 "outputCount":
Array.isArray(outputs)
? outputs.length
: Object.
keys(outputs
|| {}).length
, 407 452 "outputs": outputs
, 408 453 "workspaces": workspaces
, 454 + "workspaceShortcuts": workspaceShortcuts
, 409 455 "overviewState": overviewState
, 410 456 "focusedWindow": focusedWindow
, 411 457 "focusedOutputName": focusedOutputName
, 515 + path: root.keybindConfigPath
518 + onLoaded: root.reloadWorkspaceShortcuts()
519 + onLoadFailed: root.workspaceShortcuts
= ({})
quickshell/nuguland/PopoutHost.qml
Modified 466 466 anchors.fill: monthGrid
470 470 model: clockCol.bandLayout.segments
493 495 visible:
!clockCol.setupMode
494 496 width: parent
? parent.width
: 0 495 - height: agendaCol.height
497 + height:
Math.
max(
70, parent
? parent.height
- y
: agendaCol.height)
500 - anchors.horizontalCenter: parent.horizontalCenter
501 - width: clockCol.gridW
503 + anchors.fill: parent
504 + contentWidth: clockCol.gridW
505 + contentHeight: agendaCol.height
506 + interactive: contentHeight
> height
507 + boundsBehavior:
Flickable.StopAtBounds
505 - model: clockCol.todayItems
512 + x:
Math.
round((agendaFrame.width
- width)
/ 2)
513 + width: clockCol.gridW
511 - anchors.verticalCenter: parent.verticalCenter
515 - color: modelData.color
517 + model: clockCol.todayItems
522 - const ev
= modelData;
523 - const mark
= ev.kind
=== "task" ? (ev.done
? "✓ " : "○ ")
: "";
525 - if (
!ev.allDay
&& ev.startMs
!= null) {
526 - const d
= new Date(ev.startMs);
527 - const p = function (n) {
528 - return (n
< 10 ? "0" : "")
+ n;
530 - t
= p(d.getHours())
+ ":" + p(d.getMinutes())
+ " ";
523 + anchors.verticalCenter: parent.verticalCenter
527 + color: modelData.color
534 + const ev
= modelData;
535 + const mark
= ev.kind
=== "task" ? (ev.done
? "✓ " : "○ ")
: "";
537 + if (
!ev.allDay
&& ev.startMs
!= null) {
538 + const d
= new Date(ev.startMs);
539 + const p = function (n) {
540 + return (n
< 10 ? "0" : "")
+ n;
542 + t
= p(d.getHours())
+ ":" + p(d.getMinutes())
+ " ";
544 + return t
+ mark
+ (ev.summary
|| "(ohne Titel)");
532 - return t
+ mark
+ (ev.summary
|| "(ohne Titel)");
539 - visible: clockCol.todayItems.length
=== 0 542 - text:
"Keine Termine" 551 + visible: clockCol.todayItems.length
=== 0 554 + text:
"Keine Termine" 560 + visible: agendaFlick.interactive
561 + anchors.right: parent.right
562 + anchors.rightMargin:
2 563 + y: agendaFlick.contentY
/ Math.
max(
1, agendaFlick.contentHeight)
* parent.height
565 + height:
Math.
max(
18, parent.height
* Math.
min(
1, parent.height
/ Math.
max(parent.height, agendaFlick.contentHeight)))
567 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.55)
: "white" 573 597 placeholder:
"https://host/remote.php/dav" 598 + text: root.caldavService
? root.caldavService.setupUrlDraft
: "" 599 + onEdited: text =
> {
600 + if (root.caldavService)
601 + root.caldavService.setupUrlDraft
= text;
579 608 placeholder:
"Benutzername" 609 + text: root.caldavService
? root.caldavService.setupUsernameDraft
: "" 610 + onEdited: text
=> {
611 + if (root.caldavService)
612 + root.caldavService.setupUsernameDraft
= text;
585 619 placeholder:
"App-Passwort" 621 + text: root.caldavService
? root.caldavService.setupPasswordDraft
: "" 622 + onEdited: text =
> {
623 + if (root.caldavService)
624 + root.caldavService.setupPasswordDraft
= text;
603 642 anchors.fill: parent
604 643 cursorShape:
Qt.PointingHandCursor
605 644 onClicked:
if (root.caldavService)
606 - root.caldavService.saveSetup(urlField.field.text, userField.field.text, pwField.field.text)
645 + root.caldavService.saveSetup(urlField.text, userField.text, pwField.text)
622 661 property alias field: ti
623 662 property string placeholder:
"" 624 663 property bool secret:
false 664 + property string text:
"" 665 + signal edited(
string text)
626 667 width: setupForm.width
641 682 font.family:
"IBM Plex Sans" 642 683 font.pixelSize:
13 643 684 echoMode: parent.secret
? TextInput.Password
: TextInput.Normal
687 + onTextEdited: parent.edited(text)