2022-12-04 22:59:34 +01:00
|
|
|
# ksh environment file
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# ENVIRONMENT VARIABLES
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
### SEARCH PATHS
|
2023-02-16 10:12:03 +01:00
|
|
|
PATH=~/.bin\
|
2023-04-06 17:48:14 +02:00
|
|
|
:~/.local/bin\
|
2022-12-04 22:59:34 +01:00
|
|
|
:/bin\
|
|
|
|
:/sbin\
|
|
|
|
:/usr/bin\
|
|
|
|
:/usr/sbin\
|
|
|
|
:/usr/local/bin\
|
|
|
|
:/usr/local/sbin\
|
|
|
|
:/usr/X11R6/bin\
|
|
|
|
:/usr/games\
|
2023-02-16 10:12:03 +01:00
|
|
|
:/usr/ports/infrastructure/bin
|
2022-12-17 10:27:50 +01:00
|
|
|
JAVA_HOME=/usr/local/jdk-11/bin
|
|
|
|
PATH=${PATH}:${JAVA_HOME}
|
2022-12-04 22:59:34 +01:00
|
|
|
export PATH
|
|
|
|
|
|
|
|
### LANGUAGE
|
|
|
|
LANG=en_US.UTF-8
|
|
|
|
LC_MESSAGES=C
|
|
|
|
LC_NUMERIC=C
|
2023-11-19 08:40:50 +01:00
|
|
|
LC_TIME=de_DE.UTF-8
|
2022-12-04 22:59:34 +01:00
|
|
|
export LANG LC_ALL LC_MESSAGES LC_NUMERIC LC_TIME
|
|
|
|
|
2023-10-24 16:14:42 +02:00
|
|
|
### SOFTWARE PREFERENCES
|
|
|
|
EDITOR="vim"
|
|
|
|
VISUAL="vim"
|
2024-01-24 08:02:39 +01:00
|
|
|
BROWSER="luakit"
|
2023-10-24 16:14:42 +02:00
|
|
|
PAGER="less"
|
|
|
|
export EDITOR VISUAL BROWSER PAGER
|
|
|
|
|
2023-11-01 16:08:10 +01:00
|
|
|
PRINTER="rp"
|
|
|
|
export PRINTER
|
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
# STOP HERE IF NON INTERACTIVE
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
########################################################################
|
2023-12-31 21:59:50 +01:00
|
|
|
# MANDATORY ENVIRONMENT
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
|
|
|
### HISTORY
|
|
|
|
HISTCONTROL=ignoredups:ignorespace:erasedups
|
|
|
|
HISTFILE=$HOME/.ksh-history
|
|
|
|
HISTSIZE=2000
|
|
|
|
export HISTCONTROL HISTFILE HISTSIZE
|
|
|
|
|
|
|
|
# LESS
|
2023-01-10 22:18:46 +01:00
|
|
|
LESS="-giJmR--tilde"
|
2022-12-04 22:59:34 +01:00
|
|
|
LESSHISTFILE="$HOME/.less-history"
|
|
|
|
export LESS LESSHISTFILE
|
|
|
|
|
|
|
|
########################################################################
|
2024-01-19 22:17:16 +01:00
|
|
|
# PROMPT
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
2024-01-22 17:52:20 +01:00
|
|
|
C1="\[$(tput setaf 241)\]" # gray
|
2024-01-21 21:52:18 +01:00
|
|
|
#C2="\[$(tput setaf 208)\]" # orange
|
2024-01-22 17:52:20 +01:00
|
|
|
C2="\[$(tput setaf 37)\]" # green
|
|
|
|
C0="\[$(tput op)\]" # reset
|
|
|
|
x=$(print \\001) # hack from ksh(1)
|
2024-01-19 22:17:16 +01:00
|
|
|
PS1="$x\${C1}[\${C2}\h\${C1}](\${C2}\${?}\${C1})(\${C2}\W\${C1})\\$ \${C0}$x"
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# SHELL SETTINGS
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
ulimit -c 0
|
|
|
|
stty -ixon -ixoff
|
|
|
|
set -o emacs
|
|
|
|
set bell-style none
|
|
|
|
|
|
|
|
########################################################################
|
2024-01-01 13:48:13 +01:00
|
|
|
# MODULE LOADER
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
2024-01-01 13:48:13 +01:00
|
|
|
load() { [ -f ~/.ksh/$1 ] && . ~/.ksh/$1; }
|
2023-01-13 13:46:11 +01:00
|
|
|
|
2024-01-01 13:48:13 +01:00
|
|
|
load environment.ksh
|
|
|
|
load functions.ksh
|
|
|
|
load aliases.ksh
|
2024-01-22 16:55:21 +01:00
|
|
|
load task.ksh
|
2024-01-01 13:48:13 +01:00
|
|
|
load email.ksh
|
|
|
|
load porttools.ksh
|
|
|
|
load remind.ksh
|
|
|
|
load ytdl.ksh
|
2024-01-05 12:30:05 +01:00
|
|
|
load amused.ksh
|
2024-01-01 23:15:04 +01:00
|
|
|
load gnupg.ksh
|
2024-01-19 08:53:08 +01:00
|
|
|
load fzf.ksh
|
2024-01-19 22:17:16 +01:00
|
|
|
load dotfiles.ksh
|
2024-01-02 10:24:27 +01:00
|
|
|
load localstuff.ksh
|
2024-01-19 22:17:16 +01:00
|
|
|
load complete.ksh
|
|
|
|
|
2024-01-01 13:48:13 +01:00
|
|
|
|
|
|
|
########################################################################
|
2024-01-01 23:15:04 +01:00
|
|
|
# ALIASES (MISC)
|
2024-01-01 13:48:13 +01:00
|
|
|
########################################################################
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
# mount
|
|
|
|
alias mount_msdos="doas \mount_msdos -o nodev,nosuid,noatime -u 1000 -g 1000"
|
2024-01-19 22:17:16 +01:00
|
|
|
mount_tank() { awk '$3=="nfs"{print $2}' /etc/fstab | xargs -n1 doas mount -v | cut -d" " -f-3; }
|
|
|
|
umount_tank() { awk '$3=="nfs"{print $2}' /etc/fstab | xargs -n1 doas umount -v | cut -d" " -f-3; }
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2023-01-11 09:38:57 +01:00
|
|
|
pw() { pwgen -1 -y --remove-chars=\~\`\"\'{}\(\)\[\]\*.\;\|,\<\> 22; }
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# TWITCH FROM CLI
|
|
|
|
########################################################################
|
|
|
|
|
2024-01-19 22:17:16 +01:00
|
|
|
alias twitch_play="mpv https://www.twitch.tv/c0dev0id"
|
|
|
|
twitch_stream() {
|
2022-12-04 22:59:34 +01:00
|
|
|
local API_KEY=$(pass Internet/Twitch | head -1)
|
|
|
|
local RES=$(xrandr | grep "*+" | awk '{print $1}')
|
|
|
|
local FAUX_OPTS="-d snd/default -m -vmic 5.0 -vmon 0.2 -r $RES -f 20 -b 4000"
|
2022-12-13 23:16:23 +01:00
|
|
|
fauxstream $FAUX_OPTS rtmp://live-ams.twitch.tv/app/$API_KEY
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
|
|
|
|