navigator-desktop
Saving and restoring the desktop -- Options > Save desktop / Load desktop (DN's cmSaveDesk/cmLoadDesk, SaveDesktop/RetrieveDesktop), navigator/lib/config/desktop_state.py (snapshot, save, load, restor
Files1
View on GitHubSKILL.md.claude/skills/navigator-desktop/SKILL.md
GitHubThe saved desktop
- What it is: DN streamed every window to
DN.DSK; herenavigator/lib/config/desktop_state.pymakes a dict --{"version", "windows": [...bottom to top], "front": index}-- kept as JSON in theSavedDesktopmodel (desktopstable, one row a name,default). Aversionother thanVERSIONis not read. - What a window keeps (
_window): its rectangle (file_history.window_values, put back byplace_window), andManager: per panelpath(a Find: listing's origin -- a departure: DN'sTFindDrive.Storekept the listing whole; an archive's own directory, the cursor on it),local(where a panel on another drive falls back to),view_mode,sort_mode,sort_reverse,show_hidden,show_info,file_mask,columns,display,cursor(entry name, via_return_to);activeside,split(the divider),hiddenside,viewstanding in (tree/quick/info, put back throughswitch_viewafter the active panel is focused),miller(path, cursor, side); and from_manager_extras:view_focused(the view had the keyboard, read off_saved_focusfor a manager behind another),collapse(DN'sOldBounds:_collapse'sbeforerectangle, widths andexact-- untouched since the hide) andview_zoom(Alt+Z's zoom over the hide). These three go back afterplace_window(_manager_placed): the hide in_managerran on the unplaced window, so_collapseis stamped again on the placed one,beforescaled as the rectangle is, andafterthe placed (unzoomed) rectangle only whenexact.place_windowzooms first and then sets_restore, since zooming sets aside the rectangle the window has;EditWindow:pathandstate--EditWindow.desktop_state(), DN'sTFileEditor.Store: cursor, scroll, markers, margins and every mode (DESKTOP_MODES; not insert mode, not the block), whatever Track editing says, put back over the file's record byrestore_desktop_state(Awaken); an older entry withoutstateopens on its path alone. SmartPad as SmartPad, not stamped again (open_smartpad(stamp=False)). A file gone is left out (a departure: DN reopened it empty under its name, which F2 would save over a deleted file's name). Andview_of-- the index of the earlier window on the same text, for a Window > New view -- whichrestoremakes again with that window'sopen_view()rather than a second document (made_at);FileWindow:path,mode;TreeWindow: the directory and hidden;VolumesWindow(kind="volumes"):allandfree;CalculatorWindow: the expression;CalendarWindow: only that it was open (it comes back on today);DBWindow(kind="database", DN'sTDBViewer.Store): its ownkept_state()--path,source(dbf/sqlite/csv),recordin the file's order andfield,top/first_field(unsorted only),widths, the F7search; dBase'scodeconly when Shift+F6 chose one over the file's (DBFile.detected), SQLite'stableorquery(SQLTable.sql), a CSV'sdialect. An F8 sort is not kept (re-sorting reads every row at start), and a window on a fetched copy (use_set) is left out, as DN droppedKillAfterUsefiles._databasereopens throughopen_database/open_sqlite(table=, query=)/open_csv(dialect=), with no Tables box;restore_state(kept)runs afterplace_windowand a layout, so the scroll clamps to the real height. A table dropped or a query refused (DBFError, aValueError) leaves it out silently. Anything else is not kept. A window that cannot be made again (a file or directory gone) is left out.
- The trash can's showing and place are kept too (
snapshot'strash), asSaveDesktopwrote them. - Save desktop (
SaveDesktop) writes over the saved one. Load desktop (LoadDesktop) says No desktop has been saved with none, else closes every window as Close all does (close_all_asking; a Cancel keeps the desktop) andrestores. - Startup's Autosave desktop (off by default; a departure: DN restored
DN.DSKat every start whenever there was one) saves inNavigator.on_stop-- the windows are still open there, as quitting only asks -- and restores inon_start, replacing the file manager the start opened once a manager has come back. Directories given on the command line (Navigator(given=True)) go to the first manager restored, its cursors dropped. - The topmost manager's active panel opens in the current directory (
restore(here=): the start directory, or the active panel's for Load desktop) unless Startup's Preserve directory is ticked -- DN'sTFilePanelRoot.Storewrote that panel's drive as nil. Decided at restore rather than save, so the saved directory is never lost.