repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

adjusting to new workstation

2675a0db353ae017361f262803e6014ee9f7888e

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Changed files (22)

.gitignore

Modified
5 5 bootstripper/win32/cross9
6 6 tresor/box_do_key
7 7 nushell/zoxide.nu
8 -nushell/history.txt
8 +nushell/history.txt
9 +nushell/plugin.nu

COMMANDS.md

Modified
12 12 - tokei: count lines of code
13 13 - hyperfine: benchmark tool
14 14 - menyoki: capture screenshots, record gifs
15 -- rpick: Choose something out of predefined model using fancy algorithms
16 15 - tldr: tool documentation
17 16 - grex: regular expression pattern generator
18 17 - xh: make HTTP requests
19 -- watchexec: filesystem watcher
20 18 - viu: view images in terminal (blocky approximation)
21 19 - licensor: print a license text
22 20 - pastel: manage colors
31 29 - comrak: render markdown to html
32 30 - hx: terminal code editor
33 31 - xplr: terminal file explorer
34 -- coreutils: rust unix tools
35 32 - t-rec: terminal gifs
36 33 - podcast: podcast manager
37 34 - sic: image manipulation
38 35 - vivid: generate LS_COLORS
39 36 - chars: unicode character info
40 -- hwatch: watch output of commands over time
41 37 - franklin-cli: evolutionary image filter
42 38 - uggo: LoL builds

PC-00625.symlinks

Modified
20 20 ~/AppData/Roaming/Subversion/config
22 22 cargo/config.toml
23 -~/scoop/persist/rustup/.cargo/config.toml
23 +~/.cargo/config.toml
25 25 indexa/config.windows.toml
26 26 ~/AppData/Roaming/indexa/config.toml

README.md

Modified
8 8 1. Install a JDK
9 9 1. git clone git@github.com:bugabinga/dotfiles
10 10 1. `cd dotfiles`
11 -1. `java bootstripper.java .`
11 +1. `java bootstripper.java`
13 13 > Pay attention to already existing symlinks!
15 +## windows
17 +Initial setup on windows is a little more sophisticated, because I am used to a developers environment.
19 +1. Enable Devoloper Mode, so that it is allowed to make symlinks without admin permissions.
20 +1. Install Build Tools with C++ Option (for Rust and cargo tools)
15 22 ## rough goals
17 24 - minimal amount of dependencies

bootstripper.java

