Changed to fully Functional Scripting for most scripts
This commit is contained in:
@@ -37,11 +37,8 @@ def get-week-of-month []: datetime -> int {
|
||||
}
|
||||
|
||||
def get-month-of-quarter []: datetime -> int {
|
||||
mut month = $in | format date '%m' | into int
|
||||
while ($month > 3) {
|
||||
$month -= 3
|
||||
}
|
||||
$month
|
||||
let month = ($in | format date '%m' | into int) + 3
|
||||
($month..($month - 3)..1) | last
|
||||
}
|
||||
|
||||
def get-quarter []: datetime -> int {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
export def lumen-kwin-get-class [waittimesec: int]: nothing -> string {
|
||||
mut timer = $waittimesec
|
||||
while ($timer > 0) {
|
||||
$timer | print
|
||||
$timer -= 1
|
||||
for $i in $waittimesec..1 {
|
||||
$i | print
|
||||
sleep 1sec
|
||||
}
|
||||
qdbus6 org.kde.KWin /KWin queryWindowInfo
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
export def lumen-search-content [searchstr: string]: any -> table {
|
||||
let $tmp = $in
|
||||
mut $path = pwd
|
||||
if ($tmp != null) {
|
||||
$path = $tmp
|
||||
}
|
||||
cd $path
|
||||
let $tmp = (if ($in != null) {
|
||||
$in
|
||||
} else {
|
||||
pwd
|
||||
})
|
||||
cd $tmp
|
||||
ls -a **/* | par-each {|i|
|
||||
{file: $i.name,
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user