From c7de24d96cabcab6a8cafadc8d77bc967edddbdb Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 7 Mar 2019 15:48:34 -0500 Subject: [PATCH] Split .profile into lib files --- .profile | 40 +----------------------------- lib/login_aliases.sh | 6 +++++ .profile => lib/login_functions.sh | 15 ++++------- lib/login_variables.sh | 3 +++ 4 files changed, 15 insertions(+), 49 deletions(-) create mode 100644 lib/login_aliases.sh copy .profile => lib/login_functions.sh (73%) create mode 100644 lib/login_variables.sh diff --git a/.profile b/.profile index 001cba6..54b6032 100644 --- a/.profile +++ b/.profile @@ -1,39 +1 @@ -# Top Disk-Using directories -tdu() { - du "$1" \ - | sort -n -k 1 -r --parallel="$(nproc)" \ - | head -50 \ - | awk ' - { - size = $1 - path = $0 - sub("^" $1 "\t+", "", path) - gb = size / 1024 / 1024 - printf("%f\t%s\n", gb, path) - }' \ - | cut -c 1-115 -} - -void_pkgs() { - curl "https://xq-api.voidlinux.org/v1/query/x86_64?q=$1" | jq '.data' -} - -man() { - LESS_TERMCAP_md=$'\e[01;31m' \ - LESS_TERMCAP_me=$'\e[0m' \ - LESS_TERMCAP_se=$'\e[0m' \ - LESS_TERMCAP_so=$'\e[01;44;33m' \ - LESS_TERMCAP_ue=$'\e[0m' \ - LESS_TERMCAP_us=$'\e[01;32m' \ - command man "$@" -} - -alias l='ls -lFhv' -alias ll='l -a' -alias lll='ll --color=never' -alias tree='tree --dirsfirst' -alias fsi='ledit ~/.dotnet/dotnet ~/.dotnet/sdk/2.1.503/FSharp/fsi.exe' -alias tm='tmux' - -PATH=$HOME/bin:/snap/bin:/sbin:/usr/sbin:$PATH -EDITOR=vim +. $HOME/lib/login_*.sh diff --git a/lib/login_aliases.sh b/lib/login_aliases.sh new file mode 100644 index 0000000..0f376b2 --- /dev/null +++ b/lib/login_aliases.sh @@ -0,0 +1,6 @@ +alias l='ls -lFhv' +alias ll='l -a --color=auto' +alias lll='l -a --color=never' +alias tree='tree --dirsfirst' +alias fsi="ledit $HOME/.dotnet/dotnet $HOME/.dotnet/sdk/2.1.503/FSharp/fsi.exe" +alias tm='tmux' diff --git a/.profile b/lib/login_functions.sh similarity index 73% copy from .profile copy to lib/login_functions.sh index 001cba6..f0963b7 100644 --- a/.profile +++ b/lib/login_functions.sh @@ -14,10 +14,15 @@ tdu() { | cut -c 1-115 } +pa_def_sink() { + pactl info | awk '/^Default Sink:/ {print $3}' +} + void_pkgs() { curl "https://xq-api.voidlinux.org/v1/query/x86_64?q=$1" | jq '.data' } +# Colorful man man() { LESS_TERMCAP_md=$'\e[01;31m' \ LESS_TERMCAP_me=$'\e[0m' \ @@ -27,13 +32,3 @@ man() { LESS_TERMCAP_us=$'\e[01;32m' \ command man "$@" } - -alias l='ls -lFhv' -alias ll='l -a' -alias lll='ll --color=never' -alias tree='tree --dirsfirst' -alias fsi='ledit ~/.dotnet/dotnet ~/.dotnet/sdk/2.1.503/FSharp/fsi.exe' -alias tm='tmux' - -PATH=$HOME/bin:/snap/bin:/sbin:/usr/sbin:$PATH -EDITOR=vim diff --git a/lib/login_variables.sh b/lib/login_variables.sh new file mode 100644 index 0000000..3df0336 --- /dev/null +++ b/lib/login_variables.sh @@ -0,0 +1,3 @@ +PATH=$HOME/bin:/snap/bin:/sbin:/usr/sbin:$PATH +EDITOR=vim +VISUAL=$EDITOR -- 2.20.1