|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
use task.nu
|
|
|
|
|
use dirs.nu
|
|
|
|
|
use render.nu
|
|
|
|
|
use ci.nu
|
|
|
|
|
|
|
|
|
|
const ZELLIJ_LAYOUT = ($dirs.CONFIG | path join zellij/development.toml)
|
|
|
|
|
|
|
|
|
@ -11,8 +12,10 @@ export def --env main [] {
|
|
|
|
|
wezterm cli set-tab-title $"IDE (basename)"
|
|
|
|
|
}
|
|
|
|
|
let tmpdir = init
|
|
|
|
|
ci watch-bg
|
|
|
|
|
zellij --layout $ZELLIJ_LAYOUT --session (session-name)
|
|
|
|
|
rm -r $tmpdir
|
|
|
|
|
|
|
|
|
|
if $env.WEZTERM_PANE? != null {
|
|
|
|
|
wezterm cli set-tab-title ""
|
|
|
|
|
}
|
|
|
|
@ -44,11 +47,12 @@ export def floating-prompt [] {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export def last-notification [] {
|
|
|
|
|
let notif = open $env.NOTIFY_FILE | str trim
|
|
|
|
|
let notif = open $env.NOTIFY_FILE
|
|
|
|
|
|
|
|
|
|
if ($notif | str length) == 0 {
|
|
|
|
|
if $notif == null {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let notif = $"(ansi {attr: bi})($notif.title)(ansi reset) ($notif.content)"
|
|
|
|
|
|
|
|
|
|
$env.NTFY_CHKSUM = (shasum $env.NOTIFY_FILE)
|
|
|
|
|
|
|
|
|
@ -57,12 +61,13 @@ export def last-notification [] {
|
|
|
|
|
if not (task group exists $group_name) {
|
|
|
|
|
task group add $group_name -p 4
|
|
|
|
|
}
|
|
|
|
|
task spawn -d 10sec -g $group_name {
|
|
|
|
|
( task spawn -d 10sec -g $group_name {
|
|
|
|
|
if (shasum $env.NOTIFY_FILE) == $env.NTFY_CHKSUM {
|
|
|
|
|
"" | save -f $env.NOTIFY_FILE
|
|
|
|
|
"null" | save -f $env.NOTIFY_FILE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$notif
|
|
|
|
|
} | ignore )
|
|
|
|
|
|
|
|
|
|
return $notif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export def `doc-comment java-style` [] {
|
|
|
|
@ -125,13 +130,13 @@ def create-xdg-open [tmpbin: string] {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def --env create-notify-send [tmpdir: string, tmpbin: string] {
|
|
|
|
|
$env.NOTIFY_FILE = ($tmpdir | path join "notifications.txt")
|
|
|
|
|
$env.NOTIFY_FILE = ($tmpdir | path join "notifications.json")
|
|
|
|
|
touch $env.NOTIFY_FILE
|
|
|
|
|
|
|
|
|
|
let new_ntfy = ($tmpbin | path join "notify-send")
|
|
|
|
|
("#!/bin/env nu
|
|
|
|
|
def main [title: string, content: string] {
|
|
|
|
|
$\"(ansi {attr: bi})($title)(ansi reset) ($content)\\n\" | save -f $env.NOTIFY_FILE
|
|
|
|
|
{title: $title, content: $content} | to json | save -f $env.NOTIFY_FILE
|
|
|
|
|
}
|
|
|
|
|
" | save -f $new_ntfy)
|
|
|
|
|
chmod +x $new_ntfy
|
|
|
|
|