Compare commits
No commits in common. "007064ce60723ff75f0010472131a66552a62ce7" and "da9adb51595b8cc05a1ec8ead232d91a034e50e8" have entirely different histories.
007064ce60
...
da9adb5159
19
bin/lmount
19
bin/lmount
|
@ -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
|
|
19
bin/lumount
19
bin/lumount
|
@ -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
|
|
25
bin/weather
25
bin/weather
|
@ -14,34 +14,23 @@ _check_date() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
weather_loop() {
|
main() {
|
||||||
if [ $# -gt 0 ]
|
if [ "$1" == "startup" ]; then
|
||||||
then
|
_check_date
|
||||||
for ((i=1; i<=$#; i++)); do
|
if [ $? -ne 0 ]; then
|
||||||
curl --retry 10 --connect-timeout 20 wttr.in/${!i} 2>/dev/null
|
curl --retry 10 --connect-timeout 20 wttr.in 2>/dev/null
|
||||||
done
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
date +%d/%m/%Y > ~/.config/dotfiles/.data/weather_date
|
date +%d/%m/%Y > ~/.config/dotfiles/.data/weather_date
|
||||||
else
|
else
|
||||||
echo -e "\033[31;1mNetwork unavailable, please check your connexion or try again later.\033[0m"
|
echo -e "\033[31;1mNetwork unavailable, please check your connexion or try again later.\033[0m"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
curl --retry 10 --connect-timeout 20 wttr.in 2>/dev/null
|
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"
|
echo -e "\033[31;1mNetwork unavailable, please check your connexion or try again later.\033[0m"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
|
||||||
if [ "$1" == "startup" ]; then
|
|
||||||
_check_date
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
weather_loop ${@:2}
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
weather_loop $@
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
|
1
init.vim
1
init.vim
|
@ -45,7 +45,6 @@ set expandtab
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set autoindent
|
set autoindent
|
||||||
set tw=120
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" UI CONFIG #########################################################{{{
|
" UI CONFIG #########################################################{{{
|
||||||
|
|
|
@ -51,23 +51,11 @@ alias bat="bat --paging=never"
|
||||||
|
|
||||||
alias rg="rg -uu"
|
alias rg="rg -uu"
|
||||||
|
|
||||||
# Aliases for pass
|
|
||||||
alias p="pass"
|
|
||||||
alias pc="pass --clip"
|
|
||||||
|
|
||||||
# mkdir && cd
|
# mkdir && cd
|
||||||
mkcd() {
|
mkcd() {
|
||||||
mkdir $1 && cd $1
|
mkdir $1 && cd $1
|
||||||
}
|
}
|
||||||
|
|
||||||
# which && cd
|
|
||||||
cdw() {
|
|
||||||
f=`which $1`
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
cd `dirname $f`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Initialize thefuck
|
# Initialize thefuck
|
||||||
command -v thefuck > /dev/null 2>&1
|
command -v thefuck > /dev/null 2>&1
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ DISABLE_AUTO_TITLE="true"
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
# 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
|
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/me
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
plugins=(git myjump pass)
|
plugins=(git myjump)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue