bashrc: update config

* Add alias to lock with i3lock
* Add time on prompt
* Add some functions
* Add Buildroot common download dir
main
Mickaël Tansorier 5 years ago
parent c41f7bcb75
commit 64b1654ba8

@ -16,6 +16,9 @@ alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias lock='qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock'
alias lock='import -window root /tmp/screenshot.png && convert /tmp/screenshot.png -blur 0x4 /tmp/screenshot.png && i3lock -i /tmp/screenshot.png'
### Prompt ###
@ -24,7 +27,15 @@ parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# print time
print_time() {
printf "%*s%s\r" "$(tput cols)" "($(date +%H:%M))"
}
# prompt sans heure
PS1='\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ '
# prompt avec heure
PS1='\[\033[00;33m\]$(print_time)\[\033[00;35m\][${debian_chroot:+($debian_chroot)}\u@\h\[\033[00;35m\]:\[\033[00;36m\]\w\[\033[00;35m\]]\[\033[00;31m\]$(parse_git_branch)\n\[\033[00m\]\$ '
### Variable ###
@ -39,10 +50,26 @@ export VISUAL="vim"
h2d(){
echo "ibase=16; $@"|bc
}
d2h(){
echo "obase=16; $@"|bc
}
# kill baloo utils
baloo_clean(){
sudo killall baloo_file
sudo mv /usr/bin/baloo_file /usr/bin/baloo_file.bak
sudo echo '#!/bin/sh' > /usr/bin/baloo_file
}
# print battery level
battery(){
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage
}
### Buildroot override ###
export BR2_DL_DIR=~/BR2_DL_DR
# ********COLOR********
# Palette foncée

Loading…
Cancel
Save