Compare commits

..

No commits in common. "007064ce60723ff75f0010472131a66552a62ce7" and "da9adb51595b8cc05a1ec8ead232d91a034e50e8" have entirely different histories.

6 changed files with 8 additions and 70 deletions

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
if [ "$#" -ne 2 ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects two arguments\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
exit 1
fi
if [ "$USER" != "root" ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
exit 1
fi
# Mounts an encrypt external drive to a specified mount point
cryptsetup luksOpen $1 external
mount /dev/mapper/external $2

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects one argument\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
exit 1
fi
if [ "$USER" != "root" ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
exit 1
fi
# Mounts an encrypt external drive to a specified mount point
umount $1
cryptsetup luksClose external

View File

@ -14,34 +14,23 @@ _check_date() {
fi
}
weather_loop() {
if [ $# -gt 0 ]
then
for ((i=1; i<=$#; i++)); do
curl --retry 10 --connect-timeout 20 wttr.in/${!i} 2>/dev/null
done
main() {
if [ "$1" == "startup" ]; then
_check_date
if [ $? -ne 0 ]; then
curl --retry 10 --connect-timeout 20 wttr.in 2>/dev/null
if [ $? -eq 0 ]; then
date +%d/%m/%Y > ~/.config/dotfiles/.data/weather_date
else
echo -e "\033[31;1mNetwork unavailable, please check your connexion or try again later.\033[0m"
fi
fi
else
curl --retry 10 --connect-timeout 20 wttr.in 2>/dev/null
if [ $? -eq 0 ]; then
if [ $? -ne 0 ]; then
echo -e "\033[31;1mNetwork unavailable, please check your connexion or try again later.\033[0m"
fi
fi
}
main() {
if [ "$1" == "startup" ]; then
_check_date
if [ $? -ne 0 ]; then
weather_loop ${@:2}
fi
else
weather_loop $@
fi
}
main $@

View File

@ -45,7 +45,6 @@ set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set tw=120
" }}}
" UI CONFIG #########################################################{{{

View File

@ -51,23 +51,11 @@ alias bat="bat --paging=never"
alias rg="rg -uu"
# Aliases for pass
alias p="pass"
alias pc="pass --clip"
# mkdir && cd
mkcd() {
mkdir $1 && cd $1
}
# which && cd
cdw() {
f=`which $1`
if [ $? -eq 0 ]; then
cd `dirname $f`
fi
}
# Initialize thefuck
command -v thefuck > /dev/null 2>&1

View File

@ -20,7 +20,7 @@ DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/me
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git myjump pass)
plugins=(git myjump)
source $ZSH/oh-my-zsh.sh