2016-02-24 00:18:23 +01:00
|
|
|
# bip at command end
|
2019-04-09 15:27:46 +02:00
|
|
|
function precmd() {
|
|
|
|
|
echo -n -e "\a"
|
|
|
|
|
main_screen=$(echo "if require('awful.screen').focused().index == 1 then return('main-screen') end" | awesome-client)
|
|
|
|
|
if [ $main_screen ]; then
|
2019-04-09 16:32:17 +02:00
|
|
|
/home/hybris/.scripts/term-fontsize $(cat ~/.config/term-fontsize_1)
|
2019-04-09 15:27:46 +02:00
|
|
|
else
|
2019-04-09 16:32:17 +02:00
|
|
|
/home/hybris/.scripts/term-fontsize $(cat ~/.config/term-fontsize_2)
|
2019-04-09 15:27:46 +02:00
|
|
|
fi
|
|
|
|
|
}
|
2016-02-24 00:18:23 +01:00
|
|
|
|
|
|
|
|
# do not share history between terms...
|
|
|
|
|
unsetopt share_history
|
|
|
|
|
|
|
|
|
|
# Everyday aliases
|
2019-03-25 11:52:35 +01:00
|
|
|
catwhich() {echo "\e[35mPath: $(which $1)\n\e[39m"; cat $(which $1)}
|
2019-03-22 10:28:28 +01:00
|
|
|
cless() {for a in $@; do ccat $a | less; done}
|
2019-03-26 16:43:07 +01:00
|
|
|
dchroot() {docker run --rm --privileged -ti $@ debian:stretch /bin/bash}
|
|
|
|
|
dontknow() {echo -n "¯\\_(ツ)_/¯" | xclip}
|
2019-03-07 14:44:39 +01:00
|
|
|
e() {emacsclient -n $@ > /dev/null 2>&1}
|
2019-03-26 16:51:50 +01:00
|
|
|
fd() {fdfind -H -I -L $@}
|
2019-03-07 14:44:39 +01:00
|
|
|
j() {if [ $# -eq 0 ]; then marks; else jump $@; fi}
|
|
|
|
|
loop() {while [ 1 ]; do sh -c "$@"; done}
|
2019-04-09 15:27:46 +02:00
|
|
|
open_ports() {if [ $# -eq 1 ] && [ $1 = "public" ]; then sudo netstat -tulpen 2> /dev/null | grep "LISTEN" | grep -v "127.0.0.1"; else sudo netstat -tulpen 2> /dev/null | grep "LISTEN"; fi}
|
2019-03-22 10:28:28 +01:00
|
|
|
r() {if [ $# -gt 0 ]; then for h in $@; do ssh root@$h; done; else sudo su -; fi}
|
|
|
|
|
sc-error() {xdg-open "https://github.com/koalaman/shellcheck/wiki/$1"}
|
2017-03-29 18:03:20 +02:00
|
|
|
|
2017-11-30 15:28:17 +01:00
|
|
|
# Usefull bindings
|
2017-11-30 15:32:26 +01:00
|
|
|
bindkey "^[Od" backward-word
|
|
|
|
|
bindkey "^[Oc" forward-word
|
2016-02-24 00:18:23 +01:00
|
|
|
|
|
|
|
|
# Some exports
|
|
|
|
|
export EDITOR=emacsclient
|
|
|
|
|
export LESS=-cex2MRX
|
|
|
|
|
export LESSOPEN='|~/.lessfilter %s'
|
|
|
|
|
export LOGCHECK=60
|
2017-04-06 16:26:30 +02:00
|
|
|
export PATH=$HOME/.scripts:$PATH
|
2016-02-24 00:18:23 +01:00
|
|
|
export READNULLCMD=${PAGER:-/usr/bin/pager}
|
|
|
|
|
export WATCH=all
|
|
|
|
|
export WATCHFMT="%n has %a %l from %M"
|
2018-03-28 15:29:53 +02:00
|
|
|
|
|
|
|
|
# Some completions
|
2018-04-25 15:30:02 +02:00
|
|
|
compctl -K _completemarks j
|
2019-03-25 12:56:20 +01:00
|
|
|
compdef _path_commands catwhich
|