From 221cf8686054a7681c1feb3d3dd03c8980dde530 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:03:48 +0200 Subject: [PATCH] calendar: save expanded state --- .config/ags/modules/sideright/calendar.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.config/ags/modules/sideright/calendar.js b/.config/ags/modules/sideright/calendar.js index e68761ee7..d70f98801 100644 --- a/.config/ags/modules/sideright/calendar.js +++ b/.config/ags/modules/sideright/calendar.js @@ -10,6 +10,7 @@ import Todo from "../../services/todo.js"; import { TodoWidget } from "./todolist.js"; import { getCalendarLayout } from "./calendar_layout.js"; +const AGS_CONFIG_FILE = `${App.configDir}/user_options.jsonc`; let calendarJson = getCalendarLayout(undefined, true); let monthshift = 0; @@ -203,6 +204,12 @@ export const ModuleCalendar = () => { className: 'margin-top-5 margin-left-5 margin-bottom-5', onClicked: () => { mainStack.shown = (mainStack.shown == 'expanded') ? 'collapsed' : 'expanded'; + Utils.execAsync(['bash', '-c', `${App.configDir}/scripts/ags/agsconfigurator.py \ + --key "sidebar.calendar.expandByDefault" \ + --value ${!userOptions.sidebar.calendar.expandByDefault} \ + --file ${AGS_CONFIG_FILE}` + ]).catch(print); + }, setup: setupCursorHover, child: Box({ @@ -258,9 +265,7 @@ export const ModuleCalendar = () => { }, transition: 'slide_up_down', transitionDuration: userOptions.animations.durationLarge, - setup: (stack) => Utils.timeout(1, () => { - stack.shown = userOptions.sidebar.calendar.expandByDefault ? 'expanded' : 'collapsed'; - }) + shown: userOptions.sidebar.calendar.expandByDefault ? 'expanded' : 'collapsed', }) return mainStack;