Split .profile into lib files
authorSiraaj Khandkar <siraaj@khandkar.net>
Thu, 7 Mar 2019 20:48:34 +0000 (15:48 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Thu, 7 Mar 2019 20:48:34 +0000 (15:48 -0500)
.profile
lib/login_aliases.sh [new file with mode: 0644]
lib/login_functions.sh [copied from .profile with 73% similarity]
lib/login_variables.sh [new file with mode: 0644]

index 001cba6..54b6032 100644 (file)
--- 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 (file)
index 0000000..0f376b2
--- /dev/null
@@ -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'
similarity index 73%
copy from .profile
copy to lib/login_functions.sh
index 001cba6..f0963b7 100644 (file)
--- a/.profile
@@ -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 (file)
index 0000000..3df0336
--- /dev/null
@@ -0,0 +1,3 @@
+PATH=$HOME/bin:/snap/bin:/sbin:/usr/sbin:$PATH
+EDITOR=vim
+VISUAL=$EDITOR
This page took 0.03469 seconds and 4 git commands to generate.