Jason Ryan avatar Jason Ryan committed 85af69f

Removed trailing spaces and tabs from scripts

Comments (0)

Files changed (17)

 set smartcase                           " uppercase causes case-sensitive search
 
 " listchars
+set list
 set listchars=trail:·,precedes:«,extends:»,eol:↲,tab:▸\ 
 
 " status bar info and appearance
 # Snippet lifted from absent: http://aur.archlinux.org/packages.php?ID=50669
 # add /usr/bin/abs to sudoers if you don't want the password prompt
 
-mag=$'\e[1;35m'  
-yel=$'\e[1;33m'  
+mag=$'\e[1;35m'
+yel=$'\e[1;33m'
 cyn=$'\e[1;36m'
 red=$'\e[1;31m'
-end=$'\e[0m'      
+end=$'\e[0m'
 searchdirs=("/var/abs/core" "/var/abs/extra" "/var/abs/community")
 
-for name in "$@"; do 
-    for repo in "${searchdirs[@]}"; do 
+for name in "$@"; do
+    for repo in "${searchdirs[@]}"; do
         if [[ ( -d ${repo}/${name} && -f ${repo}/${name}/PKGBUILD ) ]]; then
-        target="${repo}/${name}" 
+        target="${repo}/${name}"
         repos="${repo##*/}"
-        avers="$(awk -F= '/^pkg(v|r)/ {s=s (s?"-":"") $2} END {printf "%s", s}' <${target}/PKGBUILD)" 
-        pvers="$(awk '/Version/ {print $3}' <(pacman -Si ${name}))" 
+        avers="$(awk -F= '/^pkg(v|r)/ {s=s (s?"-":"") $2} END {printf "%s", s}' <${target}/PKGBUILD)"
+        pvers="$(awk '/Version/ {print $3}' <(pacman -Si ${name}))"
         ivers="$(awk '/Version/ {print $3}' <(pacman -Qi ${name} 2>/dev/null))"
 
-            # synchronize repo 
-            if [[ "$avers" < "$pvers" ]]; then 
-                sudo abs "${target##*s/}" 
+            # synchronize repo
+            if [[ "$avers" < "$pvers" ]]; then
+                sudo abs "${target##*s/}"
             fi
 
-            # print the current version details				
+            # print the current version details
             printf "%s\n%s\n" "${yel}${repos^} version${end}" "$pvers"
             printf "%s\n%s\n" "${mag}ABS version${end}" "$avers"
 
             # locally installed?
-            if [[ -n "$ivers" ]]; then 
-                printf "\n%s\n%s\n" "${cyn}Installed${end}" "$ivers" 
+            if [[ -n "$ivers" ]]; then
+                printf "\n%s\n%s\n" "${cyn}Installed${end}" "$ivers"
             else 
-                printf "\n%s\n" "${red}${name} not installed…${end}" 
-            fi 
-        fi 
-    done 
-done 
+                printf "\n%s\n" "${red}${name} not installed…${end}"
+            fi
+        fi
+    done
+done
 
 if [ -z "$lan" ]; then 
     printf "%s\n" "Not on home LAN; exiting…"
     exit 0
-fi  
+fi
 
 if [[ -d "$back" ]]; then
     printf "%s\n" "Already mounted..."
 
 printf "%s\n" "Beginning sync..."
 