Modified
8 8 var dorkfile_path_input = ".";
9 9 if (arguments.length == 1) {
10 10 dorkfile_path_input = arguments[0];
11 - } else if (arguments.length > 1){
11 + } else if (arguments.length > 1) {
12 12 usage();
13 13 throw fail();
54 54 var is_directory = Files.isDirectory(source_path);
55 55 if (Files.exists(target_path, LinkOption.NOFOLLOW_LINKS)) {
56 56 if (Files.exists(target_path)) {
57 - log("\n✓ {0} already exists!\nNot linking {1}.", emphasize_global(target_path.toString()),
57 + log("\nOK {0} already exists!\nNot linking {1}.", emphasize_global(target_path.toString()),
58 58 emphasize_local(source_path.toString()));
59 59 return;
60 60 } else {
61 - log("\n❌ {0} exists, but it points into nirvana. Removing broken link!", target_path.toString());
61 + log("\nNOPE {0} exists, but it points into nirvana. Removing broken link!", target_path.toString());
62 62 Files.delete(target_path);
65 - log("\n🔗 {0} ➔ {1}.", emphasize_local(source_path.toString()),
65 + log("\nLINK {0} TO {1}.", emphasize_local(source_path.toString()),
66 66 emphasize_local(target_path.toString()));
67 67 Files.createDirectories(target_path.getParent());
68 68 try {
72 72 * Creating symbolic links on Windows only recently became possible without
73 73 * admin rights.
74 + * And even that, is only available in Developer Mode.
74 75 * However, most tools (including JDK) have not yet adapted to this change and
75 76 * still require admin rights.
76 77 * Until that is fixed, we escape to a system tool that is known to behave

cargo/config.toml

Modified
8 8 # aaand we get out of memory errors when building nu...
9 9 [profile.release]
10 10 # link time optimization is slow, but allows inter-crate analysis
11 -# lto = "fat"
13 -[target.x86_64-pc-windows-msvc]
14 -# apparently, the LLVM linker is faster than others...
15 -linker = "lld-link.exe"
17 -[target.x86_64-unknown-linux-gnu]
18 -rustflags = [
19 -"-C", "link-arg=-fuse-ld=lld",
20 -]
11 +lto = "fat"

git/gitconfig

Modified
1 -# This is Git's per-user configuration file.
2 1 [user]
3 2 name = Oliver Jan Krylow
4 3 email = olver@bugabinga.net
59 58 # On each host a different file might be symlinked into '.gitconfig.include'.
60 59 [include]
61 60 path = .gitconfig.include
63 -[credential "helperselector"]
64 - selected = manager-core

git/gitconfig.PC-00625

Modified
4 4 [user]
5 5 name = Oliver Krylow
6 6 email = o.krylow@isp-insoft.de
8 8 [credential]
9 9 helper = manager-core
11 +[credential "helperselector"]
12 + selected = manager-core
14 +[core]
15 + editor = code --wait
17 +[diff]
18 + tool = code-difftool
20 +[difftool "code-difftool"]
21 + cmd = code --wait --diff $LOCAL $REMOTE

indexa/config.windows.toml

Modified
52 52 # Root directories to index. Defaults to / on Unix and %HOMEDRIVE%\ (usually C:\) on Windows.
53 53 dirs = [
54 - "C:\\",
55 - "D:\\"
54 + "C:\\"
58 57 # Whether to ignore hidden files/directories.

nushell/config.nu

Modified
1 1 # Nushell Config File
2 -use environment.nu *
3 2 use table.nu *
4 3 use os.nu *
5 4 use prompt.nu *
6 5 use aliases.nu *
7 6 use todo.nu *
8 7 use git.nu *
8 +use svn.nu *
9 +use openssl.nu *
10 11 # CUSTOM COMPLETIONS
11 12 use svn.complete.nu *

nushell/env.nu

Modified
1 +# GLOBAL VARIABLES
3 +let-env WIN32? = $nu.os-info.name =~ "windows"
4 +let-env NURC_DIR = ($nu.config-path| path expand | path dirname)
5 +let-env DOTFILES = ($env.NURC_DIR| path join ".." | path expand)
6 +let-env WORKSPACE = if $env.WIN32? { "W:/misc" } else { "~/Workspace" }
7 +let-env CARGO_HOME = if $env.WIN32? { "C:/Users/okr/.cargo" } else { "~/.cargo" }
1 9 # Specifies how environment variables are:
2 10 # - converted from a string to a value on Nushell startup (from_string)
3 11 # - converted from a value back to a string when running external commands (to_string)
16 24 # Directories to search for scripts when calling source or use
17 25 let-env NU_LIB_DIRS = [
18 - ($nu.config-path | path dirname | path join 'tools'),
19 26 ($nu.config-path | path dirname | path join 'modules'),
20 27 ($nu.config-path | path dirname | path join 'completions')
24 31 let-env NU_PLUGIN_DIRS = [
25 32 ($nu.config-path | path dirname | path join 'plugins'),
26 33 ($env.CARGO_HOME | path join 'bin'),
27 -]

nushell/modules/aliases.nu

Modified
6 6 export alias browse = firefox
7 7 export alias edit = hx
9 +# wrapper to delegate to gsudo/sudo if available.
10 +export def doas [
11 + ...rest: string # arguments
12 +] {
13 + if ( which "sudo" | empty? ) {
14 + ^doas $rest
15 + } else {
16 + ^sudo $rest
17 + }
9 20 # CUSTOM LITTLE JAVA COMMANDS
10 21 export alias aes = java (build-string $env.DOTFILES /tools/ aes.java)
11 22 export alias download = java (build-string $env.DOTFILES /tools/ download.java)

nushell/modules/environment.nu

Deleted
deleted file mode 100644
1 -export env GO111MODULE { "on" }
2 -export env GOPATH { ($nu.home-path | path join '.go') }
4 -export env PATH {
5 - ( $env.PATH |
6 - prepend ($env.GOPATH | path join 'bin')
7 - )
8 - }
9 -#TODO CARGO_HOME
11 -# GLOBAL VARIABLES
13 -export env WIN32? { (sys).host.name =~ "Windows" }
14 -export env NURC_DIR { ($nu.config-path| path expand | path dirname) }
15 -export env DOTFILES { ($env.NURC_DIR| path join ".." | path expand) }
16 -export env WORKSPACE { if $env.WIN32? { "W:" } else { "~/Workspace" } }

nushell/modules/openssl.nu

Added
new file mode 100644
1 +# Generate a new ed25519 SSH private key
2 +export def ssh-keygen-ed [
3 + email: string # Identifier for the COMMENT section of the key
4 +] {
5 + ssh-keygen -t ed25519 -C $email
6 +}

nushell/modules/prompt.nu

Modified
46 46 # Order these paths for precedence.
47 47 def icons [] {
49 - [path icon];
50 - [/home/oli/Workspace "🧬"]
51 - [/home/oli "🏡"]
49 + [ path icon ];
50 + [ "/home/oli/Workspace" (char -u "1f4bb") ]
51 + [ "/home/oli" (char nf_house2) ]
52 + [ "C:\\Users\\okr\\Workspaces" (char -u "1f4bb") ]
53 + [ "C:\\Users\\okr" (char nf_house2) ]
59 61 def set-window-title [] {
60 62 # normalize path
61 63 let pwd = ( $env.PWD | path expand )
62 - let icon = if (icons | any? path == $pwd) { ( icons | where path == $pwd | get icon.0 ) } else { "📁" }
64 + let icon = if (icons | any? path == $pwd) { ( icons | where path == $pwd | get icon.0 ) } else { $"(char nf_folder1)" }
63 65 # Some terminals freeze, if they do not support this OSC
64 66 if (env | any? name == TERM_PROGRAM) && $env.TERM_PROGRAM == WezTerm {
65 67 echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str collect)
71 73 let pwd = ($env.PWD | path expand)
73 75 let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd } | complete )
74 - let svn_relative_path = if ($svn_relative_cmd.exit_code == 0) { $" 🐢 ($svn_relative_cmd.stdout)" }
76 + let svn_relative_path = if ($svn_relative_cmd.exit_code == 0) { $" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
76 78 let git_status = ( gstat )
77 - let git_branch = if ( $git_status.branch != "no_branch" ) { $"  ($git_status.branch)" }
79 + let git_branch = if ( $git_status.branch != "no_branch" ) { $" (char nf_git) (char nf_branch) ($git_status.branch)" }
80 82 $svn_relative_path
89 91 # normalize path
90 92 let pwd = ($env.PWD | path expand)
91 - let pwd = (icons | reduce --fold $pwd { |item, accumulator| $accumulator | str replace $item.path $item.icon })
93 + let pwd = (icons | reduce --fold $pwd { |item, accumulator| $accumulator | str replace --string $item.path $item.icon })
92 94 let truncate_level = 5
93 - let truncate_symbol = "…/"
95 + let truncate_symbol = $"…(char path_sep)"
94 96 let path_segment = if ($pwd | path split | length) >= $truncate_level { ($pwd | path dirname --num-levels 2 --replace $truncate_symbol ) } else { $pwd }
96 98 let vcs_segment = get_vcs_path
110 112 (date now | date format '%d.%m %R')
111 113 ] | str collect)
113 - let command_status_segment = if $env.LAST_EXIT_CODE == 0 { " ✔ " } else { $"(ansi red) ✖ (ansi reset)" }
114 - let command_duration_segment = if ($env.CMD_DURATION_MS|into int) > 50 { build-string $"($env.CMD_DURATION_MS)ms" | into duration }
115 + let command_status_segment = if $env.LAST_EXIT_CODE == 0 { $" (char -u '2713') " } else { $"(ansi red) (char failed) (ansi reset)" }
116 + let command_duration_segment = if ($env.CMD_DURATION_MS | into int) > 50 { $"($env.CMD_DURATION_MS)ms" | into duration }
117 119 (ansi red_bold)
133 135 # The prompt indicators are environmental variables that represent
134 136 # the state of the prompt
135 -export env PROMPT_INDICATOR { $"(ansi purple) · (ansi reset)" }
136 -export env PROMPT_INDICATOR_VI_INSERT { $"(ansi purple_reverse) : (ansi reset)" }
137 -export env PROMPT_INDICATOR_VI_NORMAL { $"(ansi purple_bold) · (ansi reset)" }
138 -export env PROMPT_MULTILINE_INDICATOR { $"(ansi purple_dimmed)·· (ansi reset)" }
137 +export env PROMPT_INDICATOR { $"(ansi purple) (char prompt) (ansi reset)" }
138 +export env PROMPT_INDICATOR_VI_INSERT { $"(ansi purple_reverse) (char pipe) (ansi reset)" }
139 +export env PROMPT_INDICATOR_VI_NORMAL { $"(ansi purple_bold) (char prompt) (ansi reset)" }
140 +export env PROMPT_MULTILINE_INDICATOR { $"(ansi purple_dimmed)(char prompt)(char prompt) (ansi reset)" }

nushell/modules/svn.nu

Modified
42 42 "missing": ( get-item-status-count $svn_status "missing" )
43 43 "obstructed": "TODO"
44 44 "tree_conflicts": ( $svn_status | get --ignore-errors status.children.target.children.entry.children.wc-status.attributes.tree-conflicted | flatten | flatten | compact | length)
45 - "changelists": ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get name )
45 + "changelists": ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get --ignore-errors name )

nushell/plugin.nu

Deleted
deleted file mode 100644
1 -register /home/oli/.cargo/bin/nu_plugin_gstat -e json {
2 - "name": "gstat",
3 - "usage": "Get the git status of a repo",
4 - "extra_usage": "",
5 - "search_terms": [],
6 - "required_positional": [],
7 - "optional_positional": [
8 - {
9 - "name": "path",
10 - "desc": "path to repo",
11 - "shape": "Filepath",
12 - "var_id": null,
13 - "default_value": null
14 - }
15 - ],
16 - "rest_positional": null,
17 - "named": [
18 - {
19 - "long": "help",
20 - "short": "h",
21 - "arg": null,
22 - "required": false,
23 - "desc": "Display this help message",
24 - "var_id": null,
25 - "default_value": null
26 - }
27 - ],
28 - "is_filter": false,
29 - "creates_scope": false,
30 - "category": {
31 - "Custom": "Prompt"
32 - }
33 -}

tools/cargo-tools.nu

Added
new file mode 100644
1 +let cargo_crates = [
2 + "sccache"
3 + "sd"
4 + "cbs"
5 + "ouch"
6 + "fd-find"
7 + "ripgrep"
8 + "eva"
9 + "mdcat"
10 + "hexyl"
11 + "hyperfine"
12 + "so"
13 + "tealdeer"
14 + "tokei"
15 + "bat"
16 + "pastel"
17 + "diskonaut"
18 + "menyoki"
19 + "grex"
20 + "xh"
21 + "comrak"
22 + "bandwhich"
23 + "linky"
24 + "viu"
25 + "licensor"
26 + "gib"
27 + "silicon"
28 + "bottom"
29 + "sic"
32 +let cargo_git_crates = [
33 + "https://github.com/mosmeh/indexa"
36 +def install-helix-editor [] {
37 + cd $env.WORKSPACE
38 + git clone https://github.com/helix-editor/helix
39 + cd helix
40 + cargo install --locked --path helix-term
41 + hx --grammar fetch
42 + hx --grammar build
45 +def main [] {
46 + $cargo_crates | each { |crate|
47 + if ( which $crate | empty? ) {
48 + cargo install --locked $crate
49 + } else {
50 + echo $"($crate) already installed"
51 + }
52 + }
54 + $cargo_git_crates | each { |crate|
55 + cargo install --locked --git $crate
56 + }
58 + install-helix-editor

tools/cargo_tools.nu

Deleted
deleted file mode 100644
1 -let cargo_crates = [
2 - "sd"
3 - "fd-find"
4 - "ripgrep"
5 - "eva"
6 - "watchexec-cli"
7 - "mdcat"
8 - "hexyl"
9 - "hyperfine"
10 - "so"
11 - "tealdeer"
12 - "tokei"
13 - "bottom"
14 - "bat"
15 - "pastel"
16 - "diskonaut"
17 - "menyoki"
18 - "rpick"
19 - "grex"
20 - "xh"
21 - "comrak"
22 - "bandwhich"
23 - "linky"
24 - "viu"
25 - "licensor"
26 - "gib"
27 - "silicon"
28 - "onefetch"
29 -]
31 -let cargo_git_crates = [
32 - "https://github.com/mosmeh/indexa"
33 -]
35 -def install_hx [] {
36 - cd $env.WORKSPACE
37 - git clone https://github.com/helix-editor/helix
38 - cd helix
39 - cargo install --path helix-term
40 - hx --grammar fetch
41 - hx --grammar build
42 -}
44 -def main [] {
45 - cargo install --locked $cargo_crates
46 - cargo install --locked nu --all-features
47 - $cargo_git_crates | each {|it| cargo install --locked --git $it }
48 - install_hx
49 -}

tools/nerd-font.sh

Added
new file mode 100644
1 +#!/bin/bash
3 +# rewrite this some time...
5 +declare -a fonts=(
6 + 3270
7 + Agave
8 + AnonymousPro
9 + Arimo
10 + ArulentSansMono
11 + BigBlueTerminal
12 + BitstreamVeraSansMono
13 + CascadiaCode
14 + CodeNewRoman
15 + DroidSansMono
16 + FiraCode
17 + FiraMono
18 + Gohu
19 + Go-Mono
20 + Hack
21 + Hasklig
22 + Hermit
23 + IBMPlexMono
24 + iA-Writer
25 + Iosevka
26 + JetBrainsMono
27 + Meslo
28 + Overpass
29 + ProggyClean
30 + RobotoMono
31 + SourceCodePro
32 + SpaceMono
33 + Ubuntu
34 + UbuntuMono
37 +version='2.1.0'
38 +fonts_dir="${HOME}/.local/share/fonts"
40 +if [[ ! -d "$fonts_dir" ]]; then
41 + mkdir -p "$fonts_dir"
42 +fi
44 +for font in "${fonts[@]}"; do
45 + zip_file="${font}.zip"
46 + download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}"
47 + echo "Downloading $download_url"
48 + wget "$download_url"
49 + unzip "$zip_file" -d "$fonts_dir"
50 + rm "$zip_file"
51 +done
53 +find "$fonts_dir" -name '*Windows Compatible*' -delete
55 +fc-cache -fv

tools/nerd_font.sh

Deleted
deleted file mode 100755
1 -#!/bin/bash
3 -# rewrite this some time...
5 -declare -a fonts=(
6 - 3270
7 - Agave
8 - AnonymousPro
9 - Arimo
10 - ArulentSansMono
11 - BigBlueTerminal
12 - BitstreamVeraSansMono
13 - CascadiaCode
14 - CodeNewRoman
15 - DroidSansMono
16 - FiraCode
17 - FiraMono
18 - Gohu
19 - Go-Mono
20 - Hack
21 - Hasklig
22 - Hermit
23 - IBMPlexMono
24 - iA-Writer
25 - Iosevka
26 - JetBrainsMono
27 - Meslo
28 - Overpass
29 - ProggyClean
30 - RobotoMono
31 - SourceCodePro
32 - SpaceMono
33 - Ubuntu
34 - UbuntuMono
35 -)
37 -version='2.1.0'
38 -fonts_dir="${HOME}/.local/share/fonts"
40 -if [[ ! -d "$fonts_dir" ]]; then
41 - mkdir -p "$fonts_dir"
42 -fi
44 -for font in "${fonts[@]}"; do
45 - zip_file="${font}.zip"
46 - download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}"
47 - echo "Downloading $download_url"
48 - wget "$download_url"
49 - unzip "$zip_file" -d "$fonts_dir"
50 - rm "$zip_file"
51 -done
53 -find "$fonts_dir" -name '*Windows Compatible*' -delete
55 -fc-cache -fv

topgrade/topgrade.windows.toml

Modified
1 1 # Disable specific steps - same options as the command line flag
2 -disable = ["tldr"]
2 +disable = ["wsl", "tldr"]
4 4 assume_yes = true
18 18 [git]
19 19 # Additional git repositories to pull
20 -repos = ["W:/misc/*/"]
20 +repos = ["W:/misc/*/", "W:/*/"]
22 22 max_concurrency = 12
36 36 # Custom commands
37 37 [commands]
38 -"Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
38 +"00 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles"
40 -# Leider scheint der eingebaute "tldr" step von topgrade nicht für meine Version von TLDR funktionieren
41 -"TLDR" = "tldr --update"
40 +"01 - Install Cargo Tools" = "nu W:/dotfiles/tools/cargo-tools.nu"
43 42 # Diese Skripte beziehen APM und MeMate aus dem Transfer.
44 -"Advantage-PM Client" = ". C:/Users/okr/Tools/update_apm_client.ps1"
45 -"MeMate" = ". C:/USers/okr/Tools/update_memate.ps1"
43 +"02 - Advantage-PM Client" = "nu X:/update_apm_client.nu"
44 +"03 - MeMate" = "nu X:/update_memate.nu"
47 46 # Dateisystem-Indexer ix erfrischen
48 -"Indexa Update" = "ix --update"
47 +"04 - Indexa Update" = "ix --update"
49 +# Leider scheint der eingebaute "tldr" step von topgrade nicht für meine Version von TLDR funktionieren
50 +"05 - TLDR" = "tldr --update"