-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_profile.sailfishos
49 lines (41 loc) · 1.77 KB
/
.bash_profile.sailfishos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# vim: ft=bash noet:
! declare 2>&1 | grep -wq ^colors= && [ $BASH_VERSINFO -ge 4 ] && source $initDir/.colors
test "$debug" -gt 0 && echo "=> Running $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal ..."
addpaths $HOME/jolla/bin $HOME/jolla/shl
test -n "$hostname" || declare -gxr hostname=$(hostname) # Pour SailFishOS
test -n "$system" || declare -gxr system=$(version | awk '{print $1" "$2" "$3}')
test -n "$domain" || declare -gxr domain=local
#blkid -o value -s UUID /dev/mmcblk1p1
SDMountPoint=$(df | awk '/ .media.sdcard/{print$NF}')
linkDestination=$(ls -l sdcard | awk '{print$NF}')
if [ "$SDMountPoint" ] && [ "$SDMountPoint" != "$linkDestination" ]
then
ln -svf "$SDMountPoint" ~/sdcard
fi
ls -ld --color ~/sdcard | awk /$LOGNAME/'{print$(NF-2)" "$(NF-1)" "$NF}'
echo
#export XDG_PICTURES_DIR="$HOME/sdcard/$USER/Pictures"
#xdg-user-dirs-update --set PICTURES ~/sdcard/nemo/Pictures
# User specific environment and startup programs
export MANPAGER="less -is"
#export HOMEBREW_TEMP=$HOME/tmp
if tty -s
then
syncCommand="rsync -vuth -P -rl"
test -r ~/.colors && Source ~/.colors
echo "$bold${colors[blue]}=> <$(basename ${BASH_SOURCE[0]})> : Syncing Android Pictures and Downloads to ~ ...$normal"
if mount | grep -q /android_storage
then
time $syncCommand --remove-source-files --exclude ".thumbdata*" ~/android_storage/DCIM/* ~/Pictures/
time $syncCommand --remove-source-files ~/android_storage/Download/* ~/Downloads/
sync
else
echo "$bold${colors[red]}=> INFO: android_storage is not mounted yet.$normal" >&2
fi
echo "$bold${colors[blue]}=> DONE.$normal"
echo
test -x ~/shl/sync2PC.sh && ~/shl/sync2PC.sh
test -x ~/shl/sync2SDCard.sh && ~/shl/sync2SDCard.sh
fi
set +x
test "$debug" -gt 0 && echo "=> END of $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal"