diff --git a/Bin/.directory b/Bin/.directory new file mode 100644 index 0000000..88256c7 --- /dev/null +++ b/Bin/.directory @@ -0,0 +1,4 @@ +[Dolphin] +Timestamp=2014,5,29,15,46,0 +Version=3 +ViewMode=2 diff --git a/Bin/lock.sh b/Bin/lock.sh new file mode 100755 index 0000000..210edc7 --- /dev/null +++ b/Bin/lock.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause +/opt/i3lock-fancy-multimonitor/lock diff --git a/Bin/rsync.sh b/Bin/rsync.sh new file mode 100755 index 0000000..ca15708 --- /dev/null +++ b/Bin/rsync.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# +# +# +# +# +# +# +# + +TYPE='' # usb / sshfs +CMD=rsync +ARGS='-avz --delete' +ORIG='/home/dbroqua/' +DEST='' +HOSTNAME=`hostname` + + +# USB +UUID='6e3f7ae3-8fa1-43f3-88c0-a12651519ffb' +MOUNT='/mnt/backup' +DEST_USB="/mnt/backup/${HOSTNAME}/dbroqua/" +# SSHFS +DEST_SSHFS="malpartida.mousur.org:Backup/${HOSTNAME}/dbroqua/" + +echo `date` > ${ORIG}/lastSync + +while getopts t:h opt +do + case $opt in + t) + case ${OPTARG} in + usb) + TYPE='usb' + DEST=${DEST_USB} + ;; + sshfs) + TYPE='sshfs' + DEST=${DEST_SSHFS} + ;; + *) + echo "usb / sshfs attendu" + exit 1; + esac + ;; + esac +done + +echo `date` > ${ORIG}/lastSync_${TYPE} + +if [ "${TYPE}" != '' ] ; then + case ${TYPE} in + usb) + sudo cryptsetup luksOpen /dev/sdb1 backup + sudo mount /dev/mapper/backup ${MOUNT} +# sudo umount ${MOUNT} +# sudo mount /dev/disk/by-uuid/${UUID} ${MOUNT} + echo "Go !" + if [ $? == 0 ] ; then + ${CMD} ${ARGS} ${ORIG} ${DEST} + fi +# sudo umount ${MOUNT} + sudo umount ${MOUNT} + sudo cryptsetup luksClose backup + ;; + sshfs) + ${CMD} ${ARGS} ${ORIG} ${DEST} + + ;; + esac +fi diff --git a/Bin/screen_layout.sh b/Bin/screen_layout.sh new file mode 100755 index 0000000..16a4bc8 --- /dev/null +++ b/Bin/screen_layout.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +activeconfig='hdmi' + +if [ -f ~/.screenlayout.info ] ; then + activeconfig=`cat ~/.screenlayout.info` +fi + +if [ ${activeconfig} == 'lvds1' ] ; then + ~/.screenlayout/dp.sh + echo dp > ~/.screenlayout.info +else + ~/.screenlayout/lvds1.sh + echo lvds1 > ~/.screenlayout.info +fi + +fbsetbg -a `tail -n 1 .fluxbox/lastwallpaper|cut -d'|' -f 2` diff --git a/Bin/timelapse.sh b/Bin/timelapse.sh new file mode 100755 index 0000000..75e7d62 --- /dev/null +++ b/Bin/timelapse.sh @@ -0,0 +1,8 @@ +#! /bin/bash + + +ls -1tr | grep -v files.txt > files.txt +mencoder -nosound -noskip -oac copy -ovc copy -o output.avi -mf fps=15 'mf://@files.txt' +ffmpeg -i output.avi -y -s hd1080 -sameq final.avi + +rm files.txt output.avi diff --git a/Bin/to_utf-8 b/Bin/to_utf-8 new file mode 100755 index 0000000..c82e1c6 --- /dev/null +++ b/Bin/to_utf-8 @@ -0,0 +1,6 @@ +#! /bin/bash + +for i in "*.${1}"; do + iconv -f iso-8859-15 -t utf-8 ${i} > ${i}.tmp + mv ${i}.tmp ${i} +done