"]
6 | license = "MIT"
7 | readme = "README.md"
8 |
9 | [tool.poetry.dependencies]
10 | python = "^3.9"
11 | dooit = "^3.2.2"
12 |
13 | [tool.poetry.group.dev.dependencies]
14 | ruff = "^0.7.2"
15 | pre-commit = "^4.0.1"
16 | textual-dev = "^1.6.1"
17 | pytest = "^8.3.3"
18 | coverage = "^7.6.4"
19 | pytest-asyncio = "^0.24.0"
20 | faker = "^30.8.2"
21 |
22 | [build-system]
23 | requires = ["poetry-core"]
24 | build-backend = "poetry.core.masonry.api"
25 |
26 | [tool.ruff.lint]
27 | ignore = ["F405", "F403"]
28 |
--------------------------------------------------------------------------------
/site/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/bun.lockb
--------------------------------------------------------------------------------
/site/docs/.vitepress/config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vitepress";
2 |
3 | // https://vitepress.dev/reference/site-config
4 | export default defineConfig({
5 | title: "Dooit Extras",
6 | description: "A collection of items to customize your dooit!",
7 | base: "/dooit-extras/",
8 | lastUpdated: true,
9 | themeConfig: {
10 | repo: "dooit-org/dooit-extras",
11 | docsDir: "site/docs",
12 | editLink: {
13 | pattern:
14 | "https://github.com/dooit-org/dooit-extras/edit/main/site/docs/:path",
15 | text: "Edit this page on GitHub",
16 | },
17 | nav: [
18 | { text: "Home", link: "/" },
19 | { text: "Get Started", link: "/getting_started/introduction" },
20 | ],
21 | socialLinks: [
22 | { icon: "github", link: "https://github.com/dooit-org/dooit-extras" },
23 | { icon: "discord", link: "https://discord.com/invite/WA2ER9MBWa" },
24 | { icon: "twitter", link: "https://twitter.com/kraanzu" },
25 | ],
26 | search: {
27 | provider: "local",
28 | },
29 | sidebar: [
30 | {
31 | text: "Getting Started",
32 | items: [
33 | { text: "Introduction", link: "/getting_started/introduction" },
34 | { text: "Usage", link: "/getting_started/usage" },
35 | ],
36 | },
37 | {
38 | text: "Formatters",
39 | collapsible: true,
40 | collapsed: true,
41 | items: [
42 | { text: "Description", link: "/formatters/description" },
43 | { text: "Due", link: "/formatters/due" },
44 | { text: "Effort", link: "/formatters/effort" },
45 | { text: "Recurrence", link: "/formatters/recurrence" },
46 | { text: "Status", link: "/formatters/status" },
47 | { text: "Urgency", link: "/formatters/urgency" },
48 | ],
49 | },
50 |
51 | {
52 | text: "Widgets",
53 | collapsible: true,
54 | collapsed: true,
55 | items: [
56 | { text: "Clock", link: "/widgets/clock" },
57 | { text: "Current Workspace", link: "/widgets/current_workspace" },
58 | { text: "Custom", link: "/widgets/custom" },
59 | { text: "Date", link: "/widgets/date" },
60 | { text: "Mode", link: "/widgets/mode" },
61 | { text: "Platform", link: "/widgets/platform" },
62 | { text: "Powerline", link: "/widgets/powerline" },
63 | { text: "Spacer", link: "/widgets/spacer" },
64 | { text: "Status Icons", link: "/widgets/status_icons" },
65 | { text: "TextBox", link: "/widgets/text_box" },
66 | { text: "Ticker", link: "/widgets/ticker" },
67 | { text: "Workspace Progress", link: "/widgets/workspace_progress" },
68 | ],
69 | },
70 | {
71 | text: "Scripts",
72 | collapsible: true,
73 | collapsed: true,
74 | items: [
75 | { text: "Toggle Workspaces", link: "/scripts/toggle_workspaces" },
76 | { text: "Custom Tree Borders", link: "/scripts/custom_tree_borders" },
77 | { text: "Dim Unfocused", link: "/scripts/dim_unfocused" },
78 | ],
79 | },
80 | {
81 | text: "Example Configs",
82 | collapsible: true,
83 | collapsed: true,
84 | items: [
85 | { text: "Config 1", link: "/configs/config1" },
86 | { text: "Config 2", link: "/configs/config2" },
87 | { text: "Config 3", link: "/configs/config3" },
88 | ],
89 | },
90 | ],
91 | },
92 | });
93 |
--------------------------------------------------------------------------------
/site/docs/.vitepress/theme/FiraCodeNerdFont-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/.vitepress/theme/FiraCodeNerdFont-Regular.ttf
--------------------------------------------------------------------------------
/site/docs/.vitepress/theme/index.js:
--------------------------------------------------------------------------------
1 | import DefaultTheme from 'vitepress/theme'
2 | import './style.css'
3 |
4 | export default DefaultTheme
5 |
--------------------------------------------------------------------------------
/site/docs/.vitepress/theme/style.css:
--------------------------------------------------------------------------------
1 | /* .vitepress/theme/style.css */
2 | @font-face{
3 | font-family: "NerdFont";
4 | src:local("FiraCodeNerdFont-Regular"),
5 | url('./FiraCodeNerdFont-Regular.ttf')
6 | }
7 |
8 | .nerd-icon {
9 | font-family: 'NerdFont', sans-serif;
10 | font-size: 20px;
11 | }
12 |
--------------------------------------------------------------------------------
/site/docs/configs/code/config1.py:
--------------------------------------------------------------------------------
1 | from dooit.ui.api import DooitAPI, subscribe
2 | from dooit.ui.api.events import Startup
3 | from rich.style import Style
4 | from dooit_extras.formatters import *
5 | from dooit_extras.bar_widgets import *
6 | from dooit_extras.scripts import *
7 | from rich.text import Text
8 |
9 |
10 | @subscribe(Startup)
11 | def setup_formatters(api: DooitAPI, _):
12 | fmt = api.formatter
13 | theme = api.vars.theme
14 |
15 | # ------- WORKSPACES -------
16 | format = Text(" ({}) ", style=theme.primary).markup
17 | fmt.workspaces.description.add(description_children_count(format))
18 |
19 | # --------- TODOS ---------
20 | # status formatter
21 | fmt.todos.status.add(status_icons(completed=" ", pending=" ", overdue=" "))
22 |
23 | # urgency formatte
24 | u_icons = {1: " ", 2: " ", 3: " ", 4: " "}
25 | fmt.todos.urgency.add(urgency_icons(icons=u_icons))
26 |
27 | # due formatter
28 | fmt.todos.due.add(due_casual_format())
29 | fmt.todos.due.add(due_icon(completed=" ", pending=" ", overdue=" "))
30 |
31 | # description formatter
32 | format = Text(" {completed_count}/{total_count}", style=theme.green).markup
33 | fmt.todos.description.add(todo_description_progress(fmt=format))
34 | fmt.todos.description.add(description_highlight_tags(fmt=" {}"))
35 |
36 |
37 | @subscribe(Startup)
38 | def setup_bar(api: DooitAPI, _):
39 | theme = api.vars.theme
40 |
41 | widgets = [
42 | Mode(api),
43 | Spacer(api, width=0),
44 | StatusIcons(api, bg=theme.background2),
45 | TextBox(api, text=" ", bg=theme.primary),
46 | TextBox(api, text=" -4°C ", fg=theme.foreground3, bg=theme.background3),
47 | TextBox(api, text=" ", bg=theme.primary),
48 | Clock(api, format="%I:%M %p", fg=theme.foreground3, bg=theme.background3),
49 | ]
50 | api.bar.set(widgets)
51 |
52 |
53 | @subscribe(Startup)
54 | def setup_dashboard(api: DooitAPI, _):
55 | from datetime import datetime
56 |
57 | theme = api.vars.theme
58 |
59 | now = datetime.now()
60 | formatted_date = now.strftime(" %A, %d %b ")
61 |
62 | header = Text(
63 | "I alone shall stand against the darkness of my overdue tasks",
64 | style=Style(color=theme.primary, bold=True, italic=True),
65 | )
66 |
67 | ascii_art = r"""
68 | .
69 | / V\
70 | / ` /
71 | << |
72 | / |
73 | / |
74 | / |
75 | / \ \ /
76 | ( ) | |
77 | ________| _/_ | |
78 | <__________\______)\__)
79 | """
80 |
81 | items = [
82 | header,
83 | "",
84 | Text(ascii_art, style=api.vars.theme.primary),
85 | "",
86 | Text(
87 | formatted_date,
88 | style=Style(color=theme.secondary, bold=True, italic=True),
89 | ),
90 | ]
91 | api.dashboard.set(items)
92 |
--------------------------------------------------------------------------------
/site/docs/configs/code/config2.py:
--------------------------------------------------------------------------------
1 | from dooit.api import Todo
2 | from dooit.ui.api import DooitAPI, subscribe
3 | from dooit.ui.api.events import Startup
4 | from dooit.api.theme import DooitThemeBase
5 | from dooit.ui.api.widgets import TodoWidget
6 | from rich.style import Style
7 | from dooit_extras.formatters import *
8 | from dooit_extras.bar_widgets import *
9 | from dooit_extras.scripts import *
10 | from rich.text import Text
11 |
12 |
13 | class DooitThemeCatppuccin(DooitThemeBase):
14 | _name: str = "dooit-catppuccin"
15 |
16 | # background colors
17 | background1: str = "#1e1e2e" # Darkest
18 | background2: str = "#313244"
19 | background3: str = "#45475a" # Lightest
20 |
21 | # foreground colors
22 | foreground1: str = "#a6adc8" # Lightest
23 | foreground2: str = "#bac2de"
24 | foreground3: str = "#cdd6f4" # Darkest
25 |
26 | # other colors
27 | red: str = "#f38ba8"
28 | orange: str = "#fab387"
29 | yellow: str = "#f9e2af"
30 | green: str = "#a6e3a1"
31 | blue: str = "#89b4fa"
32 | purple: str = "#b4befe"
33 | magenta: str = "#f5c2e7"
34 | cyan: str = "#89dceb"
35 |
36 | # accent colors
37 | primary: str = purple
38 | secondary: str = blue
39 |
40 |
41 | @subscribe(Startup)
42 | def setup_colorscheme(api: DooitAPI, _):
43 | api.css.set_theme(DooitThemeCatppuccin)
44 |
45 |
46 | @subscribe(Startup)
47 | def setup_formatters(api: DooitAPI, _):
48 | fmt = api.formatter
49 | theme = api.vars.theme
50 |
51 | # ------- WORKSPACES -------
52 | format = Text(" ({}) ", style=theme.primary).markup
53 | fmt.workspaces.description.add(description_children_count(format))
54 |
55 | # --------- TODOS ---------
56 | # status formatter
57 | fmt.todos.status.add(status_icons(completed=" ", pending=" ", overdue=" "))
58 |
59 | # urgency formatte
60 | u_icons = {1: " ", 2: " ", 3: " ", 4: " "}
61 | fmt.todos.urgency.add(urgency_icons(icons=u_icons))
62 |
63 | # due formatter
64 | fmt.todos.due.add(due_casual_format())
65 | fmt.todos.due.add(due_icon(completed=" ", pending=" ", overdue=" "))
66 |
67 | # effort formatter
68 | fmt.todos.effort.add(effort_icon(icon=" "))
69 |
70 | # description formatter
71 | format = Text(" {completed_count}/{total_count}", style=theme.green).markup
72 | fmt.todos.description.add(todo_description_progress(fmt=format))
73 | fmt.todos.description.add(description_highlight_tags(fmt=" {}"))
74 | fmt.todos.description.add(description_strike_completed())
75 |
76 |
77 | @subscribe(Startup)
78 | def setup_layout(api: DooitAPI, _):
79 | api.layouts.todo_layout = [
80 | TodoWidget.status,
81 | TodoWidget.effort,
82 | TodoWidget.description,
83 | TodoWidget.due,
84 | ]
85 |
86 |
87 | @subscribe(Startup)
88 | def setup_bar(api: DooitAPI, _):
89 | theme = api.vars.theme
90 |
91 | widgets = [
92 | TextBox(api, " ", bg=theme.magenta),
93 | Spacer(api, width=1),
94 | Mode(api, format_normal=" NORMAL ", format_insert=" INSERT "),
95 | Spacer(api, width=0),
96 | WorkspaceProgress(api, fmt=" {}% ", bg=theme.secondary),
97 | Spacer(api, width=1),
98 | Date(api, fmt=" {} "),
99 | ]
100 | api.bar.set(widgets)
101 |
102 |
103 | @subscribe(Startup)
104 | def setup_dashboard(api: DooitAPI, _):
105 | theme = api.vars.theme
106 |
107 | ascii_art = r"""
108 | ,-. _,---._ __ / \
109 | / ) .-' `./ / \
110 | ( ( ,' `/ /|
111 | \ `-" \'\ / |
112 | `. , \ \ / |
113 | /`. ,'-`----Y |
114 | ( ; | '
115 | | ,-. ,-' | /
116 | | | ( | TODOS | /
117 | ) | \ `.___________|/
118 | `--' `--'
119 | """
120 |
121 | ascii_art = Text(ascii_art, style=theme.primary)
122 | ascii_art.highlight_words(["TODOS"], style=theme.red)
123 |
124 | due_today = sum([1 for i in Todo.all() if i.is_due_today and i.is_pending])
125 | overdue = sum([1 for i in Todo.all() if i.is_overdue])
126 |
127 | header = Text(
128 | "Another day, another opportunity to organize my todos and then procrastinate",
129 | style=Style(color=theme.secondary, bold=True, italic=True),
130 | )
131 |
132 | items = [
133 | header,
134 | ascii_art,
135 | "",
136 | "",
137 | Text(" Tasks pending today: {}".format(due_today), style=theme.green),
138 | Text(" Tasks still overdue: {}".format(overdue), style=theme.red),
139 | ]
140 | api.dashboard.set(items)
141 |
--------------------------------------------------------------------------------
/site/docs/configs/code/config3.py:
--------------------------------------------------------------------------------
1 | from dooit.ui.api import DooitAPI, subscribe
2 | from dooit.ui.api.events import Startup
3 | from dooit.api.theme import DooitThemeBase
4 | from dooit.ui.api.widgets import TodoWidget
5 | from rich.style import Style
6 | from dooit_extras.formatters import *
7 | from dooit_extras.bar_widgets import *
8 | from dooit_extras.scripts import *
9 | from rich.text import Text
10 |
11 |
12 | class Everforest(DooitThemeBase):
13 | _name: str = "dooit-everforest"
14 |
15 | # background colors
16 | background1: str = "#2b3339" # Darkest
17 | background2: str = "#323d43" # Lighter
18 | background3: str = "#3a454a" # Lightest
19 |
20 | # foreground colors
21 | foreground1: str = "#d3c6aa" # Darkest
22 | foreground2: str = "#e9e8d2" # Lighter
23 | foreground3: str = "#fdf6e3" # Lightest
24 |
25 | # other colors
26 | red: str = "#e67e80" # Red
27 | orange: str = "#e69875" # Orange
28 | yellow: str = "#dbbc7f" # Yellow
29 | green: str = "#a7c080" # Green
30 | blue: str = "#7fbbb3" # Blue
31 | purple: str = "#d699b6" # Purple
32 | magenta: str = "#d699b6" # Magenta (same as purple in Everforest)
33 | cyan: str = "#83c092" # Cyan
34 |
35 | # accent colors
36 | primary: str = cyan
37 | secondary: str = green
38 |
39 |
40 | @subscribe(Startup)
41 | def setup_colorscheme(api: DooitAPI, _):
42 | api.css.set_theme(Everforest)
43 |
44 |
45 | @subscribe(Startup)
46 | def setup_formatters(api: DooitAPI, _):
47 | fmt = api.formatter
48 | theme = api.vars.theme
49 |
50 | # ------- WORKSPACES -------
51 | format = Text(" ({}) ", style=theme.primary).markup
52 | fmt.workspaces.description.add(description_children_count(format))
53 |
54 | # --------- TODOS ---------
55 | # status formatter
56 | fmt.todos.status.add(status_icons(completed=" ", pending=" ", overdue=" "))
57 |
58 | # urgency formatte
59 | u_icons = {1: " ", 2: " ", 3: " ", 4: " "}
60 | fmt.todos.urgency.add(urgency_icons(icons=u_icons))
61 |
62 | # due formatter
63 | fmt.todos.due.add(due_casual_format())
64 | fmt.todos.due.add(due_icon(completed=" ", pending=" ", overdue=" "))
65 |
66 | # effort formatter
67 | fmt.todos.effort.add(effort_icon(icon=" "))
68 |
69 | # description formatter
70 | format = Text(" {completed_count}/{total_count}", style=theme.green).markup
71 | fmt.todos.description.add(todo_description_progress(fmt=format))
72 | fmt.todos.description.add(description_highlight_tags(fmt=" {}"))
73 | fmt.todos.description.add(description_strike_completed())
74 |
75 |
76 | @subscribe(Startup)
77 | def setup_layout(api: DooitAPI, _):
78 | api.layouts.todo_layout = [
79 | TodoWidget.status,
80 | TodoWidget.description,
81 | TodoWidget.due,
82 | ]
83 |
84 |
85 | @subscribe(Startup)
86 | def setup_bar(api: DooitAPI, _):
87 | theme = api.vars.theme
88 | mode_style = Style(color=theme.background1, bgcolor=theme.primary, bold=True)
89 |
90 | widgets = [
91 | Mode(
92 | api,
93 | format_normal="NOR",
94 | format_insert="INS",
95 | fmt=Text(" {}", style=mode_style).markup,
96 | ),
97 | Powerline.right_rounded(api, fg=theme.primary),
98 | Spacer(api, width=0),
99 | Powerline.left_rounded(api, fg=theme.primary),
100 | Ticker(api, fmt=" {} "),
101 | Powerline.left_rounded(api, fg=theme.yellow, bg=theme.primary),
102 | Clock(api, format="%H:%M", fmt=" {} ", bg=theme.yellow),
103 | ]
104 | api.bar.set(widgets)
105 |
106 |
107 | @subscribe(Startup)
108 | def setup_dashboard(api: DooitAPI, _):
109 | theme = api.vars.theme
110 |
111 | ascii_art = r"""
112 | ____
113 | v _( )
114 | _ ^ _ v (___(__)
115 | '_\V/ `
116 | ' oX`
117 | X
118 | X Help, I can't finish!
119 | X - .
120 | X \O/ |\
121 | X.a##a. M |_\
122 | .aa########a.>> _____|_____
123 | .a################aa. \ DOOIT /
124 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125 | """
126 |
127 | ascii_art = Text(ascii_art, style=theme.primary)
128 | ascii_art.highlight_words([" Help, I can't finish! "], style="reverse")
129 | ascii_art.highlight_words([" DOOIT "], style=theme.secondary)
130 |
131 | header = Text(
132 | "Welcome again to your daily life, piled with unfinished tasks!",
133 | style=Style(color=theme.secondary, bold=True, italic=True),
134 | )
135 |
136 | items = [
137 | header,
138 | ascii_art,
139 | "",
140 | "",
141 | Text("Will you finish your tasks today?", style=theme.secondary),
142 | ]
143 | api.dashboard.set(items)
144 |
145 |
146 | @subscribe(Startup)
147 | def additional_setup(api: DooitAPI, _):
148 | dim_unfocused(api, "60%")
149 |
--------------------------------------------------------------------------------
/site/docs/configs/config1.md:
--------------------------------------------------------------------------------
1 |
14 |
15 | # Config 1
16 |
17 | A cool configuration based on [`Nord Theme`](https://www.nordtheme.com/)
18 |
19 | ## Screenshots
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 |
30 |
31 | ## Code
32 |
33 | <<< ./code/config1.py
34 |
--------------------------------------------------------------------------------
/site/docs/configs/config2.md:
--------------------------------------------------------------------------------
1 |
14 |
15 | # Config 2
16 |
17 | A colorful configuration based on [`Catppuccin Colorscheme`](https://catppuccin.com/)
18 |
19 | ## Screenshots
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 |
30 |
31 | ## Code
32 | <<< ./code/config2.py
33 |
--------------------------------------------------------------------------------
/site/docs/configs/config3.md:
--------------------------------------------------------------------------------
1 |
14 |
15 | # Config 3
16 |
17 | A calm configuration based on [`Everforest Colorscheme`](https://github.com/sainnhe/everforest)
18 |
19 | ## Screenshots
20 |
21 |
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 |
30 |
31 | ## Code
32 | <<< ./code/config3.py
33 |
--------------------------------------------------------------------------------
/site/docs/configs/previews/config1/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config1/dashboard.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config1/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config1/help.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config1/mainscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config1/mainscreen.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config2/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config2/dashboard.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config2/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config2/help.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config2/mainscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config2/mainscreen.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config3/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config3/dashboard.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config3/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config3/help.png
--------------------------------------------------------------------------------
/site/docs/configs/previews/config3/mainscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/configs/previews/config3/mainscreen.png
--------------------------------------------------------------------------------
/site/docs/formatters/description.md:
--------------------------------------------------------------------------------
1 | # Description Formatters
2 |
3 | ## Children Count
4 |
5 | This formatter shows the count of children present in a given `Todo`/`Workspace`
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | fmt | `" ({}) "` | The format for showing the children |
10 |
11 | ```python
12 |
13 | from dooit_extras.formatters import description_children_count
14 | from dooit.ui.api.events import subscribe, Startup
15 |
16 |
17 | @subscribe(Startup)
18 | def setup(api, _):
19 | # ...
20 | api.formatter.workspaces.description.add(description_children_count(fmt = "..."))
21 | api.formatter.todos.description.add(description_children_count(fmt = "..."))
22 | # ...
23 | ```
24 |
25 | ## Highlight Link
26 |
27 | This formatter highlights any url present within the description with theme accent
28 |
29 | | Param|Default
|Description|
30 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
31 | | color | `None` | The color to use for highlighting URLs. If not provided, uses the theme's primary color |
32 |
33 | ```python
34 |
35 | from dooit_extras.formatters import description_highlight_link
36 | from dooit.ui.api.events import subscribe, Startup
37 |
38 | @subscribe(Startup)
39 | def setup(api, _):
40 | # ...
41 | api.formatter.workspaces.description.add(description_highlight_link())
42 | api.formatter.todos.description.add(description_highlight_link())
43 | # ...
44 | ```
45 |
46 | ## Highlight Tags
47 |
48 | This formatter highlights the tags(words starting with `@`) present in the description
49 |
50 | | Param|Default
|Description|
51 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
52 | | color | `""` | The color/style to use for highlighting the tags, Defaults to theme's primary color |
53 | | fmt |" {}"| The format to use to show the tags |
54 |
55 | ```python
56 |
57 | from dooit_extras.formatters import description_highlight_tags
58 | from dooit.ui.api.events import subscribe, Startup
59 |
60 | @subscribe(Startup)
61 | def setup(api, _):
62 | # ...
63 | api.formatter.workspaces.description.add(description_highlight_tags())
64 | api.formatter.todos.description.add(description_highlight_tags())
65 | # ...
66 | ```
67 |
68 |
69 | ## Strike Completed
70 |
71 | This formatter strikes the todos which are completed, and optionally dimmify them
72 |
73 | | Param|Default
|Description|
74 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
75 | | dim | `True` | Whether to dim the todo description |
76 |
77 | ```python
78 |
79 | from dooit.ui.api.events import subscribe, Startup
80 | from dooit_extras.formatters import description_strike_completed
81 |
82 |
83 | @subscribe(Startup)
84 | def setup(api, _):
85 | # ...
86 | api.formatter.workspaces.description.add(description_strike_completed(dim = True))
87 | api.formatter.todos.description.add(description_strike_completed(dim = True))
88 | # ...
89 | ```
90 |
91 | ## Todo Progress
92 |
93 | Formatter to show the progress of a current todo with subtasks
94 |
95 | ***Parameters***:
96 |
97 | | Param|Default
|Description|
98 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
99 | | fmt | `" ({completed_percent}%)"` | The format of the progress |
100 |
101 |
102 | Options available for `fmt` parameters are:
103 |
104 | |Name
|Description|
105 | | :----------------: | :----------------------------------------------------------------------------------------|
106 | | completed_percent | The current progress in percentage (1-100) |
107 | | remaining_percent | The remaining progress in percentage (1-100) |
108 | | completed_count | The number of subtask completed |
109 | | remaining_count | The number of subtask not completed |
110 | | total_count | The total number of subtask the todo has |
111 |
112 | ```python
113 |
114 | from dooit_extras.formatters import todo_description_progress
115 | from dooit.ui.api.events import subscribe, Startup
116 |
117 |
118 | @subscribe(Startup)
119 | def setup(api, _):
120 | # ...
121 | api.formatter.todos.description.add(todo_description_progress())
122 | # ...
123 | ```
124 |
--------------------------------------------------------------------------------
/site/docs/formatters/due.md:
--------------------------------------------------------------------------------
1 | # Due Formatters
2 |
3 | ## Casual Format
4 |
5 | This widget shows the date in a simple format
6 |
7 | Eg: Instead of the default `yyyy-mm-dd`, it'll show in the format: \
8 | `{Mon} {day} ['year(optional)] + `
9 |
10 | | Param|Default
|Description|
11 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
12 | | fmt | `"{}"` | The custom format for showing the value |
13 |
14 | ```python
15 |
16 | from dooit_extras.formatters import due_casual_format
17 | from dooit.ui.api.events import subscribe, Startup
18 |
19 | @subscribe(Startup)
20 | def setup(api, _):
21 | # ...
22 | api.formatter.todos.due.add(due_casual_format())
23 | # ...
24 | ```
25 |
26 |
27 | ## Danger Today
28 |
29 | This formatter shows a bold red `Today` text when the todo is due on the same day
30 |
31 | ```python
32 |
33 | from dooit_extras.formatters import due_danger_today
34 | from dooit.ui.api.events import subscribe, Startup
35 |
36 | | Param|Default
|Description|
37 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
38 | | fmt | `"{}"` | The custom format for showing the value |
39 |
40 | @subscribe(Startup)
41 | def setup(api, _):
42 | # ...
43 | api.formatter.todos.due.add(due_danger_today())
44 | # ...
45 | ```
46 |
47 | ## Due Icon
48 |
49 | This formatter shows due icons based on status.
50 |
51 | | Param |Default
| Description |
52 | |-------------|:--------------------------------------:|:-------------------------------------------------|
53 | | completed | | Icon for completed todo |
54 | | pending | | Icon for pending todo |
55 | | overdue | | Icon for overdue todo |
56 |
57 |
58 | ```python
59 |
60 | from dooit_extras.formatters import due_icon
61 | from dooit.ui.api.events import subscribe, Startup
62 |
63 | @subscribe(Startup)
64 | def setup(api, _):
65 | # ...
66 | api.formatter.todos.due.add(due_icon())
67 | # ...
68 | ```
69 |
--------------------------------------------------------------------------------
/site/docs/formatters/effort.md:
--------------------------------------------------------------------------------
1 | # Effort Formatters
2 |
3 | ## Effort Icon
4 |
5 | This formatter shows an icon for todos that have effort enabled
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | icon | | The icon to show for todos with effort |
10 | | color | `None` | The color to use for the icon. If not provided, uses the theme's orange color |
11 | | show_on_zero | `True` | Whether to show the icon when effort is 0 |
12 |
13 | ```python
14 |
15 | from dooit_extras.formatters import effort_icon
16 | from dooit.ui.api import DooitAPI, subscribe
17 | from dooit.ui.api.events import Startup
18 |
19 | @subscribe(Startup)
20 | def setup(api: DooitAPI, _):
21 | # ...
22 | api.formatter.todos.effort.add(effort_icon())
23 | # ...
24 | ```
--------------------------------------------------------------------------------
/site/docs/formatters/recurrence.md:
--------------------------------------------------------------------------------
1 | Recurrence Formatters
2 |
3 | ## Recurrence Icon
4 |
5 | This formatter shows an icon for todos that have recurrence enabled
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | icon | | The icon to show for recurring todos |
10 | | color | `None` | The color to use for the icon. If not provided, uses the theme's primary color |
11 |
12 |
13 | ```python
14 |
15 | from dooit_extras.formatters import recurrence_icon
16 | from dooit.ui.api import DooitAPI, subscribe
17 | from dooit.ui.api.events import Startup
18 |
19 | @subscribe(Startup)
20 | def setup(api: DooitAPI, _):
21 | # ...
22 | api.formatter.todos.recurrence.add(recurrence_icon())
23 | # ...
24 | ```
25 |
--------------------------------------------------------------------------------
/site/docs/formatters/status.md:
--------------------------------------------------------------------------------
1 | # Status Formatters
2 |
3 | ## Status Icons
4 |
5 | This formatter shows different icons based on the current status of the todo
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | completed | `"x"` | The icon to show when status is `completed` |
10 | | pending | `"o"` | The icon to show when status is `pending` |
11 | | overdue | `"!"` | The icon to show when status is `overdue` |
12 |
13 |
14 | ::: tip INFO
15 | By default, the colors are theme versions of `green`, `yellow` and `red`
16 | :::
17 |
18 | ### Usage:
19 |
20 | ```python
21 |
22 | from dooit_extras.formatters import status_icons
23 | from dooit.ui.api.events import subscribe, Startup
24 |
25 | @subscribe(Startup)
26 | def setup(api, _):
27 | # ...
28 | api.formatter.todos.status.add(status_icons(...))
29 | # ...
30 | ```
31 |
32 |
33 |
--------------------------------------------------------------------------------
/site/docs/formatters/urgency.md:
--------------------------------------------------------------------------------
1 | # Urgency Formatters
2 |
3 | ## Urgency Icons
4 |
5 | This formatter shows different icons based on the urgency level of the todo
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | icons | `{}` | A dictionary with icon for respective urgency levels |
10 | | colors | `{}` | A dictionary with styles for respective urgency levels |
11 |
12 | Example icons:
13 |
14 | Example icons:
15 |
16 | ```py
17 | {1: "", 2: "", 3: "", 4: "1"}
18 | ```
19 |
20 | Example colors:
21 |
22 | ```py
23 | {1: theme.green, 2: theme.yellow, 3: theme.orange, 4: theme.red}
24 | ```
25 |
26 | ### Usage:
27 |
28 | ```python
29 |
30 | from dooit_extras.formatters import urgency_icons
31 | from dooit.ui.api.events import subscribe, Startup
32 |
33 | @subscribe(Startup)
34 | def setup(api, _):
35 | # ...
36 | api.formatter.todos.urgency.add(urgency_icons())
37 | # ...
38 | ```
--------------------------------------------------------------------------------
/site/docs/getting_started/introduction.md:
--------------------------------------------------------------------------------
1 | # Dooit Extras
2 |
3 | Dooit extras is a library consisting of pre-built stuff for Dooit \
4 | which includes various bar widgets and formatters.
5 |
6 | Along with some pre-configured configs to get you started!
7 |
8 |
9 | ## Installation
10 |
11 | You can refere to [dooit's installation guide](/) which also includes `dooit-extras`
12 |
13 | :::tip :grey_exclamation: NOTE
14 | Dooit extras uses [`Nerd Font Icons`](https://www.nerdfonts.com/) for everything, so make sure you're using that \
15 | otherwise you'll see gibberish icons
16 | :::
17 |
18 | ### Rich and Style
19 |
20 | Already mentioned in [Dooit's documentation](https://dooit-org.github.io/dooit/getting_started/introduction.html#rich) but just reminding that it'll be great to famaliarize yourself with rich's `Text` and `Style` classes if you want to customize!
21 |
--------------------------------------------------------------------------------
/site/docs/getting_started/usage.md:
--------------------------------------------------------------------------------
1 | # Using utilities
2 |
3 | The libray provides `Formatters`, `Bar Widgets` and `Sample Configs`
4 |
5 | ## Formatters
6 |
7 | Check out all the formatters [here](/formatters/description) \
8 | Every one of them also has an example code to use :)
9 |
10 |
11 | ## Bar Widgets
12 |
13 | Check out all the bar widgets [here](/widgets/clock)
14 |
15 | They can be configured with different colors, plus have some custom options such as `TextBox` and `Custom`
16 |
17 | ## Sample Configs
18 |
19 | This library have a few sample configurations pre-made for you so you can better understand some stuff and create something awesome of your own
20 |
21 |
22 | #### Thank you for using dooit <3
23 |
--------------------------------------------------------------------------------
/site/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: home
3 |
4 | hero:
5 | name: "Dooit Extras"
6 | tagline: "A collection of utilities to customize your dooit!"
7 | actions:
8 | - theme: brand
9 | text: Get Started
10 | link: /getting_started/introduction
11 | - theme: alt
12 | text: View on Github
13 | link: https://www.github.com/dooit-org/dooit-extras
14 | features:
15 | - icon:
16 | title: Customizability
17 | details: Dooit Extras comes with a bunch of formatters, widgets etc which you can further tweak by changing some parameters!
18 | - icon:
19 | title: Configs
20 | details: Dooit Extras comes with a few sample configs which you can use or take inspiration from to rich your dooit
21 | ---
22 |
--------------------------------------------------------------------------------
/site/docs/scripts/custom_tree_borders.md:
--------------------------------------------------------------------------------
1 | # Custom Tree Borders
2 |
3 | This script allows you to edit the border for workspaces and todo trees
4 |
5 | Check out available border types [here](https://textual.textualize.io/styles/border/#all-border-types)
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | api | | The dooit api object |
10 | | focus_border | | The border to use for the focused tree |
11 | | dim_border | | The border to use for the unfocused tree |
12 |
13 | Example:
14 |
15 | ```py
16 | from dooit.ui.api import DooitAPI, subscribe
17 | from dooit.ui.api.events import Startup
18 | from dooit_extras.scripts import custom_tree_borders
19 |
20 | @subscribe(Startup)
21 | def setup(api: DooitAPI, _):
22 | custom_tree_borders(api, "panel", "panel")
23 | ```
24 |
25 | Preview:
26 |
27 | 
28 |
--------------------------------------------------------------------------------
/site/docs/scripts/dim_unfocused.md:
--------------------------------------------------------------------------------
1 | # Dim Unfocused
2 |
3 | This script allows you to dimmify workspaces or todo tree which is Unfocused
4 | The value for opacity is in the format: `%` where number can be from 1 till 100
5 |
6 | | Param|Default
|Description|
7 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
8 | | api | | The dooit api object |
9 | | opacity | `"50%"` | The opacity of the unfocused tree |
10 |
11 | Example:
12 |
13 | ```py
14 | from dooit.ui.api import DooitAPI, subscribe
15 | from dooit.ui.api.events import Startup
16 | from dooit_extras.scripts import dim_unfocused
17 |
18 | @subscribe(Startup)
19 | def setup(api: DooitAPI, _):
20 | dim_unfocused(api, "50%")
21 | ```
22 |
23 | Preview:
24 |
25 | 
26 |
27 | 
28 |
--------------------------------------------------------------------------------
/site/docs/scripts/previews/custom_tree_borders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/scripts/previews/custom_tree_borders.png
--------------------------------------------------------------------------------
/site/docs/scripts/previews/dim_unfocused_todos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/scripts/previews/dim_unfocused_todos.png
--------------------------------------------------------------------------------
/site/docs/scripts/previews/dim_unfocused_workspaces.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/scripts/previews/dim_unfocused_workspaces.png
--------------------------------------------------------------------------------
/site/docs/scripts/previews/toggle_workspaces.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/scripts/previews/toggle_workspaces.mp4
--------------------------------------------------------------------------------
/site/docs/scripts/toggle_workspaces.md:
--------------------------------------------------------------------------------
1 | # Toggle Workspaces
2 |
3 | This script can toggle the view for workspaces tree
4 |
5 | You can bind it to a keybinding and use that
6 |
7 | | Param|Default
|Description|
8 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
9 | | api | | The dooit api object |
10 |
11 | Example:
12 |
13 | ```py
14 | from dooit.ui.api import DooitAPI, subscribe
15 | from dooit.ui.api.events import Startup
16 | from dooit_extras.scripts import toggle_workspaces
17 |
18 | @subscribe(Startup)
19 | def setup(api: DooitAPI, _):
20 | api.keys.set("", toggle_workspaces(api))
21 | ```
22 |
23 | Preview:
24 |
25 |
26 |
--------------------------------------------------------------------------------
/site/docs/widgets/clock.md:
--------------------------------------------------------------------------------
1 | # Clock
2 |
3 | A widget to show current time
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
9 | | format | `"%H:%M:%S"` | Format to show the clock in, by default it shows in hh:mm:ss format |
10 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
11 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
12 |
13 | ::: tip
14 | Check out [strfmt time cheetsheat](https://strftime.org/) for formats
15 | :::
16 |
17 |
18 | ## Usage
19 |
20 | ```python
21 | from dooit_extras.bar_widgets import Clock
22 | from dooit.ui.api.events import subscribe, Startup
23 |
24 | @subscribe(Startup)
25 | def setup(api, _):
26 | api.bar.set(
27 | [
28 | # ....
29 | Clock(api),
30 | # ....
31 | ]
32 | )
33 | ```
34 |
--------------------------------------------------------------------------------
/site/docs/widgets/current_workspace.md:
--------------------------------------------------------------------------------
1 | # Current Workspace
2 |
3 | A widget to show the works workspace
4 |
5 |
6 | | Key|Default
|Description|
7 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
8 | | api | | The api object provided within the function |
9 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
10 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
11 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
12 |
13 | ## Usage
14 |
15 | ```python
16 | from dooit_extras.bar_widgets import CurrentWorkspace
17 | from dooit.ui.api.events import subscribe, Startup
18 |
19 | @subscribe(Startup)
20 | def setup(api, _):
21 | api.bar.set(
22 | [
23 | # ....
24 | CurrentWorkspace(api),
25 | # ....
26 | ]
27 | )
28 | ```
29 |
--------------------------------------------------------------------------------
/site/docs/widgets/custom.md:
--------------------------------------------------------------------------------
1 | # Custom
2 |
3 | A widget which which takes in a custom function to display text
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | function | | Function top poll the value from, events and intervals can be set with [@subscribe](https://www.google.com) and [@timer](https://www.google.com) |
9 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
10 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
11 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
12 |
13 | ```python
14 | from dooit_extras.bar_widgets import Custom
15 | from dooit.ui.api.events import subscribe, timer, Startup, TodoEvent
16 | from dooit.ui.api import DooitAPI
17 |
18 | @subscribe(TodoEvent)
19 | def alert_todo_event(api: DooitAPI, event: TodoEvent):
20 | # ...
21 |
22 | @timer(1)
23 | def my_timer(api: DooitAPI, _):
24 | # ...
25 |
26 | @subscribe(Startup)
27 | def setup(api, _):
28 | api.bar.set(
29 | [
30 | # ....
31 | Custom(api, function = alert_todo_event),
32 | Custom(api, function = my_timer),
33 | # ....
34 | ]
35 | )
36 | ```
37 |
--------------------------------------------------------------------------------
/site/docs/widgets/date.md:
--------------------------------------------------------------------------------
1 | # Date
2 |
3 | A widget to show today's date
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
9 | | format | `"%b %d"` | Format to show the clock in, by default it shows in hh:mm:ss format |
10 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
11 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
12 |
13 | ::: tip
14 | Check out [strfmt time cheetsheat](https://strftime.org/) for formats
15 | :::
16 |
17 |
18 | ## Usage
19 |
20 | ```python
21 | from dooit_extras.bar_widgets import Date
22 | from dooit_extras.bar_widgets import CurrentWorkspace
23 | from dooit.ui.api.events import subscribe, Startup
24 |
25 | @subscribe(Startup)
26 | def setup(api, _):
27 | api.bar.set(
28 | [
29 | # ....
30 | Date(api),
31 | # ....
32 | ]
33 | )
34 | ```
35 |
--------------------------------------------------------------------------------
/site/docs/widgets/imgs/powerline_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/widgets/imgs/powerline_arrow.png
--------------------------------------------------------------------------------
/site/docs/widgets/imgs/powerline_flame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/widgets/imgs/powerline_flame.png
--------------------------------------------------------------------------------
/site/docs/widgets/imgs/powerline_ice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/widgets/imgs/powerline_ice.png
--------------------------------------------------------------------------------
/site/docs/widgets/imgs/powerline_rounded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/widgets/imgs/powerline_rounded.png
--------------------------------------------------------------------------------
/site/docs/widgets/imgs/powerline_triangles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dooit-org/dooit-extras/faab40ab94b1d2ba0a92cb951a6c5ea3926feb8b/site/docs/widgets/imgs/powerline_triangles.png
--------------------------------------------------------------------------------
/site/docs/widgets/mode.md:
--------------------------------------------------------------------------------
1 | # Mode
2 |
3 | A widget to show current mode (`NORMAL/INSERT`) of the app
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | format_normal | `"NORMAL"` | Specify how `normal` mode should be displayed in text |
9 | | format_insert | `"INSERT"` | Specify how `insert` mode should be displayed in text |
10 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
11 | | fg | `theme.background1`| Color to show the text in, defaults to `theme.background1` or `dark` based on theme |
12 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
13 |
14 | ```python
15 | from dooit_extras.bar_widgets import Mode
16 | from dooit.ui.api.events import subscribe, Startup
17 |
18 | @subscribe(Startup)
19 | def setup(api, _):
20 | theme = api.vars.theme
21 |
22 | api.bar.set(
23 | [
24 | # ....
25 | Mode(api)
26 | # ....
27 | ]
28 | )
29 | ```
30 |
--------------------------------------------------------------------------------
/site/docs/widgets/platform.md:
--------------------------------------------------------------------------------
1 | # Platform
2 |
3 | A widget to show the current OS platform!
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | icon | `True` | Whether to show the icon of the OS or not. |
9 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
10 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
11 |
12 | ::: tip
13 | If your system does not have an icon, feel free to [open an issue](https://github.com/dooit-org/dooit-extras/issues/new) :D
14 | :::
15 |
16 | ## Usage
17 |
18 | ```python
19 | from dooit_extras.bar_widgets import Platform
20 | from dooit.ui.api.events import subscribe, Startup
21 |
22 | @subscribe(Startup)
23 | def setup(api, _):
24 | api.bar.set(
25 | [
26 | # ....
27 | Platform(api),
28 | # ....
29 | ]
30 | )
31 | ```
32 |
--------------------------------------------------------------------------------
/site/docs/widgets/powerline.md:
--------------------------------------------------------------------------------
1 | # Powerline
2 |
3 | Widget store that provides various powerline separators
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
9 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
10 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
11 |
12 |
13 |
14 |
15 |
16 | ## Triangles
17 | 
18 |
19 | ```python
20 | from dooit_extras.bar_widgets import Powerline
21 | from dooit.ui.api.events import subscribe, Startup
22 |
23 | @subscribe(Startup)
24 | def setup(api, _):
25 | api.bar.set(
26 | [
27 | # ...
28 | Powerline.lower_left_triangle(...),
29 | Powerline.lower_right_triangle(...),
30 |
31 | Powerline.upper_left_triangle(...),
32 | Powerline.upper_right_triangle(...),
33 | # ...
34 | ]
35 | )
36 | ```
37 |
38 | ::: info
39 | The preview image for triangles was created with a combination of different triangle separators (4)
40 | :::
41 |
42 | ## Rounded
43 | 
44 |
45 | ```python
46 | from dooit_extras.bar_widgets import Powerline
47 | from dooit.ui.api.events import subscribe, Startup
48 |
49 | @subscribe(Startup)
50 | def setup(api, _):
51 | api.bar.set(
52 | [
53 | # ...
54 | Powerline.left_rouned(...),
55 | Powerline.right_rounded(...),
56 | # ...
57 | ]
58 | )
59 | ```
60 |
61 | ## Arrows
62 | 
63 | ```python
64 | from dooit_extras.bar_widgets import Powerline
65 | from dooit.ui.api.events import subscribe, Startup
66 |
67 | @subscribe(Startup)
68 | def setup(api, _):
69 | api.bar.set(
70 | [
71 | # ...
72 | Powerline.left_arrow(...),
73 | Powerline.right_arrow(...),
74 | # ...
75 | ]
76 | )
77 | ```
78 |
79 | ## Ice
80 | 
81 | ```python
82 | from dooit_extras.bar_widgets import Powerline
83 | from dooit.ui.api.events import subscribe, Startup
84 |
85 | @subscribe(Startup)
86 | def setup(api, _):
87 | api.bar.set(
88 | [
89 | # ...
90 | Powerline.left_ice(...),
91 | Powerline.right_ice(...),
92 | # ...
93 | ]
94 | )
95 | ```
96 |
97 | ## Flame
98 | 
99 | ```python
100 | from dooit_extras.bar_widgets import Powerline
101 | from dooit.ui.api.events import subscribe, Startup
102 |
103 | @subscribe(Startup)
104 | def setup(api, _):
105 | api.bar.set(
106 | [
107 | # ...
108 | Powerline.left_flame(...),
109 | Powerline.right_flame(...),
110 | # ...
111 | ]
112 | )
113 | ```
114 |
--------------------------------------------------------------------------------
/site/docs/widgets/spacer.md:
--------------------------------------------------------------------------------
1 | # Spacer
2 |
3 | A widget to add padding between widgets!
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | width | | The width of the spacer, set `0` to expand to full width |
9 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
10 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
11 |
12 | ## Usage
13 |
14 | ```python
15 | from dooit_extras.bar_widgets import Spacer
16 | from dooit.ui.api.events import subscribe, Startup
17 |
18 | @subscribe(Startup)
19 | def setup(api, _):
20 | api.bar.set(
21 | [
22 | # ....
23 | Spacer(api, width = 0), # takes all the space
24 | Spacer(api, width = 20), # takes 20 blocks worth of space
25 | # ....
26 | ]
27 | )
28 | ```
29 |
--------------------------------------------------------------------------------
/site/docs/widgets/status_icons.md:
--------------------------------------------------------------------------------
1 | # StatusIcons
2 |
3 | A widget to display count of `completed`, `pending` and `overdue` todos for selected workspace
4 |
5 | | Key | Default | Description |
6 | |----------------|:------------------------------------:|-------------------------------------------------------------------------------|
7 | | api | | The `api` object provided within the function. |
8 | | completed_icon | | Icon to represent completed tasks. |
9 | | pending_icon | | Icon to represent pending tasks. |
10 | | overdue_icon | | Icon to represent overdue tasks. |
11 | | fmt | `" {} "` | Format for displaying text, `{}` represents the value displayed. |
12 | | bg | `theme.background3` | Background color for the widget, defaults to `theme.background3` or a specified color.|
13 |
14 | ## Usage
15 |
16 | ```python
17 | from dooit_extras.bar_widgets import StatusIcons
18 | from dooit.ui.api.events import subscribe, Startup
19 |
20 | @subscribe(Startup)
21 | def setup(api, _):
22 | api.bar.set(
23 | [
24 | # ....
25 | StatusIcons(api),
26 | # ....
27 | ]
28 | )
29 | ```
30 |
31 |
--------------------------------------------------------------------------------
/site/docs/widgets/text_box.md:
--------------------------------------------------------------------------------
1 | # Text Box
2 |
3 | A widget to show static Text
4 |
5 | ::: tip
6 | Check out [Custom](/widgets/custom) if you want dynamic texts
7 | :::
8 |
9 | | Key|Default
|Description|
10 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
11 | | api | | The api object provided within the function |
12 | | text | | Text to show in the widget |
13 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
14 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
15 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
16 |
17 | ## Usage
18 |
19 | ```python
20 | from dooit_extras.bar_widgets import TextBox
21 | from dooit.ui.api.events import subscribe, Startup
22 |
23 | @subscribe(Startup)
24 | def setup(api, _):
25 | api.bar.set(
26 | [
27 | # ....
28 | TextBox(api, text = "Your text here!"),
29 | # ....
30 | ]
31 | )
32 | ```
33 |
--------------------------------------------------------------------------------
/site/docs/widgets/ticker.md:
--------------------------------------------------------------------------------
1 | # Ticker
2 |
3 | A widget to show a timer
4 |
5 | | Key|Default
|Description|
6 | | ------------ | :----------------: | :----------------------------------------------------------------------------------------|
7 | |api | | The api object provided within the function |
8 | |resume_key | `"s"` | Key to `start` or `resume` the timer to pause |
9 | |stop_key | `"S"` | Key to `stop/pause` the timer. Stopping again will `reset` the timer |
10 | |paused_text | `"Paused"` | Text to show when the timer is paused |
11 | |default_text | `"No Timers"` | Default text to show for the timer widget. When the timer is reset, this text will show as well|
12 | |fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
13 | |fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
14 | |bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
15 |
16 | ## Usage
17 |
18 | ```python
19 | from dooit_extras.bar_widgets import Ticker
20 | from dooit.ui.api.events import subscribe, Startup
21 |
22 | @subscribe(Startup)
23 | def setup(api, _):
24 | api.bar.set(
25 | [
26 | # ....
27 | Ticker(
28 | api,
29 | resume_key = "s",
30 | stop_key = "S",
31 | paused_text = "Paused",
32 | default_text = "No Timers",
33 | )
34 | # ....
35 | ]
36 | )
37 | ```
38 |
--------------------------------------------------------------------------------
/site/docs/widgets/workspace_progress.md:
--------------------------------------------------------------------------------
1 | # Workspace Progress
2 |
3 | A widget to show current completion progress in percentage for a workspace
4 |
5 | | Key|Default
|Description|
6 | | ------------- | :----------------: | :----------------------------------------------------------------------------------------|
7 | | api | | The api object provided within the function |
8 | | fmt | `" {} "` | Specify how the text should be formatted, `{}` represents the value that'll be displayed |
9 | | fg | `theme.foreground1`| Color to show the text in, defaults to `theme.foreground1` or `white` based on theme |
10 | | bg | `theme.primary` | Color to show the background in, defaults to `theme.primary` or `accent` based on theme |
11 |
12 | ## Usage
13 |
14 | ```python
15 | from dooit_extras.bar_widgets import WorkspaceProgress
16 | from dooit.ui.api.events import subscribe, Startup
17 |
18 | @subscribe(Startup)
19 | def setup(api, _):
20 | api.bar.set(
21 | [
22 | # ....
23 | WorkspaceProgress(api),
24 | # ....
25 | ]
26 | )
27 | ```
28 |
--------------------------------------------------------------------------------
/site/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dooit-extras",
3 | "type": "module",
4 | "devDependencies": {
5 | "vitepress": "^1.3.4"
6 | },
7 | "scripts": {
8 | "docs:dev": "vitepress dev docs",
9 | "docs:build": "vitepress build docs",
10 | "docs:preview": "vitepress preview docs"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------