From fd7e872565f9352a1435cf35245e97b4546bb819 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Thu, 22 Aug 2013 16:26:45 +0200 Subject: [PATCH] Some cleanup --- Utils/octopus.sh | 5 ++ bashrc | 2 +- dwm/config.h | 7 +- install.sh | 150 ++++++++++++++++++++++++++--------------- vim/scripts/doc.php.sh | 2 + vimrc => vim/vimrc | 11 ++- xinitrc | 2 +- 7 files changed, 118 insertions(+), 61 deletions(-) create mode 100755 vim/scripts/doc.php.sh rename vimrc => vim/vimrc (94%) diff --git a/Utils/octopus.sh b/Utils/octopus.sh index a1c9363..eb23ddd 100755 --- a/Utils/octopus.sh +++ b/Utils/octopus.sh @@ -82,6 +82,11 @@ case $1 in "suspend") systemctl suspend xlock -mode blank + ;; + + "lock") + xlock -mode blank -dpmsoff 1 + ;; esac diff --git a/bashrc b/bashrc index a4d1a06..c752dbf 100644 --- a/bashrc +++ b/bashrc @@ -99,7 +99,7 @@ alias makew='make' alias BSI2='cd ~/Documents/UniGE/BSI2*/' -OCTOPUS=~/Programmation/Utils/octopus.sh +OCTOPUS=~/.my_utils/octopus.sh alias dual='$OCTOPUS monitor dual' alias laptop='$OCTOPUS monitor laptop' alias extern='$OCTOPUS monitor extern' diff --git a/dwm/config.h b/dwm/config.h index 09c42e4..38f105e 100644 --- a/dwm/config.h +++ b/dwm/config.h @@ -2,7 +2,8 @@ #include "fibonacci.c" /* appearance */ -static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; +//static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; +static const char font[] = "-*-dejavu sans-medium-r-*-*-14-*-*-*-*-*-*-*"; static const char normbordercolor[] = "#444444"; static const char normbgcolor[] = "#222222"; static const char normfgcolor[] = "#bbbbbb"; @@ -63,10 +64,6 @@ static const char *muttcmd[] = {"roxterm", "-e", "mutt", NULL}; //static const char *lockcmd[] = { "xlock", "-mode", "blank", "-startCmd", "~/Programmation/Utils/monitorOff.sh", "-timeout", "15", "-dpmsoff", "1", NULL }; -//static const char *volup[] = { "amixer", "-q", "set", "Master", "5%+", "unmute", NULL }; -//static const char *voldown[] = { "amixer", "-q", "set", "Master", "5%-", "unmute", NULL }; -//static const char *volmute[] = { "amixer", "-q", "set", "Master", "toggle", NULL }; - static const char *volup[] = {"octopus.sh", "vol", "up", NULL}; static const char *voldown[] = {"octopus.sh", "vol", "down", NULL}; static const char *volmute[] = {"octopus.sh", "vol", "mute", NULL}; diff --git a/install.sh b/install.sh index f8a65ae..0ba096d 100755 --- a/install.sh +++ b/install.sh @@ -1,69 +1,113 @@ #!/bin/bash +function deploy_for_desktop() +{ # {{{ + cd ~ + ln -s $WAI/xinitrc ./.xinitrc + ln -s $WAI/octaverc ./.octaverc + ln -s $WAI/gitconfig ./.gitconfig + + cd ~ + if [ ! -d "~/.my_utils" ]; then mkdir ~/.my_utils; fi; + cd ~/.my_utils + ln -s $WAI/Utils/monitor.sh ./monitor.sh + ln -s $WAI/Utils/monitorOff.sh ./monitorOff.sh + ln -s $WAI/Utils/track.sh ./track.sh + ln -s $WAI/Utils/blink.sh ./blink.sh + ln -s $WAI/Utils/octopus.sh ./octopus.sh + + + ln -s $WAI/chooseWP.sh ~/Pictures/wallpapers/chooseWP.sh +} # }}} + +function deploy_vim() +{ # {{{ + + cd ~ + ln -s $WAI/vim/vimrc ./.vimrc + + if [ ! -d "~/.vim" ]; then mkdir ~/.vim/; fi; + cd ~/.vim + + if [ ! -d "./colors" ]; then mkdir colors; fi; + cd colors + ln -s $WAI/vim/colors/wombat256modv1.vim ./wombat256modv1.vim + + cd .. + if [ ! -d "./skeletons" ]; then mkdir skeletons; fi; + cd skeletons + for i in `ls $WAI/vim/skeletons`; do ln -s $WAI/vim/skeletons/$i ./$i; done + + cd .. + if [ ! -d "./spell" ]; then mkdir spell; fi; + cd spell + for i in `ls $WAI/vim/spell`; do ln -s $WAI/vim/spell/$i ./$i; done + + cd .. + if [ ! -d "./plugin" ]; then mkdir plugin; fi; + cd plugin + for i in `ls $WAI/vim/plugin`; do ln -s $WAI/vim/plugin/$i ./$i; done + + cd .. + if [ ! -d "./scripts" ]; then mkdir scripts; fi; + cd scripts + for i in `ls $WAI/vim/scripts`; do ln -s $WAI/vim/scripts/$i ./$i; done +} # }}} + +function deploy_ssh() +{ # {{{ + if [ ! -d "~/.ssh" ]; then mkdir .ssh/; fi; + cd ~/.ssh + ln -s $WAI/ssh/config ./ +} # }}} + +function deploy_mutt() +{ # {{{ + cd ~ + ln -s $WAI/mailcap ./.mailcap + + if [ ! -d "~/.mutt" ]; then mkdir ~/.mutt/; fi; + cd ~/.mutt + ln -s $WAI/mutt/muttrc ./ + ln -s $WAI/mutt/killsig ./ + ln -s $WAI/mutt/passwords.gpg ./ + ln -s $WAI/mutt/crypto ./ + ln -s $WAI/mutt/colors.test1 ./ + ln -s $WAI/mutt/colors.test2 ./ + ln -s $WAI/mutt/unlock-pass.sh ./ +} # }}} + + WAI=`pwd` - #simple files -cd ~/ +cd ~ ln -s $WAI/bashrc ./.bashrc -ln -s $WAI/vimrc ./.vimrc -ln -s $WAI/gitconfig ./.gitconfig -ln -s $WAI/xinitrc ./.xinitrc -ln -s $WAI/screenrc ./.screenrc -ln -s $WAI/octaverc ./.octaverc -ln -s $WAI/mailcap ./.mailcap -ln -s $WAI/chooseWP.sh ~/Pictures/wallpapers/chooseWP.sh - -#SSH -if [ ! -d "~/.ssh" ]; then mkdir .ssh/; fi; -cd ~/.ssh -ln -s $WAI/ssh/config ./ - -#MUTT -if [ ! -d "~/.mutt" ]; then mkdir ~/.mutt/; fi; -cd ~/.mutt -ln -s $WAI/mutt/muttrc ./ -ln -s $WAI/mutt/killsig ./ -ln -s $WAI/mutt/passwords.gpg ./ -ln -s $WAI/mutt/crypto ./ -ln -s $WAI/mutt/colors.test1 ./ -ln -s $WAI/mutt/colors.test2 ./ -ln -s $WAI/mutt/unlock-pass.sh ./ +deploy_for_desktop +deploy_vim +deploy_ssh +deploy_mutt -#VIM -if [ ! -d "~/.vim" ]; then mkdir ~/.vim/; fi; -cd ~/.vim -if [ ! -d "./colors" ]; then mkdir colors; fi; -cd colors -ln -s $WAI/vim/colors/wombat256modv1.vim ./wombat256modv1.vim - -cd .. -if [ ! -d "./skeletons" ]; then mkdir skeletons; fi; -cd skeletons -for i in `ls $WAI/vim/skeletons`; do ln -s $WAI/vim/skeletons/$i ./$i; done - -cd .. -if [ ! -d "./spell" ]; then mkdir spell; fi; -cd spell -for i in `ls $WAI/vim/spell`; do ln -s $WAI/vim/spell/$i ./$i; done - -cd .. -if [ ! -d "./plugin" ]; then mkdir plugin; fi; -cd plugin -for i in `ls $WAI/vim/plugin`; do ln -s $WAI/vim/plugin/$i ./$i; done cd ~ if [ -d "Programmation" ]; then mkdir Programmation; fi; cd ~/Programmation ln -s $WAI/git_auto_pull.sh ./git_auto_pull.sh -if [ ! -d "./Utils" ]; then mkdir Utils; fi; -cd ./Utils -ln -s $WAI/Utils/monitor.sh ./monitor.sh -ln -s $WAI/Utils/monitorOff.sh ./monitorOff.sh -ln -s $WAI/Utils/track.sh ./track.sh -ln -s $WAI/Utils/blink.sh ./blink.sh -ln -s $WAI/Utils/octopus.sh ./octopus.sh + + + +function deploy_directory() +{ # {{{ +# @arg1: dst directory +# @arg2: src directory + + if [ ! -d $1 ]; then mkdir $1; fi; + cd $1; + + for i in `ls $2`; do ln -s $2/$i ./$i; done + cd .. +} # }}} diff --git a/vim/scripts/doc.php.sh b/vim/scripts/doc.php.sh new file mode 100755 index 0000000..08607f3 --- /dev/null +++ b/vim/scripts/doc.php.sh @@ -0,0 +1,2 @@ +#!/bin/bash +firefox "http://www.php.net/$1" & diff --git a/vimrc b/vim/vimrc similarity index 94% rename from vimrc rename to vim/vimrc index 9c9d36f..1e9f35e 100644 --- a/vimrc +++ b/vim/vimrc @@ -5,6 +5,8 @@ "execute pathogen#infect() +map w +map W syntax on @@ -12,7 +14,7 @@ syntax on set spell "set nocompatible "fuck you !. impossible de backspace, sinon -"set backspace=indent,eol,start +set backspace=indent,eol,start "set ruler set number @@ -153,3 +155,10 @@ autocmd BufNewFile * " skeleton template use <+KEY+> nnoremap § /<+.\{-1,}+>c/+>/e inoremap § /<+.\{-1,}+>c/+>/e + + +au BufRead /dev/shm/mutt-* set tw=80 + +autocmd BufNewFile,BufRead *.py set keywordprg=pydoc +autocmd BufNewFile,BufRead *.php set keywordprg=~/.vim/scripts/doc.php.sh + diff --git a/xinitrc b/xinitrc index 2bda831..e56847c 100644 --- a/xinitrc +++ b/xinitrc @@ -13,7 +13,7 @@ fi #DWM -export PATH=~/Programmation/Utils/:$PATH +export PATH=~/.my_utils/:$PATH source ~/.bashrc