Skip to content

Instantly share code, notes, and snippets.

@dosssman
Last active October 5, 2019 04:31
Show Gist options
  • Select an option

  • Save dosssman/fad6ecd521b3aad767d6aaf1b4aae7a9 to your computer and use it in GitHub Desktop.

Select an option

Save dosssman/fad6ecd521b3aad767d6aaf1b4aae7a9 to your computer and use it in GitHub Desktop.

Revisions

  1. dosssman revised this gist Oct 5, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -46,6 +46,8 @@ CONFLINES+=("set -g @plugin 'tmux-plugins/tmux-resurrect'")

    # Tmux Continuum
    CONFLINES+=("set -g @plugin 'tmux-plugins/tmux-continuum'")
    # Tmux continuum enabling auto reset when tmux server is restart
    CONFLINES+=("set -g @continuum-restore 'on'")

    # Cloning Tmux Plugin Manager
    if [ -d ~/.tmux/plugins/tpm ]; then
  2. dosssman revised this gist May 24, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -57,7 +57,6 @@ echo

    # TPM Bottom file config
    CONFLINES+=("# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)")
    CONFLINES+=("run-shell ~/clone/path/resurrect.tmux")
    CONFLINES+=("run -b '~/.tmux/plugins/tpm/tpm'")

    echo "Writing to file: ${TMUXCONFFILE}"
  3. dosssman revised this gist May 23, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -57,6 +57,7 @@ echo

    # TPM Bottom file config
    CONFLINES+=("# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)")
    CONFLINES+=("run-shell ~/clone/path/resurrect.tmux")
    CONFLINES+=("run -b '~/.tmux/plugins/tpm/tpm'")

    echo "Writing to file: ${TMUXCONFFILE}"
  4. dosssman revised this gist Apr 23, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,10 @@ fi
    git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack
    echo

    # Enabling Mouse mode
    CONFILNES+=("# Enabling Mouse mode")
    CONFLINES+=("set -g mouse on")

    # Some basic plugins
    CONFLINES+=("# Some basic plugins ...")
    CONFLINES+=("set -g @plugin 'tmux-plugins/tpm'")
  5. dosssman revised this gist Apr 22, 2019. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -6,14 +6,14 @@ TMUXCONFFILE="$HOME""/.tmux.conf"

    if [ ! -z $1 ]; then
    echo "Custom tmux config file provided"
    TMUXCONFFILE=$1
    TMUXCONFFILE="$1"
    fi

    if [ -f $1 ]; then
    BAKDATE=$(date '+%Y-%m-%d_%H-%M-%S')
    BACKFILENAME="$1""__""${BAKDATE}"
    BACKFILENAME="${TMUXCONFFILE}""__""${BAKDATE}"
    echo "The config file seems to already exists, backing it up as""${BACKFILENAME}"
    mv "${TMUXCONFFILE}" "${BACKFILENAME}"
    mv ${TMUXCONFFILE} ${BACKFILENAME}
    echo
    fi

    @@ -24,7 +24,6 @@ if [ -d ~/.tmux-themepack ]; then
    rm -rf ~/.tmux-themepack
    fi
    git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack

    echo

    # Some basic plugins
    @@ -57,7 +56,6 @@ CONFLINES+=("# Initialize TMUX plugin manager (keep this line at the very bottom
    CONFLINES+=("run -b '~/.tmux/plugins/tpm/tpm'")

    echo "Writing to file: ${TMUXCONFFILE}"
    if [ ! -f $]
    for CONFLINE in "${CONFLINES[@]}"; do
    echo "$CONFLINE" >> $TMUXCONFFILE
    done
  6. dosssman revised this gist Apr 22, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Although it is put to the end, the lines coming before assume TPM is installed or
    # at least is to be

    TMUXCONFFILE= "$HOME""/.tmux.conf"
    TMUXCONFFILE="$HOME""/.tmux.conf"

    if [ ! -z $1 ]; then
    echo "Custom tmux config file provided"
  7. dosssman revised this gist Apr 22, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Although it is put to the end, the lines coming before assume TPM is installed or
    # at least is to be

    TMUXCONFFILE=~/.tmux.conf
    TMUXCONFFILE= "$HOME""/.tmux.conf"

    if [ ! -z $1 ]; then
    echo "Custom tmux config file provided"
    @@ -61,3 +61,7 @@ if [ ! -f $]
    for CONFLINE in "${CONFLINES[@]}"; do
    echo "$CONFLINE" >> $TMUXCONFFILE
    done

    echo "Sourcing the config file ..."
    tmux source $TMUXCONFFILE
    echo "done"
  8. dosssman revised this gist Apr 22, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # Although it is put to the end, the lines coming before assume TPM is installed or
    # at least is to be

    TMUXCONFFILE="~/.tmux.conf"
    TMUXCONFFILE=~/.tmux.conf

    if [ ! -z $1 ]; then
    echo "Custom tmux config file provided"
    @@ -57,6 +57,7 @@ CONFLINES+=("# Initialize TMUX plugin manager (keep this line at the very bottom
    CONFLINES+=("run -b '~/.tmux/plugins/tpm/tpm'")

    echo "Writing to file: ${TMUXCONFFILE}"
    if [ ! -f $]
    for CONFLINE in "${CONFLINES[@]}"; do
    echo "$CONFLINE" >> $TMUXCONFFILE
    done
  9. dosssman created this gist Apr 22, 2019.
    62 changes: 62 additions & 0 deletions tmuxautoconf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    #!/bin/bash
    # Although it is put to the end, the lines coming before assume TPM is installed or
    # at least is to be

    TMUXCONFFILE="~/.tmux.conf"

    if [ ! -z $1 ]; then
    echo "Custom tmux config file provided"
    TMUXCONFFILE=$1
    fi

    if [ -f $1 ]; then
    BAKDATE=$(date '+%Y-%m-%d_%H-%M-%S')
    BACKFILENAME="$1""__""${BAKDATE}"
    echo "The config file seems to already exists, backing it up as""${BACKFILENAME}"
    mv "${TMUXCONFFILE}" "${BACKFILENAME}"
    echo
    fi

    declare -a CONFLINES=()
    # Tmux Theme Packs
    if [ -d ~/.tmux-themepack ]; then
    echo "The Themepack files were detected on the system, proceeding to reclone"
    rm -rf ~/.tmux-themepack
    fi
    git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack

    echo

    # Some basic plugins
    CONFLINES+=("# Some basic plugins ...")
    CONFLINES+=("set -g @plugin 'tmux-plugins/tpm'")
    CONFLINES+=("set -g @plugin 'tmux-plugins/tmux-sensible'")

    # Theme pack config append to tmux conf file
    CONFLINES+=("# Tmux Themepack Block Cyan Profile")
    CONFLINES+=("set -g @plugin 'jimeh/tmux-themepack'")
    CONFLINES+=("set -g @themepack 'powerline/block/cyan'")

    # Tmux Resurect
    CONFLINES+=("# Tmux Resurrect and Continuum")
    CONFLINES+=("set -g @plugin 'tmux-plugins/tmux-resurrect'")

    # Tmux Continuum
    CONFLINES+=("set -g @plugin 'tmux-plugins/tmux-continuum'")

    # Cloning Tmux Plugin Manager
    if [ -d ~/.tmux/plugins/tpm ]; then
    echo "The TPM files were detected on the system, proceeding to reclone"
    rm -rf ~/.tmux/plugins/tpm
    fi
    git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
    echo

    # TPM Bottom file config
    CONFLINES+=("# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)")
    CONFLINES+=("run -b '~/.tmux/plugins/tpm/tpm'")

    echo "Writing to file: ${TMUXCONFFILE}"
    for CONFLINE in "${CONFLINES[@]}"; do
    echo "$CONFLINE" >> $TMUXCONFFILE
    done