about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/add.nu3
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/dmenu.nu5
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/fstart.nu5
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/fstop.nu2
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/list.nu2
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/neorg.nu74
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/project.nu5
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/task.nu7
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/neorg/nu/workspace.nu25
9 files changed, 128 insertions, 0 deletions
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/add.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/add.nu
new file mode 100755
index 00000000..8cf9666c
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/add.nu
@@ -0,0 +1,3 @@
+export def "main" [] {
+    "hi!"
+}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/dmenu.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/dmenu.nu
new file mode 100755
index 00000000..177e7483
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/dmenu.nu
@@ -0,0 +1,5 @@
+# Select a project in dmenu mode
+#
+# This will give you all projects
+# and exectute the selected one as in 'neorg projects <selected>'
+def "main" [] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/fstart.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/fstart.nu
new file mode 100755
index 00000000..f77cd3f6
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/fstart.nu
@@ -0,0 +1,5 @@
+# Starts the task
+#
+# This only happens after it stooped
+# the previous active task, if it existed.
+def "main" [id: int] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/fstop.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/fstop.nu
new file mode 100755
index 00000000..bcaac944
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/fstop.nu
@@ -0,0 +1,2 @@
+# Stops the current active task
+def "main" [] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/list.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/list.nu
new file mode 100755
index 00000000..68a130f9
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/list.nu
@@ -0,0 +1,2 @@
+# Lists all available contexts
+def "main" [] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/neorg.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/neorg.nu
new file mode 100755
index 00000000..92af49cc
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/neorg.nu
@@ -0,0 +1,74 @@
+#!/usr/bin/env nu
+
+use add.nu main
+use dmenu.nu
+use fstart.nu
+use fstop.nu
+use list.nu
+use project.nu
+use task.nu
+use workspace.nu [main workspaces]
+
+# The core of the system-integrated task handling and management
+def main [] {
+    add
+}
+
+# Allows you to quickly add projects
+def "main add" [] {
+    add
+}
+
+# Select a project in dmenu mode
+#
+# This will give you all projects
+# and exectute the selected one as in 'neorg projects <selected>'
+def "main dmenu" [] {
+    dmenu
+}
+
+# Starts the task
+#
+# This only happens after it stooped
+# the previous active task, if it existed.
+def "main fstart" [id: int] {
+    fstart
+}
+
+# Stops the current active task
+def "main fstop" [] {
+    fstop
+}
+
+# Lists all available contexts
+def "main list" [] {
+    list
+}
+
+# Opens the project in the webbrowser
+#
+# Opens the webbrowser with either the context (P) or
+# the current active context as argument if no context is supplied
+def "main project" [project?: string] {
+    project
+}
+
+# Open the context of a task
+#
+# Open the neorg context associated with the current context and
+# the uuid of the task with id ID. Without ID, it'll open the
+# current context's norg file.
+# If no context is set, drops you to the selection prompt
+def "main task" [id?: int] {
+    task
+}
+
+# Open a neorg workspace
+#
+# The neorg workspace to open at startup, an empty value drops
+# you at a prompt to enter the workspace yourself.
+def "main workspace" [
+    workspace?: string@workspaces # The workspace to open
+] {
+    workspace $workspace
+}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/project.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/project.nu
new file mode 100755
index 00000000..530eab9b
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/project.nu
@@ -0,0 +1,5 @@
+# Opens the project in the webbrowser
+#
+# Opens the webbrowser with either the context (P) or
+# the current active context as argument if no context is supplied
+def "main" [project?: string] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/task.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/task.nu
new file mode 100755
index 00000000..41d1d6e5
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/task.nu
@@ -0,0 +1,7 @@
+# Open the context of a task
+#
+# Open the neorg context associated with the current context and
+# the uuid of the task with id ID. Without ID, it'll open the
+# current context's norg file.
+# If no context is set, drops you to the selection prompt
+def "main" [id?: int] {}
diff --git a/hm/soispha/pkgs/scripts/specific/neorg/nu/workspace.nu b/hm/soispha/pkgs/scripts/specific/neorg/nu/workspace.nu
new file mode 100755
index 00000000..dfa79f29
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/specific/neorg/nu/workspace.nu
@@ -0,0 +1,25 @@
+export def workspaces [] {
+    # echo "%ALL_WORKSPACES" | split row '|'
+    ["a", "b"]
+}
+
+
+export def "main" [ workspace?: string ] {
+    if $workspace != null {
+        let pred = workspaces | where $it == $workspace | is-empty
+        if $pred == false  {
+            true
+        } else {
+           error make {
+                msg: $"Your Workspace \(($workspace)) is not one of the defined ones: (workspaces)",
+            }
+        }
+   } else {
+        let tmp = mktemp
+        printf ":Neorg workspace " | save --append $tmp
+
+        nvim -c "NeorgStart" -s $tmp
+
+        rm $tmp
+   }
+}