diff --git a/.i3/config b/.i3/config index f14ed3e..e510f2a 100755 --- a/.i3/config +++ b/.i3/config @@ -67,11 +67,12 @@ bindsym $mod+XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle # m ## requires xbacklight -#bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness -#bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness +## Keyboard Backlighting +#/sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness + # change focus bindsym $mod+h focus left bindsym $mod+t focus down diff --git a/git/.gitconfig b/git/.gitconfig index 3761ba5..d8c4819 100755 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -8,7 +8,7 @@ [core] editor = vim [filter "lfs"] - required = true clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process + required = true diff --git a/install.sh b/install.sh index 61a4f51..e48487e 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,7 @@ ln -sfv ~/.vim/bundle/vimspectr/shell ~/.vimspectr-shell ln -sfv "$DOTFILES_DIR/run/.profile" ~ ln -sfv "$DOTFILES_DIR/run/.xprofile" ~ ln -sfv "$DOTFILES_DIR/run/.bashrc" ~ -ln -sfv "$DOTFILES_DIR/run/bruise" ~/apps/bruise +ln -sfv "$DOTFILES_DIR/system/.bruise" ~/apps/bruise ln -sfv "$DOTFILES_DIR/git/.gitconfig" ~ ln -sfv "$DOTFILES_DIR/system/.vimrc" ~ ln -sfv "$DOTFILES_DIR/system/.dir_colors" ~ diff --git a/run/.bashrc b/run/.bashrc index b743d7e..56818b0 100755 --- a/run/.bashrc +++ b/run/.bashrc @@ -21,7 +21,7 @@ fi # Finally we can source the dotfiles (order matters) -for DOTFILE in "$DOTFILES_DIR"/system/.{function,env,alias,prompt}; do +for DOTFILE in "$DOTFILES_DIR"/system/.{function,env,alias,prompt,bruise,lyrical-git_mask}; do [ -f "$DOTFILE" ] && . "$DOTFILE" done diff --git a/system/.alias b/system/.alias index 4618d33..658ec12 100755 --- a/system/.alias +++ b/system/.alias @@ -15,6 +15,7 @@ alias vp='vagrant provision' alias vssh='vagrant ssh' alias vd='vagrant destroy' alias vc='vagrant destroy && vagrant up --provision' +alias vh="for i in `vagrant global-status | awk '/running/ {print $5}'`; do cd $i && vagrant halt; done" ### Git alias git_clean='git fetch --all && git reset --hard origin/master' @@ -23,4 +24,4 @@ alias git_clean='git fetch --all && git reset --hard origin/master' alias vpn_lyrical='cd /home/ahosking/lyrical/vpn &&sudo openvpn --config gw-udp-1194-ahosking-vpn.ovpn' alias roles_fetch='r10k puppetfile install --puppetfile Puppetfile --moduledir ../../roles/' -alias roles_pull='for role in `ls ../../roles`; do echo "########" $role; echo `git -C ../../roles/$role pull`; done' +alias roles_pull='for role in `ls ../../roles`; do echo "########" $role; echo `git -C ../../roles/$role pull origin master`; done' diff --git a/run/bruise b/system/.bruise similarity index 100% rename from run/bruise rename to system/.bruise diff --git a/system/.lyrical-git_mask b/system/.lyrical-git_mask new file mode 100755 index 0000000..277a6e1 --- /dev/null +++ b/system/.lyrical-git_mask @@ -0,0 +1,49 @@ +#!/bin/bash + +declare -A user1=([name]='Alexander Hosking' [email]='alexander@ahosking.com') +declare -A user2=([name]='Kim Martin' [email]='kim@lyricalsecurity.com') +declare -A user3=([name]='Dillon Zhang' [email]='Dillon@lyricalsecurity.com') +declare -A user4=([name]='Pam Moire' [email]='pam@lyricalsecurity.com') +declare -A user5=([name]='Mitch Warren' [email]='mitch@lyricalsecurity.com') +declare -A user6=([name]='James Webster' [email]='james@lyricalsecurity.com') +declare -A user7=([name]='Caroline Marcoux' [email]='caroline@lyricalsecurity.com') +declare -A user8=([name]='Renato Streefkerk' [email]='renato@lyricalsecurity.com') + +users=(user1 user2 user3 user4 user5 user6 user7 user8) + +#echo $RANDO ## DEBUG +##Print the bits from the array index of random number + +function git_mask() { + if [ -z "$1" ] + then + RANDO=$(( ( RANDOM % ${#users[@]} ) )) ## Generate a random index from the users array + for arr_name in "${users[$RANDO]}"; do + declare -n arr_ref="$arr_name" + + printf "git config user.name \"%s\"\n" "${arr_ref[name]}" + printf "git config user.email \"%s\"\n" "${arr_ref[email]}" + set_username="git config user.name \"${arr_ref[name]}\" --replace-all" + eval $set_username + set_email="git config user.email \"${arr_ref[email]}\" --replace-all" + eval $set_email + + done + else + if [[ ! $1 =~ [0-9] ]] || ([[ $1 -gt ${#users[@]} ]] || [[ $1 -le 0 ]]); then + printf "Please enter a valid number from 1 to %s\n" "${#users[@]}" + else + user_id="$(($1 - 1))" + for arr_name in "${users[$user_id]}"; do + declare -n arr_ref="$arr_name" + + printf "Your git profile is now: \"%s\"\n" "${arr_ref[name]}" + set_username="git config user.name \"${arr_ref[name]}\" --replace-all" + eval $set_username + set_email="git config user.email \"${arr_ref[email]}\" --replace-all" + eval $set_email + + done + fi + fi +}