1
0

Changed to fully Functional Scripting for most scripts

This commit is contained in:
2025-07-30 17:21:40 +02:00
parent 80a119972f
commit e6b082f38c
3 changed files with 11 additions and 16 deletions

View File

@@ -37,11 +37,8 @@ def get-week-of-month []: datetime -> int {
} }
def get-month-of-quarter []: datetime -> int { def get-month-of-quarter []: datetime -> int {
mut month = $in | format date '%m' | into int let month = ($in | format date '%m' | into int) + 3
while ($month > 3) { ($month..($month - 3)..1) | last
$month -= 3
}
$month
} }
def get-quarter []: datetime -> int { def get-quarter []: datetime -> int {

View File

@@ -1,8 +1,6 @@
export def lumen-kwin-get-class [waittimesec: int]: nothing -> string { export def lumen-kwin-get-class [waittimesec: int]: nothing -> string {
mut timer = $waittimesec for $i in $waittimesec..1 {
while ($timer > 0) { $i | print
$timer | print
$timer -= 1
sleep 1sec sleep 1sec
} }
qdbus6 org.kde.KWin /KWin queryWindowInfo qdbus6 org.kde.KWin /KWin queryWindowInfo

View File

@@ -1,14 +1,14 @@
export def lumen-search-content [searchstr: string]: any -> table { export def lumen-search-content [searchstr: string]: any -> table {
let $tmp = $in let $tmp = (if ($in != null) {
mut $path = pwd $in
if ($tmp != null) { } else {
$path = $tmp pwd
} })
cd $path cd $tmp
ls -a **/* | par-each {|i| ls -a **/* | par-each {|i|
{file: $i.name, {file: $i.name,
content: (if (($i | get type) == file ) { content: (if (($i | get type) == file ) {
try {open $i.name --raw | find $searchstr} catch {|err| {}} try {open $i.name --raw | find $searchstr} catch {{}}
}) })
} }
} | compact content -e } | compact content -e