dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 3e37dbd61d2af256f55a6f3bcca3fa1427cb3be3
parent 6e408a76d19172be19b3448f4f5c15d3ea733eff
Author: pyratebeard <root@pyratebeard.net>
Date:   Sun, 12 Sep 2021 22:44:06 +0100

aliases, env, mm func, prompt

modified disks alias. new bluetooth and head aliases. update {no,}disturb alias. buku and tin aliases. add some comments to functions. update screencast func. add terminal title func

export lynx colours

set ytdl vol

update tiny prompt

Diffstat:
Mzsh/.zsh/aliases.zsh | 37++++++++++++++++++++++++++++++-------
Mzsh/.zsh/environment.zsh | 3+++
Mzsh/.zsh/functions/mm | 2+-
Mzsh/.zsh/prompt.zsh | 5+++--
4 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh @@ -38,7 +38,8 @@ alias pacman="sudo pacman" alias update="pacman -Syu" alias systemctl="sudo systemctl" alias :q="sudo systemctl poweroff" -alias disks='echo "╓───── m o u n t . p o i n t s"; echo "╙────────────────────────────────────── ─ ─ "; lsblk -a; echo ""; echo "╓───── d i s k . u s a g e"; echo "╙────────────────────────────────────── ─ ─ "; df -h;' +#alias disks='echo "╓───── m o u n t . p o i n t s"; echo "╙────────────────────────────────────── ─ ─ "; lsblk -a; echo ""; echo "╓───── d i s k . u s a g e"; echo "╙────────────────────────────────────── ─ ─ "; sudo df -h -x tmpfs -x devtmpfs;' +alias disks='echo "┌──┄";echo "├┄ m o u n t . p o i n t s"; echo "└──┄┄────┄┄"; lsblk -a; echo ""; echo "┌──┄";echo "├┄ d i s k . u s a g e"; echo "└──┄┄────┄┄"; sudo df -h -x tmpfs -x devtmpfs;' alias record="ffmpeg -f x11grab -s 1366x768 -an -r 16 -loglevel quiet -i :0.0 -b:v 5M -y" #pass a filename alias gifview="gifview -a" alias reboot="sudo reboot" @@ -65,12 +66,16 @@ alias netctl="sudo netctl" alias feh="feh -g 640x480" alias rum.sh="nc rum.sh 9999" alias headsetbatt="bluetooth_battery 34:DF:2A:5F:04:2C" -alias connect-headset="echo 'connect 34:DF:2A:5F:04:2C' | bluetoothctl" +alias headset="echo 'connect 34:DF:2A:5F:04:2C' | bluetoothctl" +alias bton="echo 'power on' | bluetoothctl" +alias btoff="echo 'power off' | bluetoothctl" alias moebius="cd $HOME/src/warez/moebius ; /usr/bin/npm start" alias cointop="$HOME/src/go/bin/cointop --hide-statusbar" -alias nodisturb="/usr/bin/notify-send 'DUNST_COMMAND_PAUSE'" -alias disturb="/usr/bin/notify-send 'DUNST_COMMAND_RESUME'" +alias nodisturb="dunstctl set-paused true" +alias disturb="dunstctl set-paused false" alias sacc="PAGER=less sacc" +alias buku="buku --np" +alias tin="NNTPSERVER=eu.newsdemon.com ~/src/warez/tin/tin-latest/src/tin -r -A" alias -s md=vim alias -s {png,jpg,jpeg}=sxiv @@ -80,6 +85,7 @@ alias -s mp4=mpv email() { echo $3 | mutt -s $2 $1 } + # colorised cat c() { for file in "$@" @@ -87,31 +93,48 @@ c() { pygmentize -O style=sourcerer -f console256 -g "$file" done } + # colorised less #l() { # pygmentize -O style=sourcerer -f console256 -g $1 | less -r #} + # read markdown files like manpages md() { pandoc -s -f markdown -t man "$*" | man -l - } + +# read webpage as manpage webman() { - curl "$@" | pandoc -s -f html -t man | man -l - + curl -L "$@" | pandoc -s -f html -t man | man -l - } + +# read anything as manpage nam() { pandoc -s -t man "$*" | man -l - } + +# connect to tmux on ssh ssux() { TERM=screen ssh -t "$@" 'tmux attach || tmux new' || ssh "$@" } +# record the primary screen screencast() { - RESOLUTION=$(xrandr | grep "*" | awk '{print $1}') - ffmpeg -f x11grab -s $RESOLUTION -an -r 16 -loglevel quiet -i :0.0 -b:v 5M -y $HOME/lib/videos/recordings/screencasts/$(date +%Y%m%d)-${1} + RESOLUTION=$(xrandr | grep "*" | awk '{print $1}' | head -n1) + echo "recording..." + ffmpeg -f x11grab -s ${RESOLUTION} -an -r 16 -loglevel quiet -i :0.0 -b:v 5M -y ${HOME}/lib/videos/recordings/screencasts/$(date +%Y%m%d)-${1}.webm } +# take picture with webcam webcapture() { NUM=$(ls -l $HOME/tmp/*webcapture*|wc -l) NUM=$(( NUM + 1 )) ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 $HOME/tmp/$(date +%Y%m%d)-webcapture-${NUM}.png } + +# sets terminal title +# useful for unhide +title() { + printf "\033]2;${1}\007" +} diff --git a/zsh/.zsh/environment.zsh b/zsh/.zsh/environment.zsh @@ -11,6 +11,9 @@ export GOPATH=$HOME/src/go export EDITOR=vim export VISUAL=vim +# lynx colours +export LYNX_LSS=$HOME/.config/lynx/lynx.lss + # language export LC_COLLATE=en_GB.UTF-8 export LC_CTYPE=en_GB.UTF-8 diff --git a/zsh/.zsh/functions/mm b/zsh/.zsh/functions/mm @@ -1,3 +1,3 @@ emulate -L zsh #mpv --audio-device=pulse/1 ytdl://ytsearch10:"$@" -mpv ytdl://ytsearch10:"$@" +mpv --volume=60 ytdl://ytsearch10:"$@" diff --git a/zsh/.zsh/prompt.zsh b/zsh/.zsh/prompt.zsh @@ -97,8 +97,9 @@ PROMPT='${USER_LEVEL}[${COLOR_NORMAL}%~${USER_LEVEL}]$(GIT_PROMPT)── - %f' ;; # tiny tiny) -PROMPT='%F{3} %%${COLOR_NORMAL} ' -RPROMPT='%F{15}%~ $(GIT_PROMPT) %F{8}${HOSTNAME}${COLOR_NORMAL}' +#PROMPT='%F{3} %%${COLOR_NORMAL} ' +PROMPT='%F{3} ──── ─${COLOR_NORMAL} ' +RPROMPT='%F{15}%~ $(GIT_PROMPT) %F{11}${HOSTNAME}${COLOR_NORMAL}' ;; # classic *)