-rsync -Cazs --stats "${dirs[@]}" "${back}" 
+rsync -Cazs --stats "${dirs[@]}" "${back}"
 
 sudo umount $HOME/Centurion
 
 myedit=$(echo $EDITOR)
 mybrowser=$(echo ${BROWSER##*/})
 
-                              
+
 # if X is running
 if [[ "$DISPLAY" ]]; then
     # check for running wm
     done
 
     myres=$(awk '/current/ {print $8,$9,+$10}' <(xrandr 2>/dev/null))
-    myfont=$(awk -F: '{print $3}' <(grep "^URxvt.font" .Xresources))
+    myfont=$(awk -F: '{print $3}' <(grep "^URxvt.font" ~/.Xresources))
     # screenshot command
     shot="scrot -cd5 ${machine}-$(date +%d%m%y).png"
 else
     myres="Framebuffer"
     wm="TTY"
-    myfont=$(awk -F\" '{print $2}' <(grep "^CONSOLEFONT" /etc/rc.conf))
+    myfont=$(awk -F\" '{print $2}' <(grep "^CONSOLEFONT" /etc/vconsole.conf))
     # screenshot command
     shot="fbgrab -s5 fbgrab.png"
 fi
 
 # ASCII goodness…
   cat <<EOF
-${lt}                 +      
-                 #             ${tx}Machine:${ec} ${machine}${lt}       
-                ###            ${tx}Architecture:${ec} ${arch}${lt} 
+${lt}                 +
+                 #             ${tx}Machine:${ec} ${machine}${lt}
+                ###            ${tx}Architecture:${ec} ${arch}${lt}
                #####           ${tx}Kernel:${ec} ${mykernel}${lt}
                ######          ${tx}CPU:${ec} ${mycpu}${lt}
               ; #####;         ${tx}Uptime:${ec} ${myuptime}${lt}
             +##########        ${tx}Window Manager:${ec} ${wm}${lt}
            #####${dk}######${lt}##;      ${tx}Shell:${ec} ${myshell^}${lt}
           ###${dk}############${lt}+     ${tx}Terminal:${ec} ${myterm^}${lt}
-         #${dk}######   #######     ${tx}Editor:${ec} ${myedit^}${dk}       
-       .######;     ;###;\`.    ${tx}Browser:${ec} ${mybrowser^}${dk} 
-      .#######;     ;#####.    ${tx}Font:${ec} ${myfont^}${dk} 
-      #########.   .########\`     
-     ######'           '######   
-    ;####                 ####;  
-    ##'                     '##  
-   #'                         \`# 
+         #${dk}######   #######     ${tx}Editor:${ec} ${myedit^}${dk}
+       .######;     ;###;\`.    ${tx}Browser:${ec} ${mybrowser^}${dk}
+      .#######;     ;#####.    ${tx}Font:${ec} ${myfont^}${dk}
+      #########.   .########\`
+     ######'           '######
+    ;####                 ####;
+    ##'                     '##
+   #'                         \`#
   '                            \`${ec}
- 
+
 EOF
 ${shot}

Scripts/autostart

 #!/bin/sh
 # autostart apps
-       
+
 tabbed -d >/tmp/tabbed.xid; vimprobable2 -e $(</tmp/tabbed.xid) &
 urxvtc -title "mutt" -e mutt &
 $HOME/Scripts/shux &
 full=$(<"${batt}"/charge_full)
 state=$(<"${batt}"/status)
 
-charge=$(( $current * 100 / $full )) 
+charge=$(( $current * 100 / $full ))
 
 
 case "${state}" in
 
     read -p "Remove Build directory? [Y/n]? " yn
     if [ "$yn" = "y" ]; then
-        printf "\n%s\n" "Removing build directory..." 
+        printf "\n%s\n" "Removing build directory..."
         rm -rf "$builddir"
     else
         printf "%s\n" "Build completed."
 target=$(awk '/media\/[\^A-Z]/ {print $3}' <(mount))
 
 checkbusy() {
-    grep "PID" <(lsof +D "$target") &>/dev/null
-    if [[ $? -eq 0 ]]; then 
-        printf "%s\n" "${target##*/} busy..."
+    grep "PID" <(lsof +d "$target") &>/dev/null
+    if [[ $? -eq 0 ]]; then
+        printf "%s\n" "${target##*/} busy…"
         exit 1
     fi
 }
 exstatus() {
     if [[ $? = 0 ]]; then
         printf "%s\n" "${target##*/} unmounted…"
-    else 
+    else
         printf "%s\n" "Failed to unmount."
     fi
 }

Scripts/dwm-start

 
 while true; do
 	dwm >/dev/null
-	# to log stderrors to a file 
+	# to log stderrors to a file
 	# dwm 2> ~/Build/dwm/dwm.log
-done 
+done
 

Scripts/dwm-status

 #!/bin/bash
 # Status script for dwm
-# colours: 01:normal 02:white 03:red 04:green 05:yellow 06:blue 
+# colours: 01:normal 02:white 03:red 04:green 05:yellow 06:blue
 # 07:cyan 08:magenta 09:grey
 
 music(){
 bat(){
     onl="$(grep "on-line" <(acpi -V))"
     charge="$(awk '{print +$4}' <(acpi -b))"
-    if [[ ( -z $onl && $charge -gt 20 ) ]]; then 
+    if [[ ( -z $onl && $charge -gt 20 ) ]]; then
         echo -e "BAT \x04$charge%\x01"
     elif [[ ( -z $onl && $charge -le 20 ) ]]; then
         echo -e "BAT \x03$charge%\x01"
 }
 
 mem(){
-	mem="$(awk '/^-/ {print $3}' <(free -m))"
-	echo -e "\x04$mem\x01"
+    mem="$(awk '/^-/ {print $3}' <(free -m))"
+    echo -e "\x04$mem\x01"
 }
 
 # CPU line courtesy Procyon:
 # https://bbs.archlinux.org/viewtopic.php?pid=874333#p874333
 cpu(){
-	read cpu a b c previdle rest < /proc/stat
-	prevtotal=$((a+b+c+previdle))
-	sleep 0.5
-	read cpu a b c idle rest < /proc/stat
-	total=$((a+b+c+idle))
-	cpu="$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))"
-	echo -e "\x05$cpu%\x01"
-	}
+    read cpu a b c previdle rest < /proc/stat
+    prevtotal=$((a+b+c+previdle))
+    sleep 0.5
+    read cpu a b c idle rest < /proc/stat
+    total=$((a+b+c+idle))
+    cpu="$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))"
+    echo -e "\x05$cpu%\x01"
+}
 
 hdd(){
     hd=( $(awk '
     drives="${#hd[@]}"
     if [[ "$drives" -eq 3 ]]; then
         echo -e "\x08${hd[@]}\x01"
-    else 
+    else
         echo -e "\x08${hd[@]:0:3} \x06${hd[@]:3:1}\x01"
     fi
 }
 
 eml(){
-	maildirs="$HOME/Mail/*/INBOX/new/"
-	ml="$(find $maildirs -type f | wc -l)"
-	if [[ $ml -eq 0 ]]; then
-		echo "0"
-	else
-		echo -en "\x03$ml\x01"
-	fi
+    maildirs="$HOME/Mail/*/INBOX/new/"
+    ml="$(find $maildirs -type f | wc -l)"
+    if [[ $ml -eq 0 ]]; then
+        echo "0"
+    else
+        echo -en "\x03$ml\x01"
+    fi
 }
 
 pac(){
-	pup="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
-	if [[ $pup -eq 0 ]]; then
-	    echo "0"
-	else
-	    echo -en "\x05$pup\x01"
-	fi
+    up="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
+    if [[ $pup -eq 0 ]]; then
+        echo "0"
+    else
+        echo -en "\x05$pup\x01"
+    fi
 }
 
 ups(){
 }
 
 aur(){
-     aur="$(awk '$0 !~ /^No /' /tmp/aurphans* | wc -l)"                                                                      
+     aur="$(awk '$0 !~ /^No /' /tmp/aurphans* | wc -l)"
      if [[ $aur -gt 0 ]]; then
         echo -en "\x03 ∆\x01"
      fi
 }
 
 int(){
-	host google.com>/dev/null &&   
+    host google.com>/dev/null &&
     echo -e "\x06ON\x01" || echo -e "\x03NO\x01"
 }
 
 dte(){
-	dte="$(date "+%I:%M")"
-	echo -e "\x02$dte\x01"
+    dte="$(date "+%I:%M")"
+    echo -e "\x02$dte\x01"
 }
 
 # Pipe to status bar

Scripts/highlights

 dir="$HOME/Sync/irssi/"
 
 while inotifywait -qqre attrib "$dir" >/dev/null 2>&1; do
-    echo "IRC:" "You have been pinged..." | dzen2 -p 5 
+    echo "IRC:" "You have been pinged..." | dzen2 -p 5
 done
 

Scripts/mailcheck

 maildirs="$HOME/Mail/*/INBOX/new/"
 ml="$(find $maildirs -type f | wc -l)"
 if [ $ml == 0 ]; then
-	echo "0"
+    echo "0"
 else
-	echo -en "$ml"
+    echo -en "$ml"
 fi

Scripts/proc-check

 #!/bin/bash
 # Check if app is running on starting X
 
-list=(dropbox highlights mpd mpdscribble syncapp xautolock)  
+list=(btsync dropbox highlights mpd mpdscribble xautolock)
 
 for app in "${list[@]}"; do
     check=$(ps -C "$app" -opid=)
     if [[ -z "$check" ]]; then
         case "$app" in
+             btsync) $HOME/Scripts/btsync
+                    ;;
             dropbox) /usr/bin/dropboxd &
                     ;;
-         highlights) $HOME/Scripts/highlights & 
+         highlights) $HOME/Scripts/highlights &
                     ;;
-                mpd) mpd $HOME/.mpd/mpd.conf 
+                mpd) mpd $HOME/.mpd/mpd.conf
                     ;;
