dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Compare Notes Search Merge remote-tracking branch 'refs/remotes/origin/trunk'
1a3caae5fb308a629b4e84ff1d79834243344953
Oliver Jan Krylow <olver@bugabinga.net > · 22 Apr 2023
unsigned
Browse files Compare with HEAD
Changed files (7) 3 - let -env WIN32? = (
$nu.os-info.name =~
"windows" )
3 + let -env WIN32 = (
$nu.os-info.name =~
"windows" )
4 4 let -env NURC_DIR = (
$nu.config-path | path expand | path dirname )
5 5 let -env DOTFILES = (
$env.NURC_DIR | path join
".." | path expand )
6 - let -env WORKSPACE =
if $env.WIN32 ? {
"W:/" }
else {
"~/Workspace" | path expand }
7 - let -env NOTES =
if $env.WIN32 ? {
"N:/" }
else {
"~/Notes" | path expand }
6 + let -env WORKSPACE =
if $env.WIN32 {
"W:/" }
else {
"~/Workspace" | path expand }
7 + let -env NOTES =
if $env.WIN32 {
"N:/" }
else {
"~/Notes" | path expand }
10 - let -env LS_COLORS = (vivid generate nord)
10 + let -env LS_COLORS = (
do -i { vivid generate nord } )
16 16 let -env ENV_CONVERSIONS = {
18 18 from_string: { |s|
$s | split row (char esep) }
19 - to_string: { |v|
$v | str collect (char esep) }
19 + to_string: { |v|
$v | str join (char esep) }
22 22 from_string: { |s|
$s | split row (char esep) }
23 - to_string: { |v|
$v | str collect (char esep) }
23 + to_string: { |v|
$v | str join (char esep) }
nushell/modules/git.nu Modified 35 35 echo (build-string
"[" ID :
$id "]" " key with title " (ansi gb)
$title (ansi reset)
" was created at " (ansi yi)
$created_at (ansi reset)
"." (char newline) )
36 36 echo (build-string (ansi wu)
"PUBLIC SSH KEY:" (ansi reset))
37 37 echo (char newline)
38 - echo (
$key | ansi gradient --fgstart 0xaefe9f --fgend 0xfefefe)
38 + echo (
$key | ansi gradient --fgstart
"0xaefe9f" --fgend
"0xfefefe" )
39 39 echo (char newline)
51 - git log --pretty=%h»¦«%s»¦«%aN»¦«%aE»¦«%aD -n
25 $rest | lines | split column
"»¦«" commit subject name email date | update date { get date | into datetime} | sort-by date
51 + git log --pretty=%h»¦«%s»¦«%aN»¦«%aE»¦«%aD -n
25 $rest | lines | split column
"»¦«" commit subject name email date | update date { || get date | into datetime } | sort-by date
nushell/modules/os.nu Modified 9 9 $rest |
each { |thing| ^start
$thing }
11 11 $rest |
each { |thing| ^xdg-open
$thing }
nushell/modules/prompt.nu Modified 7 7 [
"/home/oli/Notes" (char -u
"1f4d3" ) ]
8 + [
"/home/bugabinga/Notes" (char -u
"1f4d3" ) ]
8 9 [
"C:\\Users\\okr\\Notes" (char -u
"1f4d3" ) ]
9 10 [
"/home/oli/Workspace" (char -u
"1f4bb" ) ]
11 + [
"/home/bugabinga/Workspace" (char -u
"1f4bb" ) ]
10 12 [
"C:\\Users\\okr\\Workspaces" (char -u
"1f4bb" ) ]
11 13 [
"/home/oli" (char nf_house2) ]
14 + [
"/home/bugabinga" (char nf_house2) ]
12 15 [
"C:\\Users\\okr" (char nf_house2) ]
23 26 let icon =
if (icons | any { |icon|
$icon.path ==
$pwd } ) { ( icons |
where path ==
$pwd | get icon.
0 ) }
else { $
"(char nf_folder1)" }
25 28 if (
$env | get -i TERM_PROGRAM) == WezTerm {
26 - echo ([ (ansi title)
$icon " " (
$pwd | path basename ) (ansi reset) ] | str collect)
29 + echo ([ (ansi title)
$icon " " (
$pwd | path basename ) (ansi reset) ] | str join)
32 35 let pwd = (
$env.PWD | path expand)
34 37 let svn_relative_cmd = (
do --ignore-errors { ^svn info --show-item relative-url --no-newline
$pwd | complete } )
35 - let svn_relative_path =
if (
$svn_relative_cmd.exit_code ==
0 ) { $
" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
38 + let svn_relative_path =
if ( (not (
$svn_relative_cmd | is-empty)) and (
$svn_relative_cmd.exit_code ==
0 )) { $
" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
37 - let git_status = ( gstat )
38 - let git_branch =
if (
$git_status.branch !=
"no_branch" ) { $
" (char nf_git) (char nf_branch) ($git_status.branch)" }
40 + let git_status = (
do --ignore-errors { gstat } )
41 + let git_branch =
if ( ( not (
$git_status | is-empty)) and (
$git_status.branch !=
"no_branch" ) ) { $
" (char nf_git) (char nf_branch) ($git_status.branch)" }
46 49 def create_left_prompt [] {
50 53 let pwd = (
$env.PWD | path expand)
51 - let pwd = (icons | reduce --fold
$pwd { |item, accumulator|
$accumulator | str replace --string
$item.path $item.icon })
54 + let pwd = ( (icons) | reduce --fold
$pwd { |item, accumulator|
$accumulator | str replace --string
$item.path $item.icon })
52 55 let truncate_level =
5 53 56 let truncate_symbol = $
"…(char path_sep)" 54 57 let path_segment =
if (
$pwd | path split | length) >=
$truncate_level { (
$pwd | path dirname --num-levels
2 --replace
$truncate_symbol ) }
else {
$pwd }
56 - let vcs_segment = get_vcs_path
59 + let vcs_segment = (get_vcs_path)
68 71 def create_right_prompt [] {
69 72 let time_segment = ([
70 73 (date now | date format
'%d.%m %R' )
73 76 let command_status_segment =
if $env.LAST_EXIT_CODE ==
0 { $
" (char -u '2713') " }
else { $
"(ansi red) (char failed) (ansi reset)" }
74 77 let command_duration_segment =
if (
$env.CMD_DURATION_MS | into int) >
0 { $
"($env.CMD_DURATION_MS)ms" | into duration }
91 - let -env PROMPT_COMMAND = { create_left_prompt }
92 - let -env PROMPT_COMMAND_RIGHT = { create_right_prompt }
94 + let -env PROMPT_COMMAND = { || create_left_prompt }
95 + let -env PROMPT_COMMAND_RIGHT = { || create_right_prompt }
nushell/modules/table.nu Modified 9 - export def to-string [] { flatten | into string | str collect
' ' }
9 + export def to-string [] { flatten | into string | str join
' ' }
nushell/modules/zoxide.nu Modified 10 10 let -env config = (
$env | default {} config).config
11 11 let -env config = (
$env.config | default {} hooks)
12 12 let -env config = (
$env.config | update hooks (
$env.config.hooks | default [] pre_prompt))
13 - let -env config = (
$env.config | update hooks.pre_prompt (
$env.config.hooks.pre_prompt | append {
13 + let -env config = (
$env.config | update hooks.pre_prompt (
$env.config.hooks.pre_prompt | append { ||
14 14 zoxide add --
$env.PWD wezterm/wezterm.lua Modified 1 1 local wez
= require 'wezterm' 2 2 local nugu
= require 'bugabinga.nugu' 4 - local color_scheme
= 'nugu-dark' 5 4 local color_schemes
= nugu
7 6 local hostname
= wez.hostname()
13 12 if hostname
== 'x230' then 14 13 enable_wayland
= true 15 - window_decorations
= 'NONE' 14 + window_decorations
= 'RESIZE' 16 15 elseif hostname
== 'pop-os' then 18 17 elseif hostname
== 'PC-00625' then 30 29 window:set_right_status(name
or '' )
34 + function get_appearance ()
36 + return wez.gui.get_appearance()
41 + function scheme_for_appearance (appearance)
42 + if appearance:find
'Dark' then 49 + wez.on(
"window-config-reloaded" ,
function (window, pane)
50 + local overrides
= window:get_config_overrides()
or {}
51 + local appearance
= window:get_appearance()
52 + local scheme
= scheme_for_appearance(appearance)
53 + if overrides.color_scheme
~= scheme
then 54 + overrides.color_scheme
= scheme
55 + window:set_config_overrides(overrides)
33 59 local leader
= {
key =
'Space' ,
mods =
'CTRL|SHIFT' ,
timeout_milliseconds =
1000 }
148 174 font_size = font_size,
149 - color_scheme = color_scheme,
175 + color_scheme = scheme_for_appearance(get_appearance()),
150 176 color_schemes = color_schemes,
151 177 default_prog = {
'nu' ,
'--login' ,
'--interactive' },
152 178 window_decorations = window_decorations,