···3030 if os.geteuid() != 0:
3131 msg = "This script must be run as root (w/ sudo)!"
3232 LOG.error(msg)
3333- print(msg, file=sys.stderr)
3333+ subprocess.run(
3434+ ["osascript", "-e", f'display notification "{msg}" with title "{__file__}"'],
3535+ shell=False,
3636+ check=True,
3737+ )
3438 sys.exit(1)
35393640 auth_client = spotipy.oauth2.SpotifyOAuth(
+31
.config/fish/completions/tokei.fish
···11+# Written against `tokei --help`, version 12.1.2 compiled with support for CBOR, JSON, and YAML
22+33+function __fish_tokei_supported_serializations
44+ # Expecting a line like:
55+ # tokei 10.0.1 compiled with serialization support: cbor, json, yaml
66+ command tokei --help | grep 'with serialization support' | string split --fields 2 : | string trim | string split ', '
77+end
88+99+complete -c tokei -s C -l compact -d 'Do not print statistics about embedded languages'
1010+complete -c tokei -s f -l files -d 'Print out statistics for individual files'
1111+complete -c tokei -f -s h -l help -d 'Print help information'
1212+complete -c tokei -l hidden -d 'Count hidden files, too'
1313+complete -c tokei -f -s l -l languages -d 'Print out supported languages'
1414+complete -c tokei -l no-ignore -d 'Don’t respect ignore files'
1515+complete -c tokei -l no-ignore-dot -d 'Don’t respect .ignore and .tokeignore files, including those in parent directories'
1616+complete -c tokei -l no-ignore-parent -d 'Don’t respect ignore files in parent directories'
1717+complete -c tokei -l no-ignore-vcs -d 'Don’t respect version-control ignore files'
1818+complete -c tokei -f -s V -l version -d 'Print version information'
1919+complete -c tokei -s v -l verbose -d 'Increase log output level'
2020+2121+# Options
2222+complete -c tokei -x -s c -l columns -d 'Set column width for terminal output'
2323+complete -c tokei -x -s e -l exclude -d 'Ignore all files and directories containing this word'
2424+complete -c tokei -r -s i -l input -d 'Gives statistics from a previous Tokei run'
2525+complete -c tokei -x -s n -l num-format -d 'Format of printed numbers' -ka '(echo "plain 1234, default
2626+commas 1,234
2727+dots 1.234
2828+underscores 1_234")'
2929+complete -c tokei -x -s o -l output -a '(__fish_tokei_supported_serializations)' -d 'Choose output format'
3030+complete -c tokei -x -s s -l sort -ka 'files lines code comments blanks' -d 'Sort languages based on column'
3131+complete -c tokei -x -s t -l type -a '(command tokei --languages)' -d 'Filters output by language type, comma-separated'
+4-22
.config/fish/conf.d/50-config.fish
···4455set -g fish_greeting
6677-if command -qs nvim
77+if test "$TERM_PROGRAM" = vscode
88+ set -gx EDITOR "code --wait"
99+else if command -qs nvim
810 set -gx EDITOR nvim
911else if command -qs vim
1012 set -gx EDITOR vim
···5658 set -gx COLOR_THEME dark
5759end
58605959-# Kinda silly this can't just be in workspace config, but oh well
6060-set -gx ROBOTFRAMEWORK_LS_WATCH_IMPL fsnotify
6161-set -gx ROBOTFRAMEWORK_LS_IGNORE_DIRS '[
6262- "**/bazel-*",
6363- "**/.bazel_out",
6464- "**/.tox",
6565- "**/vendor",
6666- "**/CMakeFiles",
6767- "**/thirdparty",
6868- "**/integrationTest",
6969- "**/build",
7070- "**/src",
7171- "**/go",
7272- "**/web",
7373- "**/Jenkinsfiles",
7474- "**/python",
7575- "**/.pyenv",
7676- "**/node_modules",
7777- "**/packaging"
7878-]'
79618062# Set fish_user_paths here instead of fish_variables to expand $HOME per-machine
8163set -gx fish_user_paths \
···10890 and command -q code
10991 and test -z "$REMOTE_CONTAINERS"
11092 and test -f "$vscode_shell_integration"
111111- source (code --locate-shell-integration-path fish)
9393+ source (code --locate-shell-integration-path fish)
11294end
1139511496# Used to ensure Docker cache hits on dev VM
+7-3
.config/fish/functions/fish_prompt.fish
···3535 set -g __fish_prompt_pyenv ""
3636 end
37373838- set __fish_prompt_nix ""
3838+ set -l nix_icon ""
3939+4040+ set -l __fish_prompt_nix ""
3941 if string match --quiet -- '*/nix/store/*' "$PATH"
4040- set __fish_prompt_nix "$white""( nix) $__fish_prompt_normal"
4242+ set __fish_prompt_nix "$white""($nix_icon nix) $__fish_prompt_normal"
4143 end
42444345 set -l prompt_hostname (prompt_hostname)
···4850 end
49515052 set -l prompt_os (uname)
5151- if test $prompt_os = Darwin
5353+ if test "$YADM_DISTRO" = nixos
5454+ set prompt_os $nix_icon
5555+ else if test $prompt_os = Darwin
5256 set prompt_os " "
5357 else if test $prompt_os = Linux # Maybe could special-case nixos here?
5458 set prompt_os " "
+41
.config/fish/functions/funced.fish
···11+source $__fish_data_dir/functions/funced.fish
22+functions --copy funced __fish_builtin_funced
33+44+function funced --wraps __fish_builtin_funced
55+ set -l funcname
66+ set -l save
77+ for arg in $argv
88+ switch $arg
99+ case -s --save
1010+ set save 1
1111+ case '-*'
1212+ continue
1313+ case '*'
1414+ set funcname $arg
1515+ end
1616+ end
1717+1818+ if test -z $funcname
1919+ __fish_builtin_funced $argv
2020+ return
2121+ end
2222+2323+ if test -n $save
2424+ set -l saved_func $__fish_config_dir/functions/$funcname.fish
2525+ if test -f $saved_func
2626+ # Re-source the config-dir function to make this path be the one that
2727+ # builtin funced will use for editing the definition. This is useful
2828+ # for things like shell integration that override definitions when loaded
2929+ source $saved_func
3030+ else if test -f $__fish_data_dir/functions/$funcname.fish
3131+ echo "source \$__fish_data_dir/functions/$funcname.fish
3232+functions --copy $funcname __fish_builtin_$funcname
3333+function $funcname --wraps __fish_builtin_$funcname
3434+3535+end" >$saved_func
3636+ source $saved_func
3737+ end
3838+ end
3939+4040+ __fish_builtin_funced $argv
4141+end
···1515# (and maybe fish completions)
1616: "${YADM_BOOTSTRAP_FULL:=0}"
17171818+# TODO: all these should be doable with nix-darwin instead
1819function setup_macos() {
1920 # Specify iTerm2 preferences directory
2021 #shellcheck disable=SC2088
···23242425 defaults write com.hegenberg.BetterTouchTool BTTAutoLoadPath ~/.config/btt/Default.bttpreset
25262626- # Default file associations
2727+ # Default file associations (eventually replace with sdwa)
2728 duti ~/.config/duti
28292930 echo "macOS-specific setup is complete!"
···5051 ln -s "$(yadm rev-parse --git-dir)" ~/.config/.git
51525253 # Ensure yadm alt SSH config files are set with the right permissions
5454+ chmod go-rw ~/.ssh/*
5555+ chmod go+r ~/.ssh/*.pub*
5356 chmod go-rw ~/.config/yadm/alt/.ssh/*
5457 chmod go+r ~/.config/yadm/alt/.ssh/*.pub*
5858+5959+ if [[ -z "$(yadm config local.class)" ]]; then
6060+ local class
6161+ read "Enter a value for yadm's 'local.class': " -r class
6262+ yadm config local.class "$class"
6363+ fi
6464+6565+ yadm alt
55665667 if [[ $YADM_BOOTSTRAP_FULL -eq 1 ]]; then
5768 # For now, OS-specific bootstrap is part of "full". Might make sense