-        mpdscribble) mpdscribble & 
-                    ;;
-            syncapp) $HOME/Scripts/syncapp 
+        mpdscribble) mpdscribble &
                     ;;
           xautolock) xautolock -time 8 -locker "slock" \
                      -nowlocker "slock" -detectsleep &
 #!/bin/bash
 # manage truecrypt containers using tcplay
-      
+
 user=jason
 cryptdev=Safebox
 cryptpath=/home/jason/Dropbox/"$cryptdev"
 if [[ "$1" == "open" ]]; then
   losetup "$loopdev" "$cryptpath"
   tcplay --map="$cryptdev" --device="$loopdev"
-    
+
   # read passphrase
   read -r -s passphrase <<EOF
   "$passphrase"
     is-enabled |  check status
     status     |  current state
     disable    |  do not load at boot
-    
+
     list       |  list all running services
     read       |  read the relevant service file
     fail       |  list failed services
 
 elif [[ $# -eq 2 ]] && [[ "$1" == "read" ]]; then
     less -FX /usr/lib/systemd/system/"$2".service
-    
+
 elif [[ $# -eq 2 ]]; then
     systemctl "$1" "$2".service
 fi
 
 if [[ $# -eq 1 ]]; then
-    
+
     case "$1" in
         list) systemctl list-units ;;
        fail*) systemctl --failed   ;;
 maildirs="/home/jason/Mail/*/INBOX/new/"
 
 find $maildirs -type f | wc -l
-                
 # heavy lifting by falconindy: https://bbs.archlinux.org/viewtopic.php?id=128585
 
 dirs=($HOME/.$1* $HOME/.$1/ $XDG_CONFIG_HOME/$1/)
-IFS=$'\n' 
+IFS=$'\n'
 read -r -d '' -a files < \
     <(find "${dirs[@]}" -type f \( \
            -name "*.conf" \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.