Compare commits
5 Commits
da9adb5159
...
007064ce60
Author | SHA1 | Date |
---|---|---|
Thibault Blanc-Beyne | 007064ce60 | |
Thomas Forgione | 01596d9078 | |
Thomas Forgione | 1920d0d9e1 | |
Thomas Forgione | 819fe5bf5c | |
Thomas Forgione | 1587972276 |
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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,23 +14,34 @@ _check_date() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
weather_loop() {
|
||||||
if [ "$1" == "startup" ]; then
|
if [ $# -gt 0 ]
|
||||||
_check_date
|
then
|
||||||
if [ $? -ne 0 ]; then
|
for ((i=1; i<=$#; i++)); do
|
||||||
curl --retry 10 --connect-timeout 20 wttr.in 2>/dev/null
|
curl --retry 10 --connect-timeout 20 wttr.in/${!i} 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 [ $? -ne 0 ]; then
|
if [ $? -eq 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,6 +45,7 @@ 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,11 +51,23 @@ 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)
|
plugins=(git myjump pass)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue