mirror of https://github.com/captn3m0/Scripts.git
Don't sync smlinks to hdd
This commit is contained in:
parent
2f12a3c70e
commit
38d25b2818
35
caps_lock.sh
35
caps_lock.sh
|
@ -1,9 +1,32 @@
|
|||
#!/bin/bash
|
||||
# We use bash to get variable variables to work
|
||||
# http://stackoverflow.com/questions/10757380/bash-variable-variables
|
||||
|
||||
# This script is called whenever I press the caps-lock.
|
||||
# The key-binding is managed by xbindkey
|
||||
command=`ps -p $(xdotool getactivewindow getwindowpid) -o command= -c`
|
||||
|
||||
# Constants
|
||||
DELAY=200
|
||||
SLEEP_DELAY=0.2 # Delay in milliseconds
|
||||
DOUBLE_TAP_SUFFIX="_double_tap"
|
||||
EPOCH=`date +%s%3N` # This is in milliseconds
|
||||
LOCK=/tmp/caps_lock_double_tap.lock
|
||||
source /home/nemo/projects/scripts/caps_lock.cfg
|
||||
|
||||
# Get the progam where caps lock was pressed
|
||||
program=`ps -p $(xdotool getactivewindow getwindowpid) -o command= -c`
|
||||
window=`xdotool getactivewindow`
|
||||
if [ "$command" = "chrome" ]; then
|
||||
xdotool key --window "$window" ctrl+l
|
||||
elif [ "$command" = "linuxdcpp" ]; then
|
||||
xdotool key --window "$window" ctrl+Tab
|
||||
fi
|
||||
|
||||
if [ -e $LOCK ]; then
|
||||
LASTTIME=`cat $LOCK`;
|
||||
if [ $EPOCH -le $(($LASTTIME + $DELAY)) ]; then
|
||||
program="$program$DOUBLE_TAP_SUFFIX"
|
||||
xdotool key --window "$window" ${!program}
|
||||
else
|
||||
# This is a single click
|
||||
sleep $SLEEP_DELAY
|
||||
|
||||
fi;
|
||||
fi
|
||||
|
||||
echo "$EPOCH" > $LOCK;
|
14
syncMedia
14
syncMedia
|
@ -2,10 +2,10 @@
|
|||
echo "Mounting Media via mount -a"
|
||||
sudo mount -a
|
||||
cd ~
|
||||
rsync -rv ./TV/ /media/nemo/Media/TV/ --size-only
|
||||
rsync -rv ./Downloads/ /media/nemo/Media/Downloads/ --size-only
|
||||
rsync -rv ./Music/ /media/nemo/Media/Music/ --size-only
|
||||
rsync -rv ./Setups/ /media/nemo/Media/Setups/ --size-only
|
||||
rsync -rv ./Videos/ /media/nemo/Media/Videos/ --size-only
|
||||
rsync -rv ./VirtualDrives/ /media/nemo/Media/VirtualDrives/ --size-only
|
||||
rsync -rv ./Movies/ /media/nemo/Media/Movies/ --size-only
|
||||
rsync -rv ./TV/ /media/nemo/Media/TV/ --size-only --no-links
|
||||
rsync -rv ./Downloads/ /media/nemo/Media/Downloads/ --size-only --no-links
|
||||
rsync -rv ./Music/ /media/nemo/Media/Music/ --size-only --no-links
|
||||
rsync -rv ./Setups/ /media/nemo/Media/Setups/ --size-only --no-links
|
||||
rsync -rv ./Videos/ /media/nemo/Media/Videos/ --size-only --no-links
|
||||
rsync -rv ./VirtualDrives/ /media/nemo/Media/VirtualDrives/ --size-only --no-links
|
||||
rsync -rv ./Movies/ /media/nemo/Media/Movies/ --size-only --no-links
|
||||
|
|
Loading…
Reference in New Issue