From 411fc4073b2d4a51ab4a9d56dc592af89ebf43bd Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 23 Mar 2021 08:24:36 +0000 Subject: [PATCH 1/6] Recurse submodules with `git up` --- .gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 4efec5e..1ecc6ef 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,7 +21,7 @@ lgd = log -p --decorate history = log --pretty=oneline --abbrev-commit --all --graph --decorate tidy = !git remote prune origin && git fetch -p && 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 From 36a61d03ddbed0c096a91b884bbfa9ba2cd41e19 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 23 Mar 2021 08:35:14 +0000 Subject: [PATCH 2/6] Allow the use of ssh-agent connections --- .ssh/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ssh/config b/.ssh/config index b1efbd0..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 From b3b170b899d16ce33c127a9dd30356296045543e Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 2 May 2021 17:54:01 +0100 Subject: [PATCH 3/6] Remove vim plugins, config, etc. --- .gitmodules | 3 --- .vim/bundle/Vundle.vim | 1 - 2 files changed, 4 deletions(-) delete mode 160000 .vim/bundle/Vundle.vim 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/.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 From 304f92afcca0c127e433df49cba4970881420de4 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 2 May 2021 17:54:34 +0100 Subject: [PATCH 4/6] Remove vim plugins, config, etc. (2) --- .vimrc | 108 --------------------------------------------------------- 1 file changed, 108 deletions(-) diff --git a/.vimrc b/.vimrc index 53c5dba..8a332a2 100644 --- a/.vimrc +++ b/.vimrc @@ -7,42 +7,8 @@ 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 -let g:hybrid_use_Xresources = 1 -set background=dark -colorscheme hybrid - " Tabs and indents set tabstop=4 set shiftwidth=4 @@ -54,77 +20,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 From ddfeace6313ca2162ba82550f8d5a8ffa988ca41 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 2 May 2021 17:56:03 +0100 Subject: [PATCH 5/6] Remove vim plugins, config, etc. (3) --- bin/vim-upgrade | 8 -------- 1 file changed, 8 deletions(-) delete mode 100755 bin/vim-upgrade 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} From d0e5e2a23e2acabc34b8c3f591deb5eacf16688d Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sun, 2 May 2021 17:58:12 +0100 Subject: [PATCH 6/6] Add some useful scripts re: audio muting --- bin/mic-toggle.sh | 14 ++++++++++++++ bin/mute | 2 ++ bin/mutelock.sh | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 bin/mic-toggle.sh create mode 100755 bin/mutelock.sh 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