update
This commit is contained in:
parent
8132ea8455
commit
a68acb47f2
6 changed files with 173 additions and 29 deletions
|
|
@ -42,6 +42,9 @@
|
||||||
fontconfig
|
fontconfig
|
||||||
pandoc
|
pandoc
|
||||||
duckdb
|
duckdb
|
||||||
|
(pkgs.python311.withPackages (ppkgs: [
|
||||||
|
ppkgs.numpy
|
||||||
|
]))
|
||||||
]
|
]
|
||||||
++ lib.optionals pkgs.stdenv.isDarwin [ coreutils ]
|
++ lib.optionals pkgs.stdenv.isDarwin [ coreutils ]
|
||||||
++ (lib.attrValues config.custom.shell.packages);
|
++ (lib.attrValues config.custom.shell.packages);
|
||||||
|
|
|
||||||
|
|
@ -34,39 +34,39 @@
|
||||||
macos-option-as-alt = left
|
macos-option-as-alt = left
|
||||||
# theme = gruber-darker
|
# theme = gruber-darker
|
||||||
# theme = xcodelighthc
|
# theme = xcodelighthc
|
||||||
theme = zenburned
|
# theme = zenburned
|
||||||
# font-family = Iosevka Nerd Font Mono
|
# font-family = Iosevka Nerd Font Mono
|
||||||
# font-size = 13
|
# font-size = 13
|
||||||
|
|
||||||
# # background = #062329
|
# background = #062329
|
||||||
# background = #072626
|
background = #072626
|
||||||
# # foreground = #d1b897
|
# foreground = #d1b897
|
||||||
# foreground = #d3b58d
|
foreground = #d3b58d
|
||||||
# cursor-color = #ffffff
|
cursor-color = #ffffff
|
||||||
# # cursor-text = #d1b897
|
# cursor-text = #d1b897
|
||||||
# cursor-text = #d3b58d
|
cursor-text = #d3b58d
|
||||||
# # selection-background = #0000ff
|
|
||||||
# # selection-foreground = #d1b897
|
|
||||||
# selection-background = #0000ff
|
# selection-background = #0000ff
|
||||||
# selection-foreground = #d3b58d
|
# selection-foreground = #d1b897
|
||||||
# # palette = 0=#062329
|
selection-background = #0000ff
|
||||||
# palette = 0=#072626
|
selection-foreground = #d3b58d
|
||||||
# # palette = 1=#0b3335
|
# palette = 0=#062329
|
||||||
# # palette = 2=#0000ff
|
palette = 0=#072626
|
||||||
# palette = 3=#44b340
|
# palette = 1=#0b3335
|
||||||
# palette = 4=#8cde94
|
# palette = 2=#0000ff
|
||||||
# # palette = 5=#d1b897
|
palette = 3=#44b340
|
||||||
# palette = 5=#d3b58d
|
palette = 4=#8cde94
|
||||||
# palette = 6=#c1d1e3
|
# palette = 5=#d1b897
|
||||||
# palette = 7=#ffffff
|
palette = 5=#d3b58d
|
||||||
# palette = 8=#626880
|
palette = 6=#c1d1e3
|
||||||
# palette = 9=#e67172
|
palette = 7=#ffffff
|
||||||
# palette = 10=#8ec772
|
palette = 8=#626880
|
||||||
# palette = 11=#d9ba73
|
palette = 9=#e67172
|
||||||
# palette = 12=#7b9ef0
|
palette = 10=#8ec772
|
||||||
# palette = 13=#f2a4db
|
palette = 11=#d9ba73
|
||||||
# palette = 14=#5abfb5
|
palette = 12=#7b9ef0
|
||||||
# palette = 15=#b5bfe2
|
palette = 13=#f2a4db
|
||||||
|
palette = 14=#5abfb5
|
||||||
|
palette = 15=#b5bfe2
|
||||||
|
|
||||||
keybind = all:ctrl+shift+period=text:\x1b\x1f\x4c\x23\x1f
|
keybind = all:ctrl+shift+period=text:\x1b\x1f\x4c\x23\x1f
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
117
home/shell/bin/cb
Executable file
117
home/shell/bin/cb
Executable file
|
|
@ -0,0 +1,117 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# from: https://gist.github.com/RichardBronosky/56d8f614fab2bacdd8b048fb58d0c0c7
|
||||||
|
|
||||||
|
LINUX_copy() {
|
||||||
|
cat | xclip -selection clipboard
|
||||||
|
}
|
||||||
|
|
||||||
|
LINUX_paste() {
|
||||||
|
xclip -selection clipboard -o
|
||||||
|
}
|
||||||
|
|
||||||
|
WSL_copy() {
|
||||||
|
cat | /mnt/c/Windows/System32/clip.exe
|
||||||
|
}
|
||||||
|
|
||||||
|
WSL_paste() {
|
||||||
|
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Get-Clipboard | sed 's/\r//'
|
||||||
|
}
|
||||||
|
|
||||||
|
CYGWIN_copy() {
|
||||||
|
cat > /dev/clipboard
|
||||||
|
}
|
||||||
|
|
||||||
|
CYGWIN_paste() {
|
||||||
|
cat /dev/clipboard
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MAC_copy() {
|
||||||
|
cat | pbcopy
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MAC_paste() {
|
||||||
|
pbpaste
|
||||||
|
}
|
||||||
|
|
||||||
|
stdin_is_a_pipe() {
|
||||||
|
[[ -p /dev/stdin ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
stdin_is_a_tty() {
|
||||||
|
[[ -t 0 ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
stdin_is_pipe_like() {
|
||||||
|
stdin_is_a_pipe || ! stdin_is_a_tty
|
||||||
|
}
|
||||||
|
|
||||||
|
stdout_is_pipe_like() {
|
||||||
|
! stdout_is_a_tty # meaning # it must be a pipe or redirection
|
||||||
|
}
|
||||||
|
|
||||||
|
stdout_is_a_tty() {
|
||||||
|
[[ -t 1 ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
requested_open_ended() {
|
||||||
|
[[ "${args[0]:-}" == "-" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
requested_test_suite() {
|
||||||
|
[[ "${args[0]:-}" == "--test" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_tee_like_chaining() {
|
||||||
|
# see `man tee`
|
||||||
|
if stdout_is_pipe_like; then
|
||||||
|
${os}_paste
|
||||||
|
elif requested_open_ended; then
|
||||||
|
${os}_paste
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
prevent_prompt_from_being_on_the_same_line() {
|
||||||
|
if stdout_is_a_tty; then # we don't have to be strict about not altering the output
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_os() {
|
||||||
|
if [[ -f /proc/version ]] && grep -iq Microsoft /proc/version; then
|
||||||
|
printf WSL
|
||||||
|
else
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Linux*) printf LINUX;;
|
||||||
|
Darwin*) printf MAC;;
|
||||||
|
CYGWIN*) printf CYGWIN;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function debug() {
|
||||||
|
stdin_is_a_pipe && echo "stdin_is_a_pipe: 1" >> /tmp/ono || echo "stdin_is_a_pipe: 0" >> /tmp/ono
|
||||||
|
stdin_is_a_tty && echo "stdin_is_a_tty: 1" >> /tmp/ono || echo "stdin_is_a_tty: 0" >> /tmp/ono
|
||||||
|
stdin_is_pipe_like && echo "stdin_is_pipe_like: 1" >> /tmp/ono || echo "stdin_is_pipe_like: 0" >> /tmp/ono
|
||||||
|
stdout_is_pipe_like && echo "stdout_is_pipe_like: 1" >> /tmp/ono || echo "stdout_is_pipe_like: 0" >> /tmp/ono
|
||||||
|
stdout_is_a_tty && echo "stdout_is_a_tty: 1" >> /tmp/ono || echo "stdout_is_a_tty: 0" >> /tmp/ono
|
||||||
|
echo >> /tmp/ono
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
os="$(detect_os)"
|
||||||
|
if stdin_is_pipe_like; then
|
||||||
|
${os}_copy
|
||||||
|
enable_tee_like_chaining
|
||||||
|
else # stdin is not pipe-like
|
||||||
|
${os}_paste
|
||||||
|
prevent_prompt_from_being_on_the_same_line
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
args=("$@")
|
||||||
|
[[ ${DEBUG:-} == 1 ]] && debug
|
||||||
|
main
|
||||||
12
home/shell/bin/clear-pbcopy
Executable file
12
home/shell/bin/clear-pbcopy
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sleepsec=10
|
||||||
|
|
||||||
|
if [ $# == 1 ]; then
|
||||||
|
sleepsec=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
sleep $sleepsec
|
||||||
|
pbcopy < /dev/null
|
||||||
|
|
||||||
3
home/shell/bin/e
Executable file
3
home/shell/bin/e
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
emacs -nw $@
|
||||||
9
home/shell/bin/x-open
Executable file
9
home/shell/bin/x-open
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
|
open $@
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||||
|
xdg-open $@
|
||||||
|
else
|
||||||
|
echo "Platform Not supported"
|
||||||
|
fi
|
||||||
Loading…
Reference in a new issue