# HG changeset patch # User Meredith Howard # Date 1472595252 14400 # Node ID 7190350f2ab34fa650e5586487a7178503ef098f # Parent 45be44be97c5d41c725937b98d2fcce00bd4d172 reformat diff --git a/.i3/auto-start b/.i3/auto-start --- a/.i3/auto-start +++ b/.i3/auto-start @@ -1,70 +1,68 @@ -#! /bin/sh - +#!/bin/sh # Simple autostart file for i3-wm, you can execute it from i3 config with -# exec $HOME/bin/auto-start-for-i3 +# exec $HOME/.i3/auto-start # # xdotool and notify-send must be installed. On BSD use jot instead of # seq or install seq from ports. - # Max seconds to wait until the process is up MAXWAIT=10 # Start the given command and wait until it's visible StartProg() { - "$@" & # Handle arguments with whitspaces - mypid=$! # Pid of last background process - echo "Waiting on ${mypid}: $@" - for i in `seq $MAXWAIT` # count from 1 to MAXWAIT - do - if xdotool search --onlyvisible --pid $mypid; then - return 0 - fi - sleep 1 - done - notify-send "Error on executing: $@" + "$@" & # Handle arguments with whitspaces + mypid=$! # Pid of last background process + echo "Waiting on ${mypid}: $@" + for i in `seq $MAXWAIT` # count from 1 to MAXWAIT + do + if xdotool search --onlyvisible --pid $mypid; then + return 0 + fi + sleep 1 + done + notify-send "Error on executing: $@" } StartProgName() { - "$@" & # Handle arguments with whitspaces - mypid=$! # Pid of last background process - echo "Waiting on $1: $@" - for i in `seq $MAXWAIT` # count from 1 to MAXWAIT - do - if xdotool search --onlyvisible --name $1; then - return 0 - fi - sleep 1 - done - notify-send "Error on executing: $@" + "$@" & # Handle arguments with whitspaces + mypid=$! # Pid of last background process + echo "Waiting on $1: $@" + for i in `seq $MAXWAIT` # count from 1 to MAXWAIT + do + if xdotool search --onlyvisible --name $1; then + return 0 + fi + sleep 1 + done + notify-send "Error on executing: $@" } WaitProgName() { - echo "Waiting on $1" - for i in `seq $MAXWAIT` # count from 1 to MAXWAIT - do - if xdotool search --onlyvisible --name $1; then - return 0 - fi - sleep 1 - done - notify-send "Error waiting on $1: $@" + echo "Waiting on $1" + for i in `seq $MAXWAIT` # count from 1 to MAXWAIT + do + if xdotool search --onlyvisible --name $1; then + return 0 + fi + sleep 1 + done + notify-send "Error waiting on $1: $@" } WaitClassName() { - echo "Waiting on window class $1" - for i in `seq $MAXWAIT` # count from 1 to MAXWAIT - do - if xdotool search --onlyvisible --class $1; then - return 0 - fi - sleep 1 - done - notify-send "Error waiting on $1: $@" + echo "Waiting on window class $1" + for i in `seq $MAXWAIT` # count from 1 to MAXWAIT + do + if xdotool search --onlyvisible --class $1; then + return 0 + fi + sleep 1 + done + notify-send "Error waiting on $1: $@" }