Compare commits
6 Commits
1f96e4ef15
...
e866e94303
| Author | SHA1 | Date | |
|---|---|---|---|
| e866e94303 | |||
| 283b4f0e56 | |||
| 01035f61bd | |||
| 1f697ecc23 | |||
| 4703c6c492 | |||
| a9aa507b4c |
3
autoload/assono-overtime-calc.nu
Normal file
3
autoload/assono-overtime-calc.nu
Normal file
@@ -0,0 +1,3 @@
|
||||
export def lumen-assono-overtime-calc [startdate = datetime]: nothing -> string {
|
||||
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate)'
|
||||
}
|
||||
41
autoload/assono-worktime-calc.nu
Normal file
41
autoload/assono-worktime-calc.nu
Normal file
@@ -0,0 +1,41 @@
|
||||
export def lumen-assono-worktime-calc [datestr = string]: nothing -> string {
|
||||
let $datestr = $datestr | str replace ' +' ' '
|
||||
mut $dateArray = []
|
||||
let $rawDateArray = $datestr | split row ' '
|
||||
if (($rawDateArray | length) mod 2 == 1) {
|
||||
mut $spliceCounter = true
|
||||
for $i in $rawDateArray {
|
||||
if ($spliceCounter) {
|
||||
$dateArray = $dateArray | append $i
|
||||
}
|
||||
$spliceCounter = not $spliceCounter
|
||||
}
|
||||
} else {
|
||||
$dateArray = $rawDateArray
|
||||
}
|
||||
|
||||
if (($dateArray | length) mod 2 == 1) {
|
||||
error make {msg: 'Uneven Times given!'}
|
||||
}
|
||||
|
||||
mut $dateArrayOutput = []
|
||||
mut $dateArrayOutputBuilderCounter = true
|
||||
for $i in $dateArray {
|
||||
$dateArrayOutput = $dateArrayOutput | append ($i | date from-human | format date '%H:%M')
|
||||
if ($dateArrayOutputBuilderCounter) {
|
||||
$dateArrayOutput = $dateArrayOutput | append '-'
|
||||
} else {
|
||||
$dateArrayOutput = $dateArrayOutput | append '|'
|
||||
}
|
||||
$dateArrayOutputBuilderCounter = not $dateArrayOutputBuilderCounter
|
||||
}
|
||||
let $dateArrayOutput = ($dateArrayOutput | drop 1) | str join ' '
|
||||
|
||||
# $dateArray[0]
|
||||
mut $hours = 0min
|
||||
while (($dateArray | length) > 0) {
|
||||
$hours += ($dateArray | get 1 | into datetime) - ($dateArray | get 0 | into datetime)
|
||||
$dateArray = $dateArray | skip 2
|
||||
}
|
||||
$"($dateArrayOutput)\n($hours | into string)"
|
||||
}
|
||||
9
autoload/kwin-get-class.nu
Normal file
9
autoload/kwin-get-class.nu
Normal file
@@ -0,0 +1,9 @@
|
||||
export def lumen-kwin-get-class [waittimesec = int]: nothing -> string {
|
||||
mut timer = ($waittimesec | into int)
|
||||
while ($timer > 0) {
|
||||
$timer | print
|
||||
$timer -= 1
|
||||
sleep 1sec
|
||||
}
|
||||
qdbus6 org.kde.KWin /KWin queryWindowInfo
|
||||
}
|
||||
15
autoload/search-content.nu
Normal file
15
autoload/search-content.nu
Normal file
@@ -0,0 +1,15 @@
|
||||
export def lumen-search-content [searchstr = string]: any -> table {
|
||||
let $tmp = $in
|
||||
mut $path = pwd
|
||||
if ($tmp != null) {
|
||||
$path = $tmp
|
||||
}
|
||||
cd $path
|
||||
ls -a **/* | par-each {|i|
|
||||
{file: $i.name,
|
||||
content: (if (($i | get type) == file ) {
|
||||
try {open $i.name --raw | find $searchstr} catch {|err| {}}
|
||||
})
|
||||
}
|
||||
} | compact content -e
|
||||
}
|
||||
12
config.nu
12
config.nu
@@ -18,13 +18,5 @@
|
||||
# them for future reference.
|
||||
|
||||
$env.config.show_banner = false
|
||||
|
||||
export def lumen-search-content [searchstr = string]: any -> table {
|
||||
ls -a **/* | par-each {|i|
|
||||
{file: $i.name,
|
||||
content: (if (($i | get type) == file ) {
|
||||
try {open $i.name --raw | find $searchstr} catch {|err| {}}
|
||||
})
|
||||
}
|
||||
} | compact content -e
|
||||
}
|
||||
$env.EDITOR = 'hx'
|
||||
$env.VISUAL = 'hx'
|
||||
|
||||
Reference in New Issue
Block a user