Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 35 fields pub roots: Vec<String>, pub agenda_files: Vec<String>, pub todo_keywords: Vec<String>, pub todo_keyword_colors: BTreeMap<String, String>, pub ids: IdPolicy, pub tags_column: i64, pub tag_inheritance_exclusions: Vec<String>, pub highest_priority: String, pub lowest_priority: String, pub default_priority: String, pub agenda_span: AgendaSpan, pub agenda_start_day: Option<String>, pub week_start: WeekStart, pub deadline_warning_days: i64, pub skip_scheduled_if_done: bool, pub skip_deadline_if_done: bool, pub skip_timestamp_if_done: bool, pub sorting_strategy: Vec<String>, pub log_done: LogMode, pub log_repeat: LogMode, pub log_reschedule: LogMode, pub log_redeadline: LogMode, pub log_into_drawer: bool, pub editor: Vec<String>, pub theme: String, pub nerd_font: bool, pub notation: Notation, pub start_view: String, pub agent_inbox: Option<String>, pub someday_tag: String, pub someday_clears_dates: bool, pub reschedule_nudge: usize, pub captures: Vec<CaptureTemplate>, pub views: Vec<ViewSettings>, pub agent_profiles: Vec<AgentProfile>,
}
Expand description

Everything agd reads from config.toml, one flat table: every setting is a top-level key, and only capture templates, views and agent profiles are lists of records ([[capture]], [[view]], [[agent_profile]]). Missing keys take the defaults below; unknown keys are errors.

Fields§

§roots: Vec<String>

The only directories agd reads or writes.

§agenda_files: Vec<String>

org-agenda-files: files, directories (their *.org files) or globs. Empty means every .org file under the roots.

§todo_keywords: Vec<String>

org-todo-keywords, one #+TODO: line per sequence, such as “TODO NEXT WAIT(w@/!) | DONE CANCELLED”: read by the same code as a file’s own #+TODO: lines, which replace these. A line without | makes its last keyword the done state, as in Org.

§todo_keyword_colors: BTreeMap<String, String>

org-todo-keyword-faces for the TUI: a color name (COLOR_NAMES) per keyword. A view section takes the color its rows’ keywords share. The default colors the default workflow’s WAIT yellow and CANCELLED dim-red; a map of your own replaces it.

§ids: IdPolicy

“preserve” leaves headings alone; “add-on-write” adds an org-id :ID: on a heading’s first edit.

§tags_column: i64

org-tags-column: negative right-aligns tags to end at that column, positive starts them there, as Emacs does when it rewrites a headline.

§tag_inheritance_exclusions: Vec<String>§highest_priority: String§lowest_priority: String§default_priority: String§agenda_span: AgendaSpan

org-agenda-span: “day”, “week”, “month” or a number of days (agenda_span = 10).

§agenda_start_day: Option<String>§week_start: WeekStart

org-agenda-start-on-weekday: “monday” or “sunday”.

§deadline_warning_days: i64§skip_scheduled_if_done: bool§skip_deadline_if_done: bool§skip_timestamp_if_done: bool§sorting_strategy: Vec<String>

org-agenda-sorting-strategy for agenda days, from SORTING_KEYS.

§log_done: LogMode

org-log-done, org-log-repeat, org-log-reschedule, org-log-redeadline: “off” (Emacs’s nil), “time” or “note”. #+STARTUP options win per file.

§log_repeat: LogMode§log_reschedule: LogMode§log_redeadline: LogMode§log_into_drawer: bool§editor: Vec<String>

Program and arguments to open a file; {file}, {line} and {col} are substituted. Run directly, never through a shell.

§theme: String

auto (follow the terminal background), dark or light.

§nerd_font: bool

Round pill and chip caps with Nerd Font glyphs; turn on when your terminal font has them (Ghostty, WezTerm and kitty bundle them).

§notation: Notation

How a capture line takes tags and a priority, and how agd shows tags: “agd” (#work, !A) or “org” (:work:, #A).

§start_view: String

The view key agd opens on, such as your dashboard or the built-in n; empty opens Today.

§agent_inbox: Option<String>

A [[capture]] key: every agent capture goes through that template without dates, so agent work reaches your day only through triage. Absent, agents choose a template.

§someday_tag: String§someday_clears_dates: bool

Someday also removes the dates that put the task on the agenda (SCHEDULED, and an overdue DEADLINE), so it leaves the agenda.

§reschedule_nudge: usize

Triage suggests Someday after this many reschedules.

§captures: Vec<CaptureTemplate>§views: Vec<ViewSettings>

The user’s own views only; all_views and view add the built-in ones.

§agent_profiles: Vec<AgentProfile>

Implementations§

Source§

impl Settings

Source

pub fn agenda_start(&self, today: NaiveDate) -> Result<NaiveDate, AgdError>

The first agenda day: agenda_start_day from today, or today.

Source

pub fn capture_template(&self, key: &str) -> Option<&CaptureTemplate>

Source

pub fn default_capture_template(&self) -> Result<&CaptureTemplate, AgdError>

The template a capture goes through when none is named: the first [[capture]]. (An agent’s capture then goes to agent_inbox when it is set, as every agent capture does.)

Source

pub fn capture_line_template<'a>( &self, line: &'a str, ) -> Result<(&CaptureTemplate, &'a str), AgdError>

How a capture line names its template, the one rule for every surface: the first word is the template key when it names a [[capture]] and more text follows; otherwise the whole line is the text for the default template. Returns the template and the text.

Source

pub fn find_capture_template( &self, key: &str, ) -> Result<&CaptureTemplate, AgdError>

The template key names, or an unknown_template error that lists the templates there are.

Source

pub fn find_view(&self, key: &str) -> Result<&ViewSettings, AgdError>

The view key runs, or an unknown_view error that lists every view, the built-in ones too.

Source

pub fn find_start_view(&self) -> Result<&ViewSettings, AgdError>

The view agd agenda --view without a key runs: start_view.

Source

pub fn view(&self, key: &str) -> Option<&ViewSettings>

The view key runs: the user’s [[view]], else a built-in one.

Source

pub fn all_views(&self) -> Vec<&ViewSettings>

Every view a key can run: the user’s [[view]]s in config order, then the built-in views they do not replace.

Source

pub fn is_builtin_view(&self, key: &str) -> bool

Whether key runs a built-in view rather than one of the user’s.

Source

pub fn apply_agent_profile( &mut self, name: &str, match_expression: Option<String>, ) -> Result<Option<String>, AgdError>

Narrows these settings to [[agent_profile]] name, as agd agenda --profile and MCP agenda do: its files replace agenda_files, and its match is the match unless match_expression gives one, which this returns.

Source

pub fn find_agent_profile(&self, name: &str) -> Result<&AgentProfile, AgdError>

The [[agent_profile]] name names, or an unknown_profile error that lists the profiles there are.

Source

pub fn editor_command( &self, file: &str, line: usize, col: usize, ) -> (String, Vec<String>)

The editor program and its arguments with {file}, {line} and {col} (both 1-based) substituted inside each argument. The result goes straight to the process API, never to a shell, so file names with spaces or quotes stay one argument.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Settings

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Settings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more