sldm and some bash things
This commit is contained in:
parent
d16425273d
commit
a0dc2c45ce
3 changed files with 41 additions and 4 deletions
27
Utils/sldm.sh
Executable file
27
Utils/sldm.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sldm - Super Lightweight Device Mounter
|
||||
|
||||
#TODO: FIXME and make me nicer
|
||||
|
||||
|
||||
devices=(/dev/sd??)
|
||||
dontwant=sda
|
||||
tomount=/media
|
||||
for device in ${devices[@]}; do
|
||||
|
||||
last=$(echo $device | awk -F/ '{print $NF}')
|
||||
|
||||
if [ "${device#*$dontwant}" == "$device" ]; then
|
||||
echo $device
|
||||
mount | grep $device > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "yop"
|
||||
pa=$tomount/$last
|
||||
mkdir -p $pa > /dev/null
|
||||
|
||||
mount $device $pa
|
||||
fi;
|
||||
echo $device
|
||||
fi;
|
||||
done;
|
16
bashrc
16
bashrc
|
@ -1,17 +1,21 @@
|
|||
shopt -s checkwinsize #Pour pas s'écrire dessus
|
||||
shopt -s histappend
|
||||
##shopt -s autocd #Like zsh
|
||||
PROMPT_COMMAND='history -a'
|
||||
|
||||
|
||||
#For autocompletions
|
||||
|
||||
function have() { return 1; } #Some files use have: suppress warnings (yeah: 2>.. )
|
||||
function _completion_loader() { return 1; }
|
||||
#function have() { return 1; } #Some files use have: suppress warnings (yeah: 2>.. )
|
||||
#function _completion_loader() { return 1; }
|
||||
#cd /usr/share/bash-completion/completions
|
||||
#for i in *; do source ./$i; done
|
||||
#unset have
|
||||
#unset _completion_loader
|
||||
|
||||
complete -cf sudo
|
||||
complete -cf man
|
||||
|
||||
|
||||
#####ON DEFINIT LES COULEURS
|
||||
red='\033[31m'
|
||||
|
@ -107,6 +111,7 @@ alias poule='git pull'
|
|||
alias makew='make'
|
||||
|
||||
alias BSI2='cd ~/Documents/UniGE/BSI2*/'
|
||||
alias BSI3='cd ~/Documents/UniGE/BSI3*/'
|
||||
|
||||
OCTOPUS=~/.my_utils/octopus.sh
|
||||
alias dual='$OCTOPUS monitor dual'
|
||||
|
@ -120,6 +125,7 @@ alias volmute='$OCTOPUS volume mute'
|
|||
alias suspend='$OCTOPUS suspend'
|
||||
|
||||
alias mfilms='cd /dev/shm && mkdir films && sshfs frank@vi-di.fr:/media/ films/'
|
||||
alias muni='cd /dev/shm && mkdir uni && sshfs villaro0@pc69240:/user/l1/2011/villaro0/ uni/'
|
||||
|
||||
alias upgrub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
|
||||
|
||||
|
@ -285,9 +291,13 @@ _RoRosetCompletion()
|
|||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _RoRosetCompletion -o filenames ro roset
|
||||
|
||||
function calc()
|
||||
{
|
||||
echo "scale=3;$@" | bc -l
|
||||
}
|
||||
|
||||
|
||||
# }}}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ host chuck
|
|||
port 1337
|
||||
|
||||
host pc69240
|
||||
hostname 2001:620:600:4400:214:4fff:fea8:6d3c
|
||||
user villaro0
|
||||
|
||||
host cuilxa
|
||||
hostname cuilxa.unige.ch
|
||||
|
|
Loading…
Reference in a new issue