aboutsummaryrefslogtreecommitdiffstats
path: root/bin/atmux
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-05-08 20:22:16 +0200
committerDavid Runge <dave@sleepmap.de>2016-05-08 20:22:16 +0200
commit08845cec6393482a60493e465f0ba13727386f5b (patch)
tree8282cffd99ca2a12dfb3d34a7f82a28ac26d71b5 /bin/atmux
parent9cfb64c997b8e5f095c75f39641762f44d3307c2 (diff)
downloaddotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.gz
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.bz2
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.tar.xz
dotfiles-08845cec6393482a60493e465f0ba13727386f5b.zip
bin/set_volume: Making script not depend on functions.sh anymore. Introducing bash strict mode.
Diffstat (limited to 'bin/atmux')
-rwxr-xr-xbin/atmux122
1 files changed, 0 insertions, 122 deletions
diff --git a/bin/atmux b/bin/atmux
deleted file mode 100755
index 7601693..0000000
--- a/bin/atmux
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/bin/bash
-
-if [ -e $HOME/bin/functions.sh ]
-then
- . $HOME/bin/functions.sh
-else
- echo "functions.sh not found"
- exit 0
-fi
-
-# override tmux
-tmux='tmux'
-
-## CONFIGURATION
-# session name
-sn=${1:-atmux}
-
-# try to attach earlier session
-tmux attach-session -t $sn && exit 0
-#or continue
-
-# default path
-case $sn in
- # window definitions
- # path:command:custom-name
- "thesis")
- dpath=/home/konni/dropbox/documents/uni/12ss/BA/breite-quellen/thesis
- windows="-:-"
- windows+="matlab:echo bla"
- ;;
- "mako")
- dpath=/extra/src/cyanogenmod-10.1
- dcmd=". environment_mako"
- windows="-:-"
- windows+="-:-"
- windows+=" device/lge/mako:-"
- windows+=" out/target/product/mako:-"
- ;;
- "ville_dev")
- dpath=/extra/src/cyanogenmod-10.1
- dcmd=". environment_ville"
- windows="-:-"
- windows+=" -:-"
- windows+=" device/htc/ville:-"
- windows+=" device/htc/msm8960-common:-"
- windows+=" kernel/htc/msm8960:-"
- windows+=" vendor/htc:-"
- windows+=" out/target/product/ville:-"
- ;;
- "ville")
- dpath=/extra/src/cyanogenmod-jellybean
- dcmd=". environment_ville"
- windows="-:-"
- windows+=" -:-"
- windows+=" device/htc/ville:-"
- windows+=" device/htc/msm8960-common:-"
- windows+=" kernel/htc/msm8960:-"
- windows+=" vendor/htc:-"
- windows+=" out/target/product/ville:-"
- ;;
- *)
- dpath=$HOME
- windows="-:-"
-esac
-
-
-# enter default path
-mute pushd $dpath
-
-# prepare windows
-num=1
-for window in $windows
-do
- # parse configuration
- read wpath wcmd <<< $(echo $window | sed 's/:/\ /g')
-
- # set path
- unset tpath
- if [ $wpath != "-" ]
- then
- tpath=$wpath
- fi
-
-
- if [ $num -eq 1 ]
- then
- # start new session
- $tmux new-session -d -s "$sn" $tname
- # set default path for new windows
- $tmux set-option -t "$sn" default-path $dpath
- else
- # create new window in session
- $tmux new-window -t "$sn:$num" $tname
- fi
-
- # execute default command
- if [ -n "$dcmd" ]
- then
- $tmux send-keys -t "$n:$num" "$dcmd" C-m
- fi
-
- # change path
- if [ -n "$tpath" ]
- then
- $tmux send-keys -t "$n:$num" "cd $tpath" C-m
- fi
-
- # execute custom command
- unset tcmd
- if [ "$wcmd" != "-" ]
- then
- tcmd=$wcmd
- $tmux send-keys -t "$n:$num" "$tcmd" C-m
- fi
-
- let num=num+1
-done
-
-# select window #1 and attach to session
-$tmux select-window -t "$sn:1"
-$tmux attach-session -t "$sn"
-