1
0

6 Commits

Author SHA1 Message Date
Ole Klinck 1f96e4ef15 Added assono-overtime-calc 2025-06-06 10:20:47 +02:00
Luminiferous 7fa9fd78b0 Added kwin-get-class 2025-06-05 23:54:58 +02:00
Ole Klinck 704ce76284 Moved Modules into their own files 2025-06-05 14:43:58 +02:00
Ole Klinck eb35a68b9a Added lumen-assono-worktime-calc 2025-06-05 14:26:47 +02:00
Ole Klinck e6d839432f Allows lumen-search-content to Get a Path piped in 2025-06-03 16:54:13 +02:00
Ole Klinck 7b212c6037 Added VISUAL and EDITOR envs 2025-06-03 16:07:29 +02:00
7 changed files with 20 additions and 91 deletions
-46
View File
@@ -1,46 +0,0 @@
export def lumen-assono-backup-nexttape [dateinput: datetime]: nothing -> nothing {
print 'Next Required Tape:'
print $'($dateinput | get-backup-string 0)'
print ''
print 'Tapes after that:'
1..11 | each {|i|
print ($dateinput | get-backup-string $i)
} | ignore
}
def get-backup-string [index]: datetime -> string {
let firstDayMonth = $'01-((($in | format date '%m' | into int) + $index) mod 12 + 1)($in | format date '-%y')' | into datetime --format '%d-%m-%y'
let firstDayMonth = if ($firstDayMonth < $in) {
$'($firstDayMonth | format date '%d-%m-')(($firstDayMonth | format date '%y' | into int) + 1)' | into datetime --format '%d-%m-%y'
} else {
$firstDayMonth
}
let backupDay = $firstDayMonth - ($firstDayMonth | format date '%w' | into duration -u day) + 6day
let monthOfQuarter = $backupDay | get-month-of-quarter
let quarter = $backupDay | get-quarter
let year = $backupDay | get-year
if ($monthOfQuarter == 1) {
if ($quarter == 1) {
$"($backupDay): TapeLTO5-Y(($year - 1| into string | str substring 3..))"
} else {
$"($backupDay): TapeLTO5-Q($quarter - 1)"
}
} else {
$"($backupDay): TapeLTO5-M($monthOfQuarter - 1)"
}
}
def get-month-of-quarter []: datetime -> int {
let month = ($in | format date '%m' | into int) + 3
($month..($month - 3)..1) | last
}
def get-quarter []: datetime -> int {
(($in | format date '%m') | into int) / 3 | math ceil
}
def get-year []: datetime -> int {
$in | format date '%Y' | into int
}
+2 -2
View File
@@ -1,3 +1,3 @@
export def lumen-assono-overtime-calc [startdate: datetime]: nothing -> string {
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate | format date '%d/%m/%Y')'
export def lumen-assono-overtime-calc [startdate = datetime]: nothing -> string {
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate)'
}
+1 -1
View File
@@ -1,4 +1,4 @@
export def lumen-assono-worktime-calc [datestr: string]: nothing -> string {
export def lumen-assono-worktime-calc [datestr = string]: nothing -> string {
let $datestr = $datestr | str replace ' +' ' '
mut $dateArray = []
let $rawDateArray = $datestr | split row ' '
-3
View File
@@ -1,3 +0,0 @@
export def lumen-headset-power-toggle []: nothing -> nothing {
sudo uhubctl -f -a toggle -p 1 -l 3-5
}
+7 -9
View File
@@ -1,11 +1,9 @@
export def lumen-kwin-get-class [waittimesec: int]: nothing -> string {
if ($waittimesec == 0) {
qdbus6 org.kde.KWin /KWin queryWindowInfo
} else {
for $i in $waittimesec..1 {
$i | print
sleep 1sec
}
qdbus6 org.kde.KWin /KWin queryWindowInfo
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
}
+8 -8
View File
@@ -1,14 +1,14 @@
export def lumen-search-content [searchstr: string]: any -> table {
let $tmp = (if ($in != null) {
$in
} else {
pwd
})
cd $tmp
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 {{}}
try {open $i.name --raw | find $searchstr} catch {|err| {}}
})
}
} | compact content -e
+2 -22
View File
@@ -17,26 +17,6 @@
# You can remove these comments if you want or leave
# them for future reference.
$env.EDITOR = 'nvim'
$env.VISUAL = 'nvim'
use std/util 'path add'
path add '~/.local/bin'
path add '~/.cargo/bin'
$env.config.show_banner = false
$env.config.table.trim.methodology = 'truncating'
$env.config.table.trim.truncating_suffix = ' >>'
$env.config.table.mode = 'frameless'
if ((sys host).name !~ '.*Windows.*') {
$env.SSH_AUTH_SOCK = $'($env.HOME)/.var/app/com.bitwarden.desktop/data/.bitwarden-ssh-agent.sock'
# $env.SSH_AUTH_SOCK = $'($env.HOME)/.bitwarden-ssh-agent.sock'
}
try {
carapace _carapace nushell | let carapace_nu
mkdir $'($nu.cache-dir)'
$carapace_nu | save --force $'($nu.cache-dir)/carapace.nu'
} catch {}
source (if ($'($nu.cache-dir)/carapace.nu' | path exists) {($'($nu.cache-dir)/carapace.nu')} else { null })
$env.EDITOR = 'hx'
$env.VISUAL = 'hx'