Skip to content

Instantly share code, notes, and snippets.

@brownman
Last active January 4, 2016 08:58
Show Gist options
  • Select an option

  • Save brownman/8598580 to your computer and use it in GitHub Desktop.

Select an option

Save brownman/8598580 to your computer and use it in GitHub Desktop.
please update me guys !
#!/bin/bash
#http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/
dir_dropbox=~/Dropbox
dir_voices=$dir_dropbox/VOICES
if [ ! -d $dir_voices ];then
echo "can't locate your dropbox folder"
fi
action=${1-run}
author=$LOGNAME
signature=`echo $(($(date +%s%N)/1000000))`
let 'remember=0'
dependencies(){
sudo apt-get install gxmessage
}
show_dialog(){
local str=`gxmessage -file "$file" -title dropbox-voices-chat -timeout 10 -ontop -sticky -entry`
local file="$dir_voices/$signature.txt"
touch $file
echo "$author|$str" >> $file
}
loop(){
while true;do
sleep 10
echo 'checking for new files...'
#check the number of files in the directory
result=`du $dir_dropbox | cut -d'/' -f1`
if [ "$result" -gt "$remember" ];then
show_dialog
else
echo 'they just the same.. :('
fi
done
}
run(){
#change the keyboar-layout for adding a keyboard-hotkey/keyboard-shortcut
#i.g: alt+f2:/usr/bin/dropbox-voices.sh
show_dialog
}
#usr: run OR loop.
#run for add a message
#loop for periodicly check for new voices
$action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment