diff --git a/.gitconfig b/.gitconfig index c9567d7..7b4c51e 100644 --- a/.gitconfig +++ b/.gitconfig @@ -22,7 +22,7 @@ lgd = log -p --decorate history = log --pretty=oneline --abbrev-commit --all --graph --decorate tidy = !git remote prune origin && git fetch -pPt && git branch -vv | awk '/: gone]/ {print $1}' | xargs -r git branch -D - update = !git pull && git tidy + update = !git pull --recurse-submodules && git tidy st = status ci = commit co = checkout diff --git a/.gitmodules b/.gitmodules index 7cdc133..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule ".vim/bundle/Vundle.vim"] - path = .vim/bundle/Vundle.vim - url = https://github.com/gmarik/Vundle.vim.git diff --git a/.ssh/config b/.ssh/config index de1695f..d1b61d6 100644 --- a/.ssh/config +++ b/.ssh/config @@ -3,6 +3,6 @@ Include config.d/* Host * ServerAliveInterval 120 ServerAliveCountMax 3 - #IdentitiesOnly yes + # IdentitiesOnly yes ForwardAgent yes diff --git a/.vim/bundle/Vundle.vim b/.vim/bundle/Vundle.vim deleted file mode 160000 index b255382..0000000 --- a/.vim/bundle/Vundle.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b255382d6242d7ea3877bf059d2934125e0c4d95 diff --git a/.vimrc b/.vimrc index 77b11c6..99fbfc1 100644 --- a/.vimrc +++ b/.vimrc @@ -7,35 +7,6 @@ set vb " Enable modeline in files set modeline -" Ensure vim knows about Go(lang) -set rtp+=$GOROOT/misc/vim - -" set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() - -" Plugins -Plugin 'VundleVim/Vundle.vim' -Plugin 'tpope/vim-fugitive' -Plugin 'tpope/vim-commentary' -Plugin 'tpope/vim-surround' -Plugin 'scrooloose/syntastic' -Plugin 'scrooloose/nerdtree' -Plugin 'itchyny/lightline.vim' -Plugin 'w0ng/vim-hybrid' -Plugin 'cocopon/lightline-hybrid.vim' -Plugin 'Shougo/neocomplcache.vim' -Plugin 'kien/ctrlp.vim' -Plugin 'rodjek/vim-puppet' -Plugin 'godlygeek/tabular' -Plugin 'ap/vim-buftabline' -Plugin 'vim-scripts/WhiteWash' -Plugin 'jistr/vim-nerdtree-tabs' -Plugin 'davidhalter/jedi' -Plugin 'plasticboy/vim-markdown' - -" All of your Plugins must be added before the following line -call vundle#end() " required filetype plugin indent on " required " Hybrid color scheme @@ -54,77 +25,3 @@ set diffopt+=vertical " Syntax highlighting syntax on - -" NERDTree -map :NERDTreeToggle - -" Autocomplete -let g:neocomplcache_enable_at_startup = 1 - -" Disable Markdown folding -let g:vim_markdown_folding_disabled = 1 - -" Set filetypes -au BufRead,BufNewFile *.md set filetype=markdown -au BufRead,BufNewFile *.go set filetype=go - -" Lightline -set laststatus=2 -let g:lightline = { - \ 'colorscheme': 'hybrid', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ] - \ }, - \ 'component_function': { - \ 'fugitive': 'LightLineFugitive', - \ 'readonly': 'LightLineReadonly', - \ 'modified': 'LightLineModified', - \ 'filename': 'LightLineFilename' - \ }, - \ 'mode_map': { - \ 'n' : 'N', - \ 'i' : 'I', - \ 'R' : 'R', - \ 'v' : 'V', - \ 'V' : 'V-L', - \ "\": 'V-B', - \ 'c' : 'C', - \ 's' : 'S', - \ 'S' : 'S-L', - \ "\": 'S-B', - \ '?': ' ' - \ }, - \ 'separator': { 'left': '', 'right': '' }, - \ 'subseparator': { 'left': '>', 'right': '<' } - \ } - -function! LightLineModified() - if &filetype == "help" - return "" - elseif &modified - return "+" - elseif &modifiable - return "" - else - return "" - endif -endfunction - -function! LightLineReadonly() - if &filetype == "help" - return "" - elseif &readonly - return "!" - else - return "" - endif -endfunction - -function! LightLineFugitive() - if exists("*fugitive#head") - let _ = fugitive#head() - return strlen(_) ? 'git:'._ : '' - endif - return '' -endfunction diff --git a/bin/mic-toggle.sh b/bin/mic-toggle.sh new file mode 100755 index 0000000..b05d987 --- /dev/null +++ b/bin/mic-toggle.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +CARD='C920' + +declare -A ICONS=([on]=microphone-sensitivity-high [off]=microphone-sensitivity-muted) + +# Toggle the mic +amixer -c ${CARD} sset Mic mute toggle + +# Grab the state +STATE=$(amixer -c ${CARD} cget name='Mic Capture Switch' | grep -F ': values=' | cut -f2 -d=) + +# Notify +notify-send -t 3000 "${CARD} Mic" ${STATE^^} -i ${ICONS[${STATE}]} diff --git a/bin/mute b/bin/mute index 019be0b..798ae3b 100755 --- a/bin/mute +++ b/bin/mute @@ -3,4 +3,6 @@ case $(uname -s) in Darwin) osascript -e "set volume output volume 0" ;; + Linux) pactl set-sink-mute @DEFAULT_SINK@ on + ;; esac diff --git a/bin/mutelock.sh b/bin/mutelock.sh new file mode 100755 index 0000000..52a18d6 --- /dev/null +++ b/bin/mutelock.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Credit for code: + #https://unix.stackexchange.com/users/14353/cliff-stanford + #https://unix.stackexchange.com/users/231160/nik-gnomic +# Post on stackexchange: https://unix.stackexchange.com/questions/467456/how-to-mute-sound-when-xscreensaver-locks-screen/589614#589614 + +gdbus monitor -e -d org.xfce.ScreenSaver | grep ActiveChanged --line-buffered | + while read line + do + case "$line" in + *"(true,)"*) + pactl set-sink-mute @DEFAULT_SINK@ on + ;; + *"(false,)"*) + pactl set-sink-mute @DEFAULT_SINK@ off + ;; + esac + done +exit diff --git a/bin/vim-upgrade b/bin/vim-upgrade deleted file mode 100755 index a990acb..0000000 --- a/bin/vim-upgrade +++ /dev/null @@ -1,8 +0,0 @@ -UPDATE_FILE=~/.vim/updated - -[ -f ${UPDATE_FILE} ] || touch -t 197001010000 ${UPDATE_FILE} - -find ${UPDATE_FILE} -mtime +0 -exec bash -c "\ - vim +PluginInstall! +PluginClean! +qall -" \; -touch ${UPDATE_FILE}