1
0

17 Commits

Author SHA1 Message Date
Luminiferous 1a651bb023 Merge branch 'nushell' of https://git.luminiferous.eu/Luminiferous/dotfiles into nushell 2025-08-12 16:16:21 +02:00
Luminiferous e2fe842098 Refactored lumen-assono-backup-nexttape to work for new tape scheme 2025-08-12 16:14:16 +02:00
Luminiferous 65ec0c8bf8 Fixed kwin-get-class countdown timer when starting on 0 2025-08-02 11:43:58 +02:00
Luminiferous 6793e4e0ae Set SSH Bitwarden env var to only trigger on non Windows Systems 2025-07-30 19:26:08 +02:00
Luminiferous ac8fc8529b Merge branch 'nushell' of https://git.luminiferous.eu/Luminiferous/dotfiles into nushell 2025-07-30 17:22:43 +02:00
Luminiferous e6b082f38c Changed to fully Functional Scripting for most scripts 2025-07-30 17:21:40 +02:00
Luminiferous 614a57652f Added Bitwarden SSH Agent to nushells env 2025-06-21 14:43:30 +02:00
Luminiferous 80a119972f Finished assono-backup-nexttape 2025-06-11 17:37:16 +02:00
Luminiferous 05d3aaa8dd Added backup-nexttape Work in Progress 2025-06-10 16:55:20 +02:00
Luminiferous 9afb3328ba Fixed Parameters 2025-06-10 16:55:03 +02:00
Luminiferous e866e94303 Added assono-overtime-calc 2025-06-10 11:30:44 +02:00
Luminiferous 283b4f0e56 Added kwin-get-class 2025-06-10 11:30:43 +02:00
Luminiferous 01035f61bd Moved Modules into their own files 2025-06-10 11:30:43 +02:00
Luminiferous 1f697ecc23 Added lumen-assono-worktime-calc 2025-06-10 11:30:43 +02:00
Luminiferous 4703c6c492 Allows lumen-search-content to Get a Path piped in 2025-06-10 11:30:43 +02:00
Luminiferous a9aa507b4c Added VISUAL and EDITOR envs 2025-06-10 11:30:43 +02:00
Luminiferous f2cb448b37 Added config.nu 2025-06-03 16:00:46 +02:00
9 changed files with 143 additions and 102 deletions
+2
View File
@@ -0,0 +1,2 @@
env.nu
history.txt
+46
View File
@@ -0,0 +1,46 @@
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
}
+3
View File
@@ -0,0 +1,3 @@
export def lumen-assono-overtime-calc [startdate: datetime]: nothing -> string {
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate | format date '%d/%m/%Y')'
}
+41
View 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)"
}
+11
View File
@@ -0,0 +1,11 @@
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
}
}
+15
View File
@@ -0,0 +1,15 @@
export def lumen-search-content [searchstr: string]: any -> table {
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 {{}}
})
}
} | compact content -e
}
+25
View File
@@ -0,0 +1,25 @@
# config.nu
#
# Installed by:
# version = "0.104.1"
#
# This file is used to override default Nushell settings, define
# (or import) custom commands, or run any other startup tasks.
# See https://www.nushell.sh/book/configuration.html
#
# This file is loaded after env.nu and before login.nu
#
# You can open this file in your default editor using:
# config nu
#
# See `help config nu` for more options
#
# You can remove these comments if you want or leave
# them for future reference.
$env.config.show_banner = false
$env.EDITOR = 'hx'
$env.VISUAL = 'hx'
if ((sys host).name !~ '.*Windows.*') {
$env.SSH_AUTH_SOCK = '/home/lumen/.bitwarden-ssh-agent.sock'
}
-64
View File
@@ -1,64 +0,0 @@
theme = 'rose_pine'
[editor]
line-number = 'relative'
cursorline = true
auto-format = false
bufferline = 'multiple'
true-color = true
color-modes = true
end-of-line-diagnostics = 'hint'
[editor.statusline]
left = ['mode', 'spinner', 'spacer' , 'version-control', 'spacer', 'separator', 'file-name', 'read-only-indicator', 'file-modification-indicator']
center = []
right = ['diagnostics', 'selections', 'register', 'file-line-ending', 'file-encoding', 'file-type', 'position', 'position-percentage']
separator = '│'
mode.normal = 'NORMAL'
mode.insert = 'INSERT'
mode.select = 'SELECT'
[editor.cursor-shape]
normal = 'block'
insert = 'bar'
select = 'underline'
[editor.file-picker]
hidden = false
parents = false
ignore = false
git-ignore = false
git-global = false
git-exclude = false
[editor.whitespace.render]
space = 'all'
tab = 'all'
nbsp = 'all'
nnbsp = 'all'
[editor.indent-guides]
render = true
[editor.inline-diagnostics]
cursor-line = 'hint'
[editor.smart-tab]
enable = false
[keys.normal]
'F7' = 'goto_previous_buffer'
'F8' = 'goto_next_buffer'
X = 'select_line_above'
x = 'select_line_below'
tab = 'move_parent_node_end'
S-tab = 'move_parent_node_start'
[keys.select]
X = 'select_line_above'
x = 'select_line_below'
tab = 'extend_parent_node_end'
S-tab = 'extend_parent_node_start'
[keys.insert]
S-tab = 'move_parent_node_start'
-38
View File
@@ -1,38 +0,0 @@
# [[language]]
# name = 'powershell'
# scope = 'source.ps1'
# file-types = ['ps1', 'psm1']
# roots = ['.git']
# comment-token = '#'
# indent = { tab-width = 4, unit = '\t' }
# language-servers = [ 'powershell-editor-services' ]
# [language-server.powershell-editor-services]
# name = 'powershell-editor-services'
# transport = 'stdio'
# command = 'pwsh'
# args = ['-NoLogo', '-NoProfile', '-Command', 'C:\\PowerShellEditorServices\\PowerShellEditorServices\\Start-EditorServices.ps1 -SessionDetailsPath C:\\PowerShellEditorServices\\PowerShellEditorServices.sessions.lsp.json -LanguageServiceOnly -Stdio']
# [language.debugger]
# name = 'powershell-editor-services'
# transport = 'stdio'
# command = 'pwsh'
# args = ['-NoLogo', '-NoProfile', '-Command', 'C:\\PowerShellEditorServices\\PowerShellEditorServices\\Start-EditorServices.ps1 -SessionDetailsPath C:\\PowerShellEditorServices\\PowerShellEditorServices.sessions.dap.json -DebugServiceOnly -Stdio']
# [[language.debugger.templates]]
# name = 'Attach to existing Powershell Process'
# request = 'attach'
# completion = [ 'PID' ]
# args = { processId = '{0}', runspaceId = '1' }
# [[language.debugger.templates]]
# name = 'Launch Script (Script runs in Background)'
# request = 'launch'
# completion = [ 'Full Script Path' ]
# args = { script = '{0}', runspaceId = '1' }
#---
[[language]]
name = 'bash'
indent = { tab-width = 4, unit = '\t' }