Skip to content

Commit c13a8ba

Browse files
committed
make c and v cross-platform
1 parent 8bed78f commit c13a8ba

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

bin/c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
is_osx && pbcopy
4+
is_wsl && clip.exe
5+
is_ubuntu && xclip -selection c

bin/v

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
is_osx && pbpaste "$@"
4+
is_wsl && powershell.exe Get-Clipboard "$@" || pbpaste "$@"
5+
is_ubuntu && xclip -selection clipboard -o

init.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ is_ubuntu() {
2323
[[ "$(cat /etc/issue 2> /dev/null)" =~ Ubuntu ]] || return 1
2424
}
2525

26+
export -f is_osx
27+
export -f is_wsl
28+
export -f is_ubuntu
29+
2630
# add binaries into the path
2731
export PATH="$DOTFILES/bin:$DOTFILES/best/bin:/usr/local/opt/sqlite/bin:$HOME/.cargo/bin:$PATH"
2832

source/osx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ is_osx || return 1
44
# https://unix.stackexchange.com/a/221988
55
ulimit -n 10000
66

7-
# Trim new lines and copy to clipboard
8-
alias c=pbcopy
9-
alias e=pbpaste # i have conflicts with p, a, s, and t if you can believe it
10-
alias v=pbpaste # wait, ctrl-c and ctrl-v are pretty much universal, so just c and v are good
11-
127
# Make 'less' more.
138
[[ "$(command -v lesspipe.sh > /dev/null 2>&1)" ]] && eval "$(lesspipe.sh)"
149

0 commit comments

Comments
 (0)