From 1d888bdf631c76208eae557bc13c402d36e31533 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 25 May 2017 10:26:40 +0100 Subject: [PATCH 001/116] Docker: Kill and remove all container arguments --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index e9602ae..b108694 100644 --- a/aliases +++ b/aliases @@ -148,7 +148,7 @@ alias dbl='docker build --pull' alias dbl.='docker build --pull .' alias drun='docker run -ti' alias dkl='docker kill' -dklrm() { docker kill $1 ; docker rm $1 } +dklrm() { docker kill $@ ; docker rm $@ } alias dst='docker stop' alias drst='docker restart' alias dnet='docker network' From 91a5334c07f339f66ece9051ffff682c896e81f0 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 25 May 2017 10:27:50 +0100 Subject: [PATCH 002/116] Increase terminal padding --- .config/gtk-3.0/gtk.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/gtk-3.0/gtk.css b/.config/gtk-3.0/gtk.css index e21c045..e3723eb 100644 --- a/.config/gtk-3.0/gtk.css +++ b/.config/gtk-3.0/gtk.css @@ -1,5 +1,5 @@ VteTerminal, TerminalScreen, vte-terminal { - padding: 4px; + padding: 6px; } From 71752bbbd0af3c8f550bcbb0fc004648b03b9cb1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 25 May 2017 10:28:11 +0100 Subject: [PATCH 003/116] Use ipify.org for public IP tracking --- .config/i3/blocks/iface | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/blocks/iface b/.config/i3/blocks/iface index 48e672e..4b49830 100755 --- a/.config/i3/blocks/iface +++ b/.config/i3/blocks/iface @@ -51,6 +51,6 @@ LOCIP=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$ #------------------------------------------------------------------------ case $BLOCK_BUTTON in - 1) echo $(curl -s http://whatismijnip.nl | cut -d " " -f 5);; + 1) curl -s https://api.ipify.org;; *) echo "$LOCIP";; esac From 818f12d374966c74347a52182db35f0e30ca7acc Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 25 May 2017 10:29:17 +0100 Subject: [PATCH 004/116] Remove globcomplete from zsh options --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index d3fe10c..b37fa62 100644 --- a/.zshrc +++ b/.zshrc @@ -15,7 +15,7 @@ mkdir -p $ZSH_CACHE_DIR $ZSH_CONFIG_DIR HISTFILE=$ZSH_CONFIG_DIR/histfile HISTSIZE=100000 SAVEHIST=100000 -setopt sharehistory histignoredups histignorespace histreduceblanks autocd autopushd extendedglob globcomplete alwaystoend dvorak +setopt sharehistory histignoredups histignorespace histreduceblanks autocd autopushd extendedglob alwaystoend dvorak export WORDCHARS='*?_[]~=&;!#$%^(){}' From 7281fcdf41c48b5698494085cb9cbb922795db11 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 10 Jun 2017 12:26:14 +0100 Subject: [PATCH 005/116] Float pop-up windows in i3 --- .config/i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3/config b/.config/i3/config index 5053f1c..e902a61 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -133,6 +133,7 @@ bar { for_window [class="Pavucontrol"] floating enable for_window [class="Blueman-manager"] floating enable for_window [window_role="floating-term"] floating enable +for_window [window_role="pop-up"] floating enable for_window [window_role="i3blocks-update-term"] floating enable for_window [window_role="i3blocks-clock-term"] floating enable for_window [title="rofi"] floating enable From 33fb51714d49f5da7b02ed783f123a16338c809d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 9 Jul 2017 00:09:12 +0100 Subject: [PATCH 006/116] Fix dbus user-session and gnome-keyring on boot --- .profile | 10 +++++----- .xinitrc | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.profile b/.profile index 3e7105e..e7d733f 100644 --- a/.profile +++ b/.profile @@ -22,9 +22,9 @@ if ! [ -z $DISPLAY ] && which autocutsel &>/dev/null; then autocutsel -selection PRIMARY -fork & fi -# Start an ssh-agent -if [ -z $SSH_AUTH_SOCK ]; then - eval `ssh-agent` +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then + eval $(dbus-launch --sh-syntax --exit-with-session) + dbus-update-activation-environment --systemd DISPLAY + export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) + export SSH_AUTH_SOCK fi -# Always add SSH key to the running agent; local or remote -ssh-add diff --git a/.xinitrc b/.xinitrc index e6f775b..a149acb 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,9 +1,5 @@ #!/bin/sh -source ~/.profile -source ~/.xsession -xrdb -merge ~/.Xresources - # Run all system xinitrc shell scripts xinitdir="/etc/X11/xinit/xinitrc.d" if [ -d "$xinitdir" ]; then @@ -15,4 +11,8 @@ if [ -d "$xinitdir" ]; then done fi +source ~/.profile +source ~/.xsession +xrdb -merge ~/.Xresources + exec i3 From 52b80611c5b96c27fd3ac45138e5ad13b043b7e3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 9 Jul 2017 00:10:54 +0100 Subject: [PATCH 007/116] Change systemctl alias to always sudo --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index b108694..b0bc66b 100644 --- a/aliases +++ b/aliases @@ -57,7 +57,7 @@ alias tree='tree --dirsfirst -C -F' alias dd='dd status=progress' # System aliases -alias s=systemctl +alias s="sudo systemctl" alias j=journalctl alias p=pacaur alias ps='ps aux' From 4e03da05dc131db22e0a52ba61d445d63c45b790 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 14 Jul 2017 14:15:48 +0100 Subject: [PATCH 008/116] Fix YouCompleteMe installation on Arch --- scripts/vim-setup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/vim-setup b/scripts/vim-setup index 668c0eb..0bad681 100755 --- a/scripts/vim-setup +++ b/scripts/vim-setup @@ -1,13 +1,13 @@ YCM=~/.vim/bundle/YouCompleteMe -sudo pacman -S python cmake --needed --noconfirm +sudo pacman -S python cmake clang --needed --noconfirm ####################### ## Initialise Vundle ## ####################### mkdir -p ~/.vim/{bundle,swapfiles} git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -vim +PluginInstall +qall +vim +PluginUpdate +qall ######################### @@ -15,4 +15,4 @@ vim +PluginInstall +qall ######################### cd "$YCM" git submodule update --init --recursive -./install.py --clang-completer +./install.py --system-libclang --clang-completer From eddd8e5f27e4ccdf594ffa1ed767f0223b9234c9 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:32:22 +0100 Subject: [PATCH 009/116] Improve dsh and drsh functions --- aliases | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/aliases b/aliases index b0bc66b..f3cd32d 100644 --- a/aliases +++ b/aliases @@ -157,9 +157,14 @@ alias dlg='docker logs -f' alias dalpine='docker run -ti --rm alpine /bin/sh' alias drm-stopped='docker container prune' alias drmi-untag='docker image prune' -alias dsh='_dsh exec' -alias drsh='_dsh "run --rm"' +alias dsh='_CMD=dsh _dsh exec' +alias drsh='_CMD=drsh _dsh "run --rm"' _dsh() { + if [ $# -lt 2 ]; then + echo "Usage: ${_CMD:-$0} [user@]container [program [args]]" >&2 + return 64 + fi + local dowhat="$1" local user=$(echo "$2" | cut -d'@' -f1 -s) local prog="${@:3:$#}" @@ -171,7 +176,27 @@ _dsh() { usercmd="--user=$user " fi - eval "docker $dowhat -ti $usercmd$host ${prog:-"/bin/sh"}" + if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" ]; then + echo "No such container $host" >&2 + return 5 + fi + + if [ -z "$prog" ]; then + set -o pipefail + for shell in bash sh; do + if shell_path="$(eval "docker $dowhat -ti $host which $shell" | sed 's|[\r\n]||g')"; then + prog="$shell_path" + break + fi + done + set +o pipefail + if [ -z "$prog" ]; then + echo "Warning: No shell found in path.. trying /bin/sh" >&2 + prog=/bin/sh + fi + fi + + eval "docker $dowhat -ti $usercmd$host $prog" } alias dm='docker-machine' From 3460a96b755961ea6d16cb63d68e996333b8d55b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:34:35 +0100 Subject: [PATCH 010/116] Always update repositories before installing packages --- scripts/vim-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vim-setup b/scripts/vim-setup index 0bad681..2810569 100755 --- a/scripts/vim-setup +++ b/scripts/vim-setup @@ -1,6 +1,6 @@ YCM=~/.vim/bundle/YouCompleteMe -sudo pacman -S python cmake clang --needed --noconfirm +sudo pacman -Sy python cmake clang --needed --noconfirm ####################### ## Initialise Vundle ## From d0c9bccf17ac800616dd43553feb946a9ff898c9 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:36:22 +0100 Subject: [PATCH 011/116] Reduce mouse functionality in Vim --- .vimrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index ef7c5a6..d402d31 100644 --- a/.vimrc +++ b/.vimrc @@ -8,11 +8,14 @@ set expandtab set number set autoindent set laststatus=2 -set mouse=a +set mouse=nicr set encoding=utf-8 set background=dark set directory=$HOME/.vim/swapfiles// +"nnoremap +"nnoremap + " GVim settings set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= From 3069bea815581ada52ba1884f86cafb939cc9d86 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:37:41 +0100 Subject: [PATCH 012/116] Remove legacy Qt-GTK theme linking --- .config/Trolltech.conf | 2 -- .profile | 1 - 2 files changed, 3 deletions(-) delete mode 100644 .config/Trolltech.conf diff --git a/.config/Trolltech.conf b/.config/Trolltech.conf deleted file mode 100644 index e148896..0000000 --- a/.config/Trolltech.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Qt] -style=GTK+ diff --git a/.profile b/.profile index e7d733f..1e4cd6b 100644 --- a/.profile +++ b/.profile @@ -13,7 +13,6 @@ export PAGER="less -R" export TERMINAL="termite" export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" -export QT_STYLE_OVERRIDE=GTK+ export QT_QPA_PLATFORMTHEME=gtk2 # Merge system clipboards From 5cb8859031f769b82c826bd6f609aebce908e317 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:39:52 +0100 Subject: [PATCH 013/116] Improve system-wide emoji support with 'Noto Color Emoji' font --- .config/fontconfig/fonts.conf | 53 +++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 612be53..02cb4ed 100644 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -1,24 +1,41 @@ - - serif - - Noto Serif - - - - sans-serif - - Noto Sans - - - - monospace - - Sauce Code Pro - - + + + sans-serif + + + Noto Sans + Noto Color Emoji + + + + + serif + + + Noto Serif + Noto Color Emoji + + + + + monospace + + + Sauce Code Pro + Noto Color Emoji + + + + + Apple Color Emoji + + + Noto Color Emoji + + hintfull From 115e60681d2637637ac4efdf1c6b9ef1ff14470d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 15 Jul 2017 13:40:16 +0100 Subject: [PATCH 014/116] Simplify user-dirs in $HOME --- .config/user-dirs.dirs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 86e9778..aa1e19d 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -5,11 +5,11 @@ # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # -XDG_DESKTOP_DIR="$HOME/desktop" +XDG_DESKTOP_DIR="$HOME/documents" XDG_DOCUMENTS_DIR="$HOME/documents" XDG_DOWNLOAD_DIR="$HOME/downloads" XDG_MUSIC_DIR="$HOME/music" XDG_PICTURES_DIR="$HOME/pictures" XDG_VIDEOS_DIR="$HOME/music" XDG_PUBLICSHARE_DIR="$HOME" -XDG_TEMPLATES_DIR="$HOME/" +XDG_TEMPLATES_DIR="$HOME" From 70dc02c7a1b86916df0fb87cb1e4fdb35104f3d1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 16 Jul 2017 01:51:28 +0100 Subject: [PATCH 015/116] Improve dsh and drsh argument parsing --- aliases | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/aliases b/aliases index f3cd32d..6fe79a9 100644 --- a/aliases +++ b/aliases @@ -158,7 +158,7 @@ alias dalpine='docker run -ti --rm alpine /bin/sh' alias drm-stopped='docker container prune' alias drmi-untag='docker image prune' alias dsh='_CMD=dsh _dsh exec' -alias drsh='_CMD=drsh _dsh "run --rm"' +alias drsh='_CMD=drsh _dsh run --rm' _dsh() { if [ $# -lt 2 ]; then echo "Usage: ${_CMD:-$0} [user@]container [program [args]]" >&2 @@ -166,13 +166,21 @@ _dsh() { fi local dowhat="$1" - local user=$(echo "$2" | cut -d'@' -f1 -s) - local prog="${@:3:$#}" + local docker_args=() + shift + + while [ "${1:0:1}" = '-' ]; do + docker_args+=("$1") + shift + done + + local user="$(echo "$1" | cut -d'@' -f1 -s)" + local prog="${@:2:$#}" local usercmd="" if [ -z "$user" ]; then - host="$2" + host="$1" else - host=`echo $2 | cut -d'@' -f2 -s` + host=`echo $1 | cut -d'@' -f2 -s` usercmd="--user=$user " fi @@ -196,7 +204,7 @@ _dsh() { fi fi - eval "docker $dowhat -ti $usercmd$host $prog" + docker $dowhat ${docker_args[@]} -ti $usercmd $host $(xargs <<< $prog) } alias dm='docker-machine' From d84371108ccda482d40c96afba444607090c9617 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 16 Jul 2017 01:52:19 +0100 Subject: [PATCH 016/116] Prevent history-search returning duplicates --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index b37fa62..5d12551 100644 --- a/.zshrc +++ b/.zshrc @@ -54,6 +54,7 @@ source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) +setopt HIST_IGNORE_ALL_DUPS ZSH_HIGHLIGHT_STYLES[default]='fg=blue' ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' From 683d1b873f9a5b534eed82e0c6af6c1263d25d8d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 24 Aug 2017 14:52:09 +0100 Subject: [PATCH 017/116] Fix for GPG pinentry acting as a normal window --- .config/i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3/config b/.config/i3/config index e902a61..78bb31a 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -130,6 +130,7 @@ bar { } # Window rules +for_window [class="Pinentry"] floating enable for_window [class="Pavucontrol"] floating enable for_window [class="Blueman-manager"] floating enable for_window [window_role="floating-term"] floating enable From 64d9feaa81c02c6d73be7836bcaca8636c798c33 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 24 Aug 2017 14:53:30 +0100 Subject: [PATCH 018/116] Rearrange display outputs --- .config/i3/config | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 78bb31a..18f6f4d 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -45,11 +45,10 @@ bindsym $mod+a focus parent bindsym $mod+o focus child # Screen configs # -set $tl "DP-0.2.1" -set $tr "DP-0.2.2.1" -set $bl "DP-0.1" -set $br "DP-0.2.2.2.1" -#set $br "DVI-D-0" +set $bl "DVI-D-0" +set $tl "HDMI-0" +set $br "DP-2.1" +set $tr "DP-2.2.1" # Workspace -> Screen workspace 1 output $bl @@ -116,8 +115,9 @@ bar { tray_padding 4 height 24 - #output $br - position top + output $bl + output $br + position bottom colors { separator #757575 From 4ce968227195ef98e2b2caaabeba59be1dae7471 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 24 Aug 2017 14:53:48 +0100 Subject: [PATCH 019/116] Match exactly on 'rofi' floating rule --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index 18f6f4d..c32ec66 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -137,7 +137,7 @@ for_window [window_role="floating-term"] floating enable for_window [window_role="pop-up"] floating enable for_window [window_role="i3blocks-update-term"] floating enable for_window [window_role="i3blocks-clock-term"] floating enable -for_window [title="rofi"] floating enable +for_window [title="^rofi$"] floating enable new_window pixel 5 new_float none From 35226c70f4ff0e043f9dc9efbcf5c9b4f352cf47 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:36:11 +0100 Subject: [PATCH 020/116] Add docker cleanup dprune alias --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index 6fe79a9..949cc9d 100644 --- a/aliases +++ b/aliases @@ -157,6 +157,7 @@ alias dlg='docker logs -f' alias dalpine='docker run -ti --rm alpine /bin/sh' alias drm-stopped='docker container prune' alias drmi-untag='docker image prune' +alias dprune='docker system prune -f' alias dsh='_CMD=dsh _dsh exec' alias drsh='_CMD=drsh _dsh run --rm' _dsh() { From c4623a86221b56b004d516384bddcdf5a43178a1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:37:17 +0100 Subject: [PATCH 021/116] Ensure drsh starts a shell by overwriting entrypoint --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index 949cc9d..e53b03e 100644 --- a/aliases +++ b/aliases @@ -159,7 +159,7 @@ alias drm-stopped='docker container prune' alias drmi-untag='docker image prune' alias dprune='docker system prune -f' alias dsh='_CMD=dsh _dsh exec' -alias drsh='_CMD=drsh _dsh run --rm' +alias drsh='_CMD=drsh _dsh run --rm --entrypoint=' _dsh() { if [ $# -lt 2 ]; then echo "Usage: ${_CMD:-$0} [user@]container [program [args]]" >&2 From 001a0f23eceed222fb79dc289d014aaff9323cc3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:37:45 +0100 Subject: [PATCH 022/116] Fix _dsh support for short options --- aliases | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aliases b/aliases index e53b03e..cb4e5ba 100644 --- a/aliases +++ b/aliases @@ -171,6 +171,10 @@ _dsh() { shift while [ "${1:0:1}" = '-' ]; do + if [ "${1:0:2}" != '--' ]; then + docker_args+=("$1") + shift + fi docker_args+=("$1") shift done From 8a3fd3c61a0b7030961ab2e370523942221af18b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:40:13 +0100 Subject: [PATCH 023/116] Fix _dsh being interrupted by keyboard input, closing stdin --- aliases | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases b/aliases index cb4e5ba..29f80b4 100644 --- a/aliases +++ b/aliases @@ -189,7 +189,7 @@ _dsh() { usercmd="--user=$user " fi - if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" ]; then + if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" <&- ]; then echo "No such container $host" >&2 return 5 fi @@ -197,7 +197,7 @@ _dsh() { if [ -z "$prog" ]; then set -o pipefail for shell in bash sh; do - if shell_path="$(eval "docker $dowhat -ti $host which $shell" | sed 's|[\r\n]||g')"; then + if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then prog="$shell_path" break fi From 3faf6504bc6175fa04f6caa60b0afa9680586339 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:40:58 +0100 Subject: [PATCH 024/116] Ensure we clean up after attempting to find a shell --- aliases | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aliases b/aliases index 29f80b4..b92e38d 100644 --- a/aliases +++ b/aliases @@ -196,6 +196,10 @@ _dsh() { if [ -z "$prog" ]; then set -o pipefail + local rm= + if [ "$dowhat" = 'run' ]; then + rm='--rm --entrypoint=' + fi for shell in bash sh; do if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then prog="$shell_path" From 5380153043e5ca5a5473f843234459240a63872b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:41:16 +0100 Subject: [PATCH 025/116] Use a bash-ism for calc() alias --- aliases | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aliases b/aliases index b92e38d..cb15f3f 100644 --- a/aliases +++ b/aliases @@ -34,9 +34,7 @@ alias -g NUL="&> /dev/null" alias -g BG="&;disown" alias -g COL="| column -t" alias -g CLIP="| xclip -i -selection primary -f | xclip -i -selection clipboard" -calc() { - echo "$@" | bc -l -} +calc() { bc -l <<< "$@"; } alias svi=sudoedit # This will enable us to use aliases in sudo. From 42f36553460edc745fc956a1b3b19f8681b504e3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:41:31 +0100 Subject: [PATCH 026/116] Improve env and ssh aliases --- aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases b/aliases index cb15f3f..bdaa750 100644 --- a/aliases +++ b/aliases @@ -53,6 +53,8 @@ alias pacaur='pacaur --color=always' alias less='less -R' alias tree='tree --dirsfirst -C -F' alias dd='dd status=progress' +alias env='env | sort' +alias ssh="ssh -tt" # System aliases alias s="sudo systemctl" From b03244619ecb8c6cc7d83c9799df2d727f85f0af Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:41:52 +0100 Subject: [PATCH 027/116] Update gcam alias(es) to make more sense --- aliases | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aliases b/aliases index bdaa750..dde24cc 100644 --- a/aliases +++ b/aliases @@ -89,10 +89,9 @@ alias gaa="ga -A" alias grm="git rm" alias gc="git commit" alias gcm="gc -m" -alias gcma="git commit --amend -m" -alias gcman="git commit --amend --no-edit -m" alias gca="git commit --amend" alias gcan="git commit --amend --no-edit" +alias gcam="git commit --amend -m" alias gst="git status" alias gm="git merge" From a5862a3523b79c9513c46c6048a1c727dd5bf397 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 5 Sep 2017 21:48:36 +0100 Subject: [PATCH 028/116] Add more vim configs & vim-markdown-preview plugin --- .vimrc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index d402d31..4188105 100644 --- a/.vimrc +++ b/.vimrc @@ -5,6 +5,8 @@ set tabstop=4 set shiftwidth=0 " Use tabstop set softtabstop=-1 " Use tabstop set expandtab +set smarttab +set smartindent set number set autoindent set laststatus=2 @@ -13,6 +15,19 @@ set encoding=utf-8 set background=dark set directory=$HOME/.vim/swapfiles// +set title +set binary +set clipboard=unnamed +set wildmenu +set report=0 +set lazyredraw +set ttyfast +set autoread +set showmatch +set scrolloff=6 +set autowriteall +set nojoinspaces + "nnoremap "nnoremap @@ -39,6 +54,7 @@ Plugin 'vim-airline/vim-airline-themes' Plugin 'PotatoesMaster/i3-vim-syntax' Plugin 'solarnz/thrift.vim' Plugin 'lervag/vimtex' +Plugin 'JamshedVesuna/vim-markdown-preview' call vundle#end() @@ -59,7 +75,13 @@ let g:airline_theme='solarized' let g:airline#extensions#tabline#enabled = 1 " vim-auto-save -let g:auto_save = 1 " enable AutoSave on Vim startup +"let g:auto_save = 1 " enable AutoSave on Vim startup + +" vim-markdown plugin +let vim_markdown_preview_toggle=0 +let vim_markdown_preview_browser='Chromium' +let vim_markdown_preview_use_xdg_open=1 +let vim_markdown_preview_github=1 let mapleader="\" " Unbind arrow keys From 0eeb0ef2cb466acbb30652a887b0437cd2fe9891 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:53:50 +0100 Subject: [PATCH 029/116] vimrc: disable binary mode- it breaks everything --- .vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.vimrc b/.vimrc index 4188105..c72aba9 100644 --- a/.vimrc +++ b/.vimrc @@ -16,7 +16,6 @@ set background=dark set directory=$HOME/.vim/swapfiles// set title -set binary set clipboard=unnamed set wildmenu set report=0 From fd2a0e3399c8aa71d9757754b79e11665bd7f83b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:54:19 +0100 Subject: [PATCH 030/116] vimrc: set competent search options --- .vimrc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index c72aba9..796c7fc 100644 --- a/.vimrc +++ b/.vimrc @@ -30,6 +30,11 @@ set nojoinspaces "nnoremap "nnoremap +" Search options +set hlsearch +set ignorecase +set smartcase + " GVim settings set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= @@ -168,11 +173,6 @@ noremap p "*p noremap Y "+y noremap P "+p -" Search options -set hlsearch -set ignorecase -set smartcase - " Save aliases. noremap q :wq com W w From 5f8570914874576fa6aa896c76fc09edcb54b102 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:54:43 +0100 Subject: [PATCH 031/116] vimrc: disable mouse click actions --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 796c7fc..db284ed 100644 --- a/.vimrc +++ b/.vimrc @@ -39,6 +39,9 @@ set smartcase set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= +nnoremap +nnoremap + " Change to dvorak-mapped keys let g:use_dvorak = 1 From 4030a8954a8e269bdeac1238d09af7fe75a69f51 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:55:10 +0100 Subject: [PATCH 032/116] vimrc: remove opam/ocaml traces --- .vimrc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.vimrc b/.vimrc index db284ed..efee426 100644 --- a/.vimrc +++ b/.vimrc @@ -65,11 +65,6 @@ Plugin 'JamshedVesuna/vim-markdown-preview' call vundle#end() -let g:opamshare = substitute(system('opam config var share'),'\n$','','''') -execute "set rtp+=" . g:opamshare . "/merlin/vim" -execute "set rtp+=" . g:opamshare . "/vim/syntax/ocp-indent.vim" -let g:syntastic_ocaml_checkers = ['merlin'] -let g:syntastic_ignore_files = ['\m\c.(mll|mly)$'] set omnifunc=syntaxcomplete#Complete " YouCompleteMe python fix From 74c3f7336f88efb17d366289e76f637cf9b09bc2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:55:42 +0100 Subject: [PATCH 033/116] vimrc: remove no-longer required YCM python fix --- .vimrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/.vimrc b/.vimrc index efee426..709fcdf 100644 --- a/.vimrc +++ b/.vimrc @@ -67,9 +67,6 @@ call vundle#end() set omnifunc=syntaxcomplete#Complete -" YouCompleteMe python fix -let g:ycm_server_python_interpreter = '/usr/bin/python3' - " Vim-Airline config let g:Powerline_symbols = 'fancy' let g:airline_powerline_fonts = 1 From 1819e6ae0396204416513a9117a9a7ebf66aa95b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 12:57:18 +0100 Subject: [PATCH 034/116] vimrc: re-enable autosave --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 709fcdf..d0fb72d 100644 --- a/.vimrc +++ b/.vimrc @@ -74,7 +74,7 @@ let g:airline_theme='solarized' let g:airline#extensions#tabline#enabled = 1 " vim-auto-save -"let g:auto_save = 1 " enable AutoSave on Vim startup +let g:auto_save = 1 " enable AutoSave on Vim startup " vim-markdown plugin let vim_markdown_preview_toggle=0 From 16883bff80c7c6b4d79438f064497a1d151d583e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 29 Sep 2017 16:32:38 +0100 Subject: [PATCH 035/116] Rewrite i3b/updates in bash with AUR support --- .config/i3/blocks/config | 1 + .config/i3/blocks/updates | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.config/i3/blocks/config b/.config/i3/blocks/config index 5c9456c..4c7432a 100644 --- a/.config/i3/blocks/config +++ b/.config/i3/blocks/config @@ -57,6 +57,7 @@ signal=15 [updates] label= interval=600 +signal=5 [separator] diff --git a/.config/i3/blocks/updates b/.config/i3/blocks/updates index cfaaa21..9da2fb7 100755 --- a/.config/i3/blocks/updates +++ b/.config/i3/blocks/updates @@ -1,13 +1,31 @@ -#!/bin/python2 +#!/bin/bash +set -e -import commands -import os +for p in pacaur yaourt pacman; do + if $p --version &>/dev/null; then + PAC="$p" + break; + fi +done -button = os.environ.get('BLOCK_BUTTON') -if button == '1': - os.system("i3-sensible-terminal -r i3blocks-update-term -e 'pacaur -Syu'") +if [ -z "$PAC" ]; then + >&2 echo "Error: No Arch package manager found?" +fi -updates = commands.getstatusoutput("/usr/bin/checkupdates | wc -l")[1] -if updates and updates != '0': - print updates - print updates +if [ "$BLOCK_BUTTON" == 1 ]; then + nohup i3-sensible-terminal -r i3blocks-update-term -e "sh -c '$PAC -Syu; pkill -RTMIN+5 i3blocks'" &>/dev/null & + disown +fi + +if [ $p = "pacman" ]; then + exec 3< <(checkupdates) +else + exec 3< <({ checkupdates & cower -u & }) +fi + +count="$(wc -l <&3)" + +if [ -n "$count" -a "$count" -gt 0 ]; then + echo $count + echo $count +fi From 2a095e05704c1bb9dbf8cdc2407dcfe3be32e827 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:34:02 +0100 Subject: [PATCH 036/116] profile: add secrets file --- .gitignore | 1 + .profile | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 0dbe282..6b08f84 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ bookmarks +.config/secrets *.log .xournal/recent-files diff --git a/.profile b/.profile index 1e4cd6b..cbc05ab 100644 --- a/.profile +++ b/.profile @@ -15,6 +15,13 @@ export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" export QT_QPA_PLATFORMTHEME=gtk2 +# Source secret keys and values into environment +if [ -f "$CONFIG_DIR/secrets" ]; then + set -o allexport + source $CONFIG_DIR/secrets + set +o allexport +fi + # Merge system clipboards if ! [ -z $DISPLAY ] && which autocutsel &>/dev/null; then autocutsel -fork & From c24da1959ae4dd671167854c9561ff017dd8bc21 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:36:10 +0100 Subject: [PATCH 037/116] aliases: always add grip api key --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index dde24cc..b2a4b42 100644 --- a/aliases +++ b/aliases @@ -55,6 +55,7 @@ alias tree='tree --dirsfirst -C -F' alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" +alias grip='grip --user=frebib --pass=$GRIP_API_KEY' # System aliases alias s="sudo systemctl" From 920afe3ed22f2dfae883762bac5c695e760c2e8d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:36:42 +0100 Subject: [PATCH 038/116] aliases: git clone recursively by default --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index b2a4b42..1626f32 100644 --- a/aliases +++ b/aliases @@ -76,7 +76,7 @@ alias -s rar="unrar l" alias -s tar="tar tf" alias -s gz="tar tf" alias -s jar="java -jar" -alias -s git="git clone" +alias -s git="git clone --recursive" # Git Aliases From df2291ce1579b36b39afdc3853f82320597f5a16 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:37:10 +0100 Subject: [PATCH 039/116] aliases: fix _dsh user@ specification --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index 1626f32..e97a750 100644 --- a/aliases +++ b/aliases @@ -186,7 +186,7 @@ _dsh() { host="$1" else host=`echo $1 | cut -d'@' -f2 -s` - usercmd="--user=$user " + usercmd="--user=$user" fi if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" <&- ]; then From 9d68559fd9320d18f3e6d25a0257d4b32c0745b9 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:37:47 +0100 Subject: [PATCH 040/116] aliases: remove packer/vagrant aliases --- aliases | 4 ---- 1 file changed, 4 deletions(-) diff --git a/aliases b/aliases index e97a750..9dc6cad 100644 --- a/aliases +++ b/aliases @@ -230,10 +230,6 @@ alias zpool='sudo zpool' alias z=zfs alias zp=zpool -# Packer, Vagrant aliases -alias pk=packer -alias v=vagrant - # General Aliases alias ssha='eval `ssh-agent` ; ssh-add' alias aliases="$EDITOR $DOTFILES/aliases ; source ~/.zshrc" From 7da3fc8d9f9f375f115088782c1efe0144b46ca5 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:39:05 +0100 Subject: [PATCH 041/116] scripts/4screens: make each display configurable --- scripts/4screens | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/4screens b/scripts/4screens index 6e1e8f8..849449e 100755 --- a/scripts/4screens +++ b/scripts/4screens @@ -1,9 +1,14 @@ #!/bin/sh set -e -xrandr --output DP-0.1 --primary --mode 1920x1080 --pos 0x1080 --rotate normal \ - --output DP-0.2.1 --mode 1920x1080 --pos 0x0 --rotate inverted \ - --output DP-0.2.2.1 --mode 1920x1080 --pos 1920x0 --rotate inverted \ - --output DP-0.2.2.2.1 --mode 1920x1080 --pos 1920x1080 --rotate normal +TOP_LEFT="HDMI-0" +TOP_RIGHT="DP-2.2.1" +BOTTOM_LEFT="DVI-D-0" +BOTTOM_RIGHT="DP-2.1" + +xrandr --output $BOTTOM_LEFT --primary --mode 1920x1080 --pos 0x1080 --rotate normal \ + --output $TOP_LEFT --mode 1920x1080 --pos 0x0 --rotate inverted \ + --output $TOP_RIGHT --mode 1920x1080 --pos 1920x0 --rotate inverted \ + --output $BOTTOM_RIGHT --mode 1920x1080 --pos 1920x1080 --rotate normal [ -e ~/.fehbg ] && ~/.fehbg From 1a1035570a51dd09d39966b3f14c8d4936570ac1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:40:07 +0100 Subject: [PATCH 042/116] scripts/zsh-setup: fix pkgfile installation & setup --- scripts/zsh-setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/zsh-setup b/scripts/zsh-setup index 7082432..d33ac90 100755 --- a/scripts/zsh-setup +++ b/scripts/zsh-setup @@ -2,9 +2,9 @@ set -e # Install pkgfile for command-not-found support -sudo pacman -S pkgfile --no-confirm --needed +sudo pacman -S pkgfile --noconfirm --needed sudo systemctl enable --now pkgfile-update.service -pkgfile --update +sudo pkgfile --update dest="$HOME/.local/share" mkdir -p "$dest" From b6144f8019bafeac9eda8f9f1b5fdf602f2b73b1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:41:48 +0100 Subject: [PATCH 043/116] dunstrc: update for latest version --- .config/dunst/dunstrc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index ef10c4d..9ad4a75 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -11,7 +11,7 @@ # . # If markup is not allowed, those tags will be stripped out of the # message. - allow_markup = yes + markup = yes # The format of the message. Possible variables are: # %a appname @@ -143,15 +143,14 @@ # Browser for opening urls in context menu. browser = /usr/bin/chromium - # Align icons left/right/off - icon_position = left + # Align icons left/right/off + icon_position = off # Paths to default icons. icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ -[frame] - width = 3 - color = "#404552" + frame_width = 3 + frame_color = "#404552" [shortcuts] From 3ce722f60aa98a23a7f4fe8936401603ca29ebb1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 09:43:51 +0100 Subject: [PATCH 044/116] i3/powermenu: don't assume systemd-sysvcompat is installed --- .config/i3/powermenu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/powermenu.sh b/.config/i3/powermenu.sh index ebe35d1..015327c 100755 --- a/.config/i3/powermenu.sh +++ b/.config/i3/powermenu.sh @@ -11,7 +11,7 @@ case $option in windows) windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4` sudo efibootmgr -n $windows - reboot;; + systemctl reboot;; esac exit 0 From 0284b8765e79e544e7086ea50a90c4add4748f03 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:15:34 +0100 Subject: [PATCH 045/116] zshrc: ensure GPG prompt is the current TTY --- .zshrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.zshrc b/.zshrc index 5d12551..ea93de4 100644 --- a/.zshrc +++ b/.zshrc @@ -17,6 +17,12 @@ HISTSIZE=100000 SAVEHIST=100000 setopt sharehistory histignoredups histignorespace histreduceblanks autocd autopushd extendedglob alwaystoend dvorak +# Only set tty if running interactively +if tty -s; then + # Resolve at shell runtime + export GPG_TTY="$(tty)" +fi + export WORDCHARS='*?_[]~=&;!#$%^(){}' bindkey -e From c8d89667f32b1547dc2cc18c5968b97443e51514 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:19:22 +0100 Subject: [PATCH 046/116] git/config: ensure consistent formatting of tabs --- .config/git/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/git/config b/.config/git/config index 7fa64cc..ed59e5c 100644 --- a/.config/git/config +++ b/.config/git/config @@ -4,11 +4,11 @@ signingkey = CFBB6A86 [commit] - gpgsign = true + gpgsign = true [color] ui = auto [alias] - verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr + verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr [rebase] autoStash = true [push] From a6db5e80746d35e92adb7ca7c74cf706a31f1a62 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:19:39 +0100 Subject: [PATCH 047/116] git/config: add sendemail configuration for gmail --- .config/git/config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/git/config b/.config/git/config index ed59e5c..2b144cf 100644 --- a/.config/git/config +++ b/.config/git/config @@ -20,3 +20,10 @@ rebase = true [core] autocrlf = input +[sendemail] + from = Joe Groocock + smtpserver = smtp.gmail.com + smtpuser = frebib@gmail.com + smtpencryption = tls + smtpserverport = 587 + suppresscc = self From ef1ef52649557af460008b918a36b68c43f920db Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:20:27 +0100 Subject: [PATCH 048/116] i3/config: start xautolock with '--no-startup-id' --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index c32ec66..ac39980 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -182,7 +182,7 @@ exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; # app launch shortcuts exec --no-startup-id ~/.fehbg exec --no-startup-id ~/.config/i3/disable-standby-fs.py -exec xautolock -time 5 -locker ~/.config/i3/lock.sh +exec --no-startup-id xautolock -time 5 -locker ~/.config/i3/lock.sh # startup programs exec --no-startup-id pulseaudio From d8c201e86165e3483666872335f8fc9da4e97cb4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:20:42 +0100 Subject: [PATCH 049/116] i3/config: update startup programs --- .config/i3/config | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index ac39980..9bc28da 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -186,16 +186,15 @@ exec --no-startup-id xautolock -time 5 -locker ~/.config/i3/lock.sh # startup programs exec --no-startup-id pulseaudio -exec --no-startup-id dropbox -exec --no-startup-id insync start -exec --no-startup-id nm-applet +exec --no-startup-id nextcloud exec --no-startup-id blueman-applet exec --no-startup-id redshift exec --no-startup-id xbindkeys +exec --no-startup-id solaar exec --no-startup-id compton -b --config ~/.config/compton.conf exec --no-startup-id chromium --no-startup-window +exec i3-msg 'workspace 1; exec sleep 2 && chromium' exec i3-msg 'workspace 2; exec i3-sensible-terminal' -exec i3-msg 'workspace 3; exec sleep 2 && chromium' # vim:ft=i3 From 39887c9cd855ea8b13f322a5d7d5014197eaaeee Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:28:10 +0100 Subject: [PATCH 050/116] imgur-screenshot/settings: update scrot command & ensure login --- .config/imgur-screenshot/settings.conf | 6 +++--- .gitignore | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/imgur-screenshot/settings.conf b/.config/imgur-screenshot/settings.conf index 776bd53..e0821a9 100644 --- a/.config/imgur-screenshot/settings.conf +++ b/.config/imgur-screenshot/settings.conf @@ -1,11 +1,11 @@ imgur_icon_path="$HOME/.config/imgur-screenshot/imgur.ico" -login="false" +login="true" log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log" credentials_file="$HOME/.config/imgur-screenshot/credentials.conf" file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png! file_dir="$HOME/pictures/screenshots" -screenshot_select_command="scrot -s %img" -screenshot_window_command="scrot %img" +screenshot_select_command="scrot -q 0 -s %img" +screenshot_window_command="scrot -q 0 -b %img" edit_command="gimp %img" edit="false" exit_on_selection_fail="true" diff --git a/.gitignore b/.gitignore index 6b08f84..2c6d10d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bookmarks .config/secrets +.config/imgur-screenshot/credentials.conf *.log .xournal/recent-files From 519ee698bca10394a3444fff85a387a2bc037439 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:28:57 +0100 Subject: [PATCH 051/116] profile: remove negation in if statement --- .profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index cbc05ab..aceb2fe 100644 --- a/.profile +++ b/.profile @@ -23,7 +23,7 @@ if [ -f "$CONFIG_DIR/secrets" ]; then fi # Merge system clipboards -if ! [ -z $DISPLAY ] && which autocutsel &>/dev/null; then +if [ -n "$DISPLAY" ] && which autocutsel &>/dev/null; then autocutsel -fork & autocutsel -selection PRIMARY -fork & fi From bc3f39e9058d4da2766e9a6db48e1a6c2b1ddc05 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:29:21 +0100 Subject: [PATCH 052/116] profile: always start gnome-keyring-daemon --- .profile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.profile b/.profile index aceb2fe..496c5d3 100644 --- a/.profile +++ b/.profile @@ -31,6 +31,5 @@ fi if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then eval $(dbus-launch --sh-syntax --exit-with-session) dbus-update-activation-environment --systemd DISPLAY - export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) - export SSH_AUTH_SOCK fi +export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) From c01fc34e55f4f166aedeab20184e2c56df37745d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 10:29:55 +0100 Subject: [PATCH 053/116] zshrc: update completion configuration --- .zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index ea93de4..d7d4cbc 100644 --- a/.zshrc +++ b/.zshrc @@ -47,8 +47,9 @@ bindkey "^[^[[A" up-line-or-beginning-search # Up bindkey "^[[B" down-line-or-beginning-search # Down bindkey "^[^[[B" down-line-or-beginning-search # Down -zstyle ':completion:*:sudo::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" +zstyle ':completion:*:sudo|_::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' +zstyle ':completion:*' rehash true zstyle :compinstall filename "$HOME/.zshrc" autoload -U compinit ; compinit From bbabfed11951495ba11f2f98b38d5c5daf5ca5d7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 11:49:06 +0100 Subject: [PATCH 054/116] aliases: cleanup randstr --- aliases | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aliases b/aliases index 9dc6cad..7477f65 100644 --- a/aliases +++ b/aliases @@ -247,9 +247,7 @@ i3b() { } alias sf=screenfetch alias nf=neofetch -randstr() { - cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $1 | head -n 1 -} +randstr() { tr -dc 'a-zA-Z0-9' /dev/urandom | fold -w $1 | head -n 1; } alias lab="ssh -tt tw '~/ctl' 2>/dev/null" From 3c54f8e8868af16f6ceb2ff65c0ef200ab220b7a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 11:49:23 +0100 Subject: [PATCH 055/116] aliases: add ROT13 command --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index 7477f65..f718468 100644 --- a/aliases +++ b/aliases @@ -248,6 +248,7 @@ i3b() { alias sf=screenfetch alias nf=neofetch randstr() { tr -dc 'a-zA-Z0-9' /dev/urandom | fold -w $1 | head -n 1; } +alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'" alias lab="ssh -tt tw '~/ctl' 2>/dev/null" From 3915bfa6bb514f44a58bae6753707f1a3d9e8166 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Oct 2017 11:35:02 +0100 Subject: [PATCH 056/116] i3/config: fix fullscreen lock disabling --- .config/i3/config | 2 +- .config/i3/disable-standby-fs.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 .config/i3/disable-standby-fs.py diff --git a/.config/i3/config b/.config/i3/config index 9bc28da..b904bc5 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -182,7 +182,7 @@ exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; # app launch shortcuts exec --no-startup-id ~/.fehbg exec --no-startup-id ~/.config/i3/disable-standby-fs.py -exec --no-startup-id xautolock -time 5 -locker ~/.config/i3/lock.sh +exec --no-startup-id xautolock -time 5 -locker ~/.config/i3/lock.sh -nocloseout -nocloseerr # startup programs exec --no-startup-id pulseaudio diff --git a/.config/i3/disable-standby-fs.py b/.config/i3/disable-standby-fs.py old mode 100644 new mode 100755 index b8ca13f..13b2288 --- a/.config/i3/disable-standby-fs.py +++ b/.config/i3/disable-standby-fs.py @@ -16,16 +16,16 @@ args = parser.parse_args() def on_fullscreen_mode(i3, e): if e.container.props.fullscreen_mode: - call(['xset', 's', 'off']) - call(['xset', '-dpms']) + call(['xautolock', '-disable']) + print("disabling autolock") else: - call(['xset', 's', 'on']) - call(['xset', '+dpms']) + call(['xautolock', '-enable']) + print("enabling autolock") def on_window_close(i3, e): if e.container.props.fullscreen_mode: - call(['xset', 's', 'on']) - call(['xset', '+dpms']) + call(['xautolock', '-enable']) + print("enabling autolock") i3.on('window::fullscreen_mode', on_fullscreen_mode) i3.on('window::close', on_window_close) From 1e5813dc35b0ebbe7163fc241738ba9480d84748 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 10 Oct 2017 10:58:45 +0100 Subject: [PATCH 057/116] zshrc: add more options & clean up --- .zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index d7d4cbc..b3aec30 100644 --- a/.zshrc +++ b/.zshrc @@ -15,7 +15,8 @@ mkdir -p $ZSH_CACHE_DIR $ZSH_CONFIG_DIR HISTFILE=$ZSH_CONFIG_DIR/histfile HISTSIZE=100000 SAVEHIST=100000 -setopt sharehistory histignoredups histignorespace histreduceblanks autocd autopushd extendedglob alwaystoend dvorak +setopt sharehistory histignorealldups histignorespace histreduceblanks +setopt pathdirs autocd autopushd correctall extendedglob alwaystoend dvorak # Only set tty if running interactively if tty -s; then @@ -61,7 +62,6 @@ source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) -setopt HIST_IGNORE_ALL_DUPS ZSH_HIGHLIGHT_STYLES[default]='fg=blue' ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' From be64bd88e8343cbce4f18b20da67551481f5815b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 10 Oct 2017 10:59:25 +0100 Subject: [PATCH 058/116] zshrc: add gopass completion --- .zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.zshrc b/.zshrc index b3aec30..b7a7d55 100644 --- a/.zshrc +++ b/.zshrc @@ -54,11 +54,16 @@ zstyle ':completion:*' rehash true zstyle :compinstall filename "$HOME/.zshrc" autoload -U compinit ; compinit +autoload -U bashcompinit ; bashcompinit plugins=(command-not-found history-substring-search sudo zsh-autosuggestions zsh-completions) source $ZSH/oh-my-zsh.sh source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +if gopass --help &>/dev/null; then + source <(gopass completion bash) +fi + ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) From 1c28551d20ec7a8be75892b8a6cd69ab95bc4978 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 10 Oct 2017 10:59:48 +0100 Subject: [PATCH 059/116] zshrc: remove OCaml/OPAM references --- .zshrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/.zshrc b/.zshrc index b7a7d55..c525155 100644 --- a/.zshrc +++ b/.zshrc @@ -96,6 +96,3 @@ ZSH_HIGHLIGHT_STYLES[assign]='none' ZSH_HIGHLIGHT_STYLES[redirection]='none' source $DOTFILES/aliases - -# OPAM configuration -. /home/frebib/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true From c0670abe4a9efd0fa89e7280e13b6fffa34ef3e1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 10 Oct 2017 11:00:34 +0100 Subject: [PATCH 060/116] i3/config: add pullover to i3 startup --- .config/i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3/config b/.config/i3/config index b904bc5..7d329ae 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -191,6 +191,7 @@ exec --no-startup-id blueman-applet exec --no-startup-id redshift exec --no-startup-id xbindkeys exec --no-startup-id solaar +exec --no-startup-id pullover exec --no-startup-id compton -b --config ~/.config/compton.conf exec --no-startup-id chromium --no-startup-window From 0c054d9e346693f999cd7ed66354bdd2405e1be3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 10 Oct 2017 11:01:03 +0100 Subject: [PATCH 061/116] aliases: add 'git remote -v' alias --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index f718468..b400c93 100644 --- a/aliases +++ b/aliases @@ -126,6 +126,7 @@ alias gundo="git reset @~1" alias gclean="git clean" alias gbr="git branch" alias gr="git remote" +alias grv="git remote -v" alias gra="gr add" alias grr="gr rm" alias grao="gra origin" From 40da40d7181f71aba2abed2f3d4c9a12caecf8a8 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 25 Oct 2017 13:44:10 +0100 Subject: [PATCH 062/116] display: update for new monitor cable arrangement --- .config/i3/config | 8 ++++---- scripts/4screens | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 7d329ae..8202737 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -45,10 +45,10 @@ bindsym $mod+a focus parent bindsym $mod+o focus child # Screen configs # -set $bl "DVI-D-0" -set $tl "HDMI-0" -set $br "DP-2.1" -set $tr "DP-2.2.1" +set $bl "DP-5" +set $tl "DP-1" +set $br "HDMI-0" +set $tr "DP-3" # Workspace -> Screen workspace 1 output $bl diff --git a/scripts/4screens b/scripts/4screens index 849449e..13b8da2 100755 --- a/scripts/4screens +++ b/scripts/4screens @@ -1,10 +1,10 @@ #!/bin/sh set -e -TOP_LEFT="HDMI-0" -TOP_RIGHT="DP-2.2.1" -BOTTOM_LEFT="DVI-D-0" -BOTTOM_RIGHT="DP-2.1" +TOP_LEFT="DP-1" +TOP_RIGHT="DP-3" +BOTTOM_LEFT="DP-5" +BOTTOM_RIGHT="HDMI-0" xrandr --output $BOTTOM_LEFT --primary --mode 1920x1080 --pos 0x1080 --rotate normal \ --output $TOP_LEFT --mode 1920x1080 --pos 0x0 --rotate inverted \ From 29f0feb620354669c8b3f99c73f0074a362d1d9b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 3 Nov 2017 00:28:18 +0000 Subject: [PATCH 063/116] Add check before starting gnome-keyring-daemon to prevent env-dump --- .profile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.profile b/.profile index 496c5d3..98fe1ac 100644 --- a/.profile +++ b/.profile @@ -32,4 +32,8 @@ if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then eval $(dbus-launch --sh-syntax --exit-with-session) dbus-update-activation-environment --systemd DISPLAY fi -export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) + +# Start the gnome-keyring if it's installed +if which gnome-keyring-daemon &>/dev/null; then + export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) +fi From 2ae12987ad5335659be01c67748a59eb6d52d5d0 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:30:39 +0000 Subject: [PATCH 064/116] Remove 'correctall' option from ZSH --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index c525155..d7a3ff9 100644 --- a/.zshrc +++ b/.zshrc @@ -16,7 +16,7 @@ HISTFILE=$ZSH_CONFIG_DIR/histfile HISTSIZE=100000 SAVEHIST=100000 setopt sharehistory histignorealldups histignorespace histreduceblanks -setopt pathdirs autocd autopushd correctall extendedglob alwaystoend dvorak +setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak # Only set tty if running interactively if tty -s; then From a9de0ece5417cc197fb76ce6f564bb821e40ed66 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:31:33 +0000 Subject: [PATCH 065/116] Add quick alias for 'cd `mktemp -d`' --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index b400c93..e72720c 100644 --- a/aliases +++ b/aliases @@ -20,6 +20,7 @@ alias md="mkdir -p" mcd(){ mkdir -p $1 && cd $1 } +alias cdt='cd `mktemp -d`' alias grep='grep --color' alias -g H='| head' alias -g T='| tail' From 910c2416f3c72e61de79d409992dee48347a4712 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:33:01 +0000 Subject: [PATCH 066/116] Use gopass over pass if it's installed --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index e72720c..779cedf 100644 --- a/aliases +++ b/aliases @@ -57,6 +57,7 @@ alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' +which gopass &>/dev/null && alias pass='gopass' # System aliases alias s="sudo systemctl" From c5ca8bef94bac86daeb79c01df6f06a55ed30e6f Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:42:23 +0000 Subject: [PATCH 067/116] Add abuild alias using docker --- aliases | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aliases b/aliases index 779cedf..5b3da60 100644 --- a/aliases +++ b/aliases @@ -58,6 +58,14 @@ alias env='env | sort' alias ssh="ssh -tt" alias grip='grip --user=frebib --pass=$GRIP_API_KEY' which gopass &>/dev/null && alias pass='gopass' +alias abuild='docker run -ti --rm \ + -e USER \ + -e PWD \ + -w $PWD \ + -v ~/.abuild:/home/$USER/.abuild \ + -v ~/.config/git:/home/$USER/.config/git:ro \ + -v ~/.gnupg:/home/$USER/.gnupg \ + frebib/alpine-sdk abuild' # System aliases alias s="sudo systemctl" From 287456056c941043e87c55b8b91e8fbf4d56f6e4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:42:42 +0000 Subject: [PATCH 068/116] Fix broken randstr command --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index 5b3da60..52d6243 100644 --- a/aliases +++ b/aliases @@ -258,7 +258,7 @@ i3b() { } alias sf=screenfetch alias nf=neofetch -randstr() { tr -dc 'a-zA-Z0-9' /dev/urandom | fold -w $1 | head -n 1; } +randstr() { tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w $1 | head -n 1; } alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'" alias lab="ssh -tt tw '~/ctl' 2>/dev/null" From 456a29086025eb163174dcf4225601d202ccb892 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:43:29 +0000 Subject: [PATCH 069/116] Highlight whitespace in Vim --- .vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vimrc b/.vimrc index d0fb72d..0c566a9 100644 --- a/.vimrc +++ b/.vimrc @@ -39,6 +39,10 @@ set smartcase set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= +" Whitespace highlight settings +set list +set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< + nnoremap nnoremap From 1eeab5a436d9d2d90b71d3908f6a932246db2230 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 10 Nov 2017 12:47:10 +0000 Subject: [PATCH 070/116] Force markdown & YAML formatting rules globally --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 0c566a9..fd50d87 100644 --- a/.vimrc +++ b/.vimrc @@ -180,3 +180,6 @@ com Wq wq com WQ wq " Write with sudo cmap w!! w !sudo tee > /dev/null % + +autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et From 7148e015794b428ceb77aaf064c190ebf0fc7075 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:04:28 +0000 Subject: [PATCH 071/116] Overhaul terminal colours --- .Xresources | 30 ++++++++++++++++-------------- .config/termite/config | 27 ++++++++++++++------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.Xresources b/.Xresources index 51f534c..4cf13ec 100644 --- a/.Xresources +++ b/.Xresources @@ -61,12 +61,18 @@ urxvt*highlightSelection: true urxvt*colorMode: on ! black -*.color0: #263238 -*.color8: #37474f +*.color0: #333638 + +!white +*.color15: #eceff1 + +! gray +*.color7: #8b9396 +*.color8: #475760 ! red -*.color1: #ff9800 -*.color9: #ffa74d +*.color1: #ff3f00 +*.color9: #ef5345 ! green *.color2: #8bc34a @@ -77,20 +83,16 @@ urxvt*colorMode: on *.color11: #ffa000 ! blue -*.color4: #03a9f4 -*.color12: #81d4fa +*.color4: #0266f4 +*.color12: #3f86da ! magenta -*.color5: #e91e63 -*.color13: #A56ECC +*.color5: #cc17cc +*.color13: #a56ecC ! cyan -*.color6: #009688 -*.color14: #26a69a - -! white -*.color7: #cfd8dc -*.color15: #eceff1 +*.color6: #10aeba +*.color14: #5ddae2 !----------------------------- diff --git a/.config/termite/config b/.config/termite/config index 911654b..9bdf2f1 100644 --- a/.config/termite/config +++ b/.config/termite/config @@ -11,11 +11,15 @@ background = rgba(56, 60, 74, 0.95) highlight = #5294E2 # black -color0 = #263238 -color8 = #37474f +color0 = #333638 +# white +color15 = #eceff1 +# gray +color7 = #8b9396 +color8 = #475760 # red -color1 = #ff9800 -color9 = #ffa74d +color1 = #ff3f00 +color9 = #ef5345 # green color2 = #8bc34a color10 = #9ccc65 @@ -23,16 +27,13 @@ color10 = #9ccc65 color3 = #ffc107 color11 = #ffa000 # blue -color4 = #03a9f4 -color12 = #81d4fa +color4 = #0266f4 +color12 = #81b3f9 # magenta -color5 = #e91e63 -color13 = #A56ECC +color5 = #cc17cc +color13 = #a56ecc # cyan -color6 = #009688 -color14 = #26a69a -# white -color7 = #cfd8dc -color15 = #eceff1 +color6 = #10aeba +color14 = #5ddae2 # vim: ft=dosini cms=#%s From 7bb0e8e1c7ec3c829a20bcd7a96ce2ebfbbc6731 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:06:29 +0000 Subject: [PATCH 072/116] Overhaul ZSH config, remove oh-my-zsh --- .config/zsh/fish-theme.zsh | 83 ++++++++++++++++++++++++++ .zshrc | 117 ++++++++++++++++++++----------------- 2 files changed, 147 insertions(+), 53 deletions(-) create mode 100644 .config/zsh/fish-theme.zsh diff --git a/.config/zsh/fish-theme.zsh b/.config/zsh/fish-theme.zsh new file mode 100644 index 0000000..9e961ce --- /dev/null +++ b/.config/zsh/fish-theme.zsh @@ -0,0 +1,83 @@ +# ZSH Theme emulating the Fish shell's default prompt. + +_fishy_collapsed_wd() { + echo $(pwd | perl -pe ' + BEGIN { + binmode STDIN, ":encoding(UTF-8)"; + binmode STDOUT, ":encoding(UTF-8)"; + }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g +') +} + +git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" +} +git_prompt_status() { + # Get the status of the working tree + INDEX=$(command git status --porcelain -b 2> /dev/null) + STATUS="" + if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" + fi + if $(echo "$INDEX" | grep '^A ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" + elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" + fi + if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" + fi + if $(echo "$INDEX" | grep '^R ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" + fi + if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" + fi + if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then + STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS" + fi + if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" + fi + if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS" + fi + if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS" + fi + if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then + STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS" + fi + echo $STATUS +} + +# Required for dynamic prompt +setopt prompt_subst + +local user_color='green'; [ $UID -eq 0 ] && user_color='red' +PROMPT="%n@%m %F{$user_color}\$(_fishy_collapsed_wd)%f%(!.#.>) " +PROMPT2='%F{red}\ %f' + +local return_status="%F{red}%(?..%?)%f" +RPROMPT='${return_status}$(git_prompt_info)$(git_prompt_status)%{$reset_color%}' + +ZSH_THEME_GIT_PROMPT_PREFIX=" " +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" diff --git a/.zshrc b/.zshrc index d7a3ff9..32c1c5e 100644 --- a/.zshrc +++ b/.zshrc @@ -1,22 +1,17 @@ unsetopt MULTIBYTE -# Path to your oh-my-zsh installation. -ZSH=$HOME/.local/share/oh-my-zsh - -# Set the theme -ZSH_THEME="fishy" -#DISABLE_AUTO_UPDATE="true" - +# Config and cache directory paths CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" -ZSH_CONFIG_DIR=$CONFIG_DIR/zsh -ZSH_CACHE_DIR=$CONFIG_DIR/oh-my-zsh/cache -mkdir -p $ZSH_CACHE_DIR $ZSH_CONFIG_DIR +ZSH_DIR="$CONFIG_DIR/zsh" +ZSH_CACHE_DIR="$CONFIG_DIR/oh-my-zsh/cache" +ADOTDIR="$ZSH_DIR/antigen" # Antigen directory +ANTIGEN_LOG="$ADOTDIR/log/antigen-$(date +"%Y_%m_%d_%I_%M_%p").log" -HISTFILE=$ZSH_CONFIG_DIR/histfile -HISTSIZE=100000 -SAVEHIST=100000 -setopt sharehistory histignorealldups histignorespace histreduceblanks -setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak +mkdir -p "$ZSH_CACHE_DIR" "$ZSH_DIR" "$ADOTDIR/log" + +HISTFILE="$ZSH_DIR/histfile" +HISTSIZE=999999 +SAVEHIST=999999 # Only set tty if running interactively if tty -s; then @@ -24,14 +19,38 @@ if tty -s; then export GPG_TTY="$(tty)" fi -export WORDCHARS='*?_[]~=&;!#$%^(){}' +# Set some useful ZSH/Bash options +setopt sharehistory histignorealldups histignorespace histreduceblanks +setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak +# Load antigen & plugins +source "$ZSH_DIR/antigen.zsh" + +antigen bundle sudo +antigen bundle zsh-users/zsh-completions +antigen bundle zsh-users/zsh-autosuggestions +antigen bundle Tarrasch/zsh-syntax-highlighting +antigen bundle zsh-users/zsh-history-substring-search + +antigen apply + +# Completion initialisation +autoload -U compinit ; compinit +autoload -U bashcompinit ; bashcompinit + +# gopass completion +if gopass --help &>/dev/null; then + source <(gopass completion bash) +fi + +# Set some key-binds bindkey -e -bindkey "\e[1;3C" forward-word -bindkey "\e[1;3D" backward-word +bindkey "^[[1;3C" forward-word +bindkey "^[[1;3D" backward-word bindkey "^[[7~" beginning-of-line bindkey "^[[8~" end-of-line +export WORDCHARS='*?_[]~=&;!#$%^(){}' x-bash-backward-kill-word(){ WORDCHARS='' zle kill-word } @@ -39,60 +58,52 @@ zle -N x-bash-backward-kill-word bindkey '^[^[[3~' x-bash-backward-kill-word bindkey '^[^[[3^' x-bash-backward-kill-word -autoload -U up-line-or-beginning-search -autoload -U down-line-or-beginning-search -zle -N up-line-or-beginning-search -zle -N down-line-or-beginning-search -bindkey "^[[A" up-line-or-beginning-search # Up -bindkey "^[^[[A" up-line-or-beginning-search # Up -bindkey "^[[B" down-line-or-beginning-search # Down -bindkey "^[^[[B" down-line-or-beginning-search # Down +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down zstyle ':completion:*:sudo|_::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' zstyle ':completion:*' rehash true zstyle :compinstall filename "$HOME/.zshrc" - -autoload -U compinit ; compinit -autoload -U bashcompinit ; bashcompinit - -plugins=(command-not-found history-substring-search sudo zsh-autosuggestions zsh-completions) -source $ZSH/oh-my-zsh.sh -source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - -if gopass --help &>/dev/null; then - source <(gopass completion bash) -fi +zstyle ':completion:*:*:*:*:*' menu select +zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) -ZSH_HIGHLIGHT_STYLES[default]='fg=blue' +HISTORY_SUBSTRING_SEARCH_FUZZY=true +HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=true +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='underline' + +typeset -A ZSH_HIGHLIGHT_STYLES +ZSH_HIGHLIGHT_STYLES[default]='fg=12' ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow' -ZSH_HIGHLIGHT_STYLES[alias]='fg=63' +ZSH_HIGHLIGHT_STYLES[alias]='fg=blue' ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,underline' -ZSH_HIGHLIGHT_STYLES[builtin]='fg=63' -ZSH_HIGHLIGHT_STYLES[function]='fg=63' -ZSH_HIGHLIGHT_STYLES[command]='fg=63' -ZSH_HIGHLIGHT_STYLES[precommand]='fg=63' -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=blue' +ZSH_HIGHLIGHT_STYLES[builtin]='fg=blue' +ZSH_HIGHLIGHT_STYLES[function]='fg=blue' +ZSH_HIGHLIGHT_STYLES[command]='fg=blue' +ZSH_HIGHLIGHT_STYLES[precommand]='fg=blue' +ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=cyan' ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green' -ZSH_HIGHLIGHT_STYLES[path]='fg=63,underline' +ZSH_HIGHLIGHT_STYLES[path]='fg=blue' ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=yellow,bold' -ZSH_HIGHLIGHT_STYLES[path_approx]='fg=red,bold,underline' +ZSH_HIGHLIGHT_STYLES[path_approx]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[globbing]='fg=red' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue' -ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue' -ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none' +ZSH_HIGHLIGHT_STYLES[comment]='fg=7' +ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=1' +ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=12' +ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=12' +ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=magenta' ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=yellow' ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan' -ZSH_HIGHLIGHT_STYLES[assign]='none' -ZSH_HIGHLIGHT_STYLES[redirection]='none' +ZSH_HIGHLIGHT_STYLES[assign]='fg=green' +ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan' -source $DOTFILES/aliases +source "$ZSH_DIR/fish-theme.zsh" +source "$DOTFILES/aliases" From 21fc75a2450654a89ece80efec337b3879958d5c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:14:30 +0000 Subject: [PATCH 073/116] Install antigen if it's not installed --- .zshrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 32c1c5e..f179305 100644 --- a/.zshrc +++ b/.zshrc @@ -24,7 +24,16 @@ setopt sharehistory histignorealldups histignorespace histreduceblanks setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak # Load antigen & plugins -source "$ZSH_DIR/antigen.zsh" +antigen_src="$ZSH_DIR/antigen.zsh" +if [ ! -f "$antigen_src" ]; then + if which curl &>/dev/null; then + getcmd='curl -L' + else + getcmd='wget -qO-' + fi + eval $getcmd git.io/antigen > "$antigen_src" +fi +source "$antigen_src" antigen bundle sudo antigen bundle zsh-users/zsh-completions From 334e619863dbfadfaac2ccf7bd6495043fe7a7d0 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:20:55 +0000 Subject: [PATCH 074/116] abuild should always run alpine:edge --- aliases | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aliases b/aliases index 52d6243..bb767e9 100644 --- a/aliases +++ b/aliases @@ -62,10 +62,11 @@ alias abuild='docker run -ti --rm \ -e USER \ -e PWD \ -w $PWD \ + -v $PWD:$PWD \ -v ~/.abuild:/home/$USER/.abuild \ -v ~/.config/git:/home/$USER/.config/git:ro \ -v ~/.gnupg:/home/$USER/.gnupg \ - frebib/alpine-sdk abuild' + frebib/alpine-sdk:edge abuild' # System aliases alias s="sudo systemctl" From dd4faa7b6c408e78176e6ef091f03cbedd442461 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:21:27 +0000 Subject: [PATCH 075/116] git diff now uses --color-words --- aliases | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aliases b/aliases index bb767e9..cfe2c12 100644 --- a/aliases +++ b/aliases @@ -97,6 +97,7 @@ alias gcl="git clone --recursive" alias gco="git checkout" alias gcom="git checkout master" alias ga="git add" +alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p" alias gaa="ga -A" alias grm="git rm" alias gc="git commit" @@ -117,18 +118,19 @@ alias gp="git push" alias gpf="gp --force" alias gpsu="git push --set-upstream" alias gpsuom="git push --set-upstream origin master" +alias gpall="git remote | xargs -L1 git push" alias gl="git pull --rebase" alias glp="gl && gp" gd() { local commit=$1 if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then - git diff $@ + git diff --color-words $@ return else - git diff "@~${commit:1}^!" + git diff --color-words "@~${commit:1}^!" fi } -alias gds="git diff --staged" +alias gds="git diff --staged --color-words" alias glg="git log --stat --color" alias glog="git log --oneline --decorate --color --graph" From 9812c55f2508a293d0b3ac4730fbcd0959c25ae7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:21:54 +0000 Subject: [PATCH 076/116] Restart shell instead of sourcing configuration --- aliases | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases b/aliases index cfe2c12..c0c9f64 100644 --- a/aliases +++ b/aliases @@ -246,9 +246,9 @@ alias zp=zpool # General Aliases alias ssha='eval `ssh-agent` ; ssh-add' -alias aliases="$EDITOR $DOTFILES/aliases ; source ~/.zshrc" +alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh" alias vimrc="$EDITOR ~/.vimrc" -alias zshrc="$EDITOR ~/.zshrc ; source ~/.zshrc" +alias zshrc="$EDITOR ~/.zshrc ; exec zsh" alias xinitrc="$EDITOR ~/.xinitrc" alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources" alias xsession="$EDITOR ~/.xsession" From 2a463c1ea0aea6b640b5f4c6bc686fbf2cdae5df Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:25:52 +0000 Subject: [PATCH 077/116] Enable advanced less options globally --- .profile | 1 + aliases | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index 98fe1ac..4768f33 100644 --- a/.profile +++ b/.profile @@ -9,6 +9,7 @@ export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open export EDITOR="vim" export VISUAL="vim" +export LESS="-RSNI" export PAGER="less -R" export TERMINAL="termite" export BROWSER="chromium" diff --git a/aliases b/aliases index c0c9f64..c8e65e3 100644 --- a/aliases +++ b/aliases @@ -51,7 +51,6 @@ alias mv='mv -i' alias cp='cp -ir' alias pacman='pacman --color=always' alias pacaur='pacaur --color=always' -alias less='less -R' alias tree='tree --dirsfirst -C -F' alias dd='dd status=progress' alias env='env | sort' From 7c129eaf100113ea6d273832b7b3eda32d5bab34 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:46:28 +0000 Subject: [PATCH 078/116] Reorder completion init before zsh-syn-hl --- .zshrc | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.zshrc b/.zshrc index f179305..a6c0ecc 100644 --- a/.zshrc +++ b/.zshrc @@ -23,6 +23,24 @@ fi setopt sharehistory histignorealldups histignorespace histreduceblanks setopt pathdirs autocd autopushd extendedglob alwaystoend dvorak + +# Completion initialisation +autoload -U compinit ; compinit +autoload -U bashcompinit ; bashcompinit + +# gopass completion +if gopass --help &>/dev/null; then + source <(gopass completion bash) +fi + +zstyle ':completion:*:sudo|_::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" +zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' +zstyle ':completion:*' rehash true +zstyle ':completion:*' menu select +zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" +zstyle ':compinstall' filename "$HOME/.zshrc" + + # Load antigen & plugins antigen_src="$ZSH_DIR/antigen.zsh" if [ ! -f "$antigen_src" ]; then @@ -43,14 +61,6 @@ antigen bundle zsh-users/zsh-history-substring-search antigen apply -# Completion initialisation -autoload -U compinit ; compinit -autoload -U bashcompinit ; bashcompinit - -# gopass completion -if gopass --help &>/dev/null; then - source <(gopass completion bash) -fi # Set some key-binds bindkey -e @@ -70,12 +80,6 @@ bindkey '^[^[[3^' x-bash-backward-kill-word bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down -zstyle ':completion:*:sudo|_::' environ PATH="/sbin:/usr/sbin:$PATH" HOME="/root" -zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' -zstyle ':completion:*' rehash true -zstyle :compinstall filename "$HOME/.zshrc" -zstyle ':completion:*:*:*:*:*' menu select -zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) From bb835a83569580b941e299117cb170be17bd7069 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:47:01 +0000 Subject: [PATCH 079/116] Update some syntax-highlighting styles --- .zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index a6c0ecc..2873d08 100644 --- a/.zshrc +++ b/.zshrc @@ -102,10 +102,9 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=cyan' ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green' ZSH_HIGHLIGHT_STYLES[path]='fg=blue' ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=yellow,bold' -ZSH_HIGHLIGHT_STYLES[path_approx]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[globbing]='fg=red' ZSH_HIGHLIGHT_STYLES[comment]='fg=7' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=1' +ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=blue' ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=12' ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=12' ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=magenta' From 4f6330e7a04a9604d4ab00098cdd799cc09504df Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:49:09 +0000 Subject: [PATCH 080/116] Add git pushall alias --- .config/git/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/git/config b/.config/git/config index 2b144cf..84ca685 100644 --- a/.config/git/config +++ b/.config/git/config @@ -2,13 +2,13 @@ name = Joe Groocock email = frebib@gmail.com signingkey = CFBB6A86 - [commit] gpgsign = true [color] ui = auto [alias] - verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr + verbs = !git log --pretty=format:'%s' | cut -d \" \" -f 1 | sort | uniq -c | sort -nr + pushall = !git remote | xargs -L1 git push [rebase] autoStash = true [push] From cc5c1d67abf3c0a2e01a00dc019403fdebfc075d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 15 Nov 2017 23:49:37 +0000 Subject: [PATCH 081/116] set linebreak by default in Vim --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index fd50d87..e22f762 100644 --- a/.vimrc +++ b/.vimrc @@ -8,6 +8,7 @@ set expandtab set smarttab set smartindent set number +set linebreak set autoindent set laststatus=2 set mouse=nicr From f87925864609a541974b69dacadc97b694206a8d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 16 Nov 2017 00:02:58 +0000 Subject: [PATCH 082/116] Use Ctrl+Arrow as well as Alt+Arrow --- .zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.zshrc b/.zshrc index 2873d08..ad8a1ac 100644 --- a/.zshrc +++ b/.zshrc @@ -65,7 +65,9 @@ antigen apply # Set some key-binds bindkey -e bindkey "^[[1;3C" forward-word +bindkey "^[[1;5C" forward-word bindkey "^[[1;3D" backward-word +bindkey "^[[1;5D" backward-word bindkey "^[[7~" beginning-of-line bindkey "^[[8~" end-of-line From da62525a0b8158a9b5109688bb8b2f7a105e8645 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 16 Nov 2017 00:24:10 +0000 Subject: [PATCH 083/116] Antigen is a broken piece of shit --- .config/zsh/{ => plugins}/fish-theme.zsh | 0 .config/zsh/plugins/sudo.zsh | 19 +++++++++++++++++++ .zshrc | 9 +++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) rename .config/zsh/{ => plugins}/fish-theme.zsh (100%) create mode 100644 .config/zsh/plugins/sudo.zsh diff --git a/.config/zsh/fish-theme.zsh b/.config/zsh/plugins/fish-theme.zsh similarity index 100% rename from .config/zsh/fish-theme.zsh rename to .config/zsh/plugins/fish-theme.zsh diff --git a/.config/zsh/plugins/sudo.zsh b/.config/zsh/plugins/sudo.zsh new file mode 100644 index 0000000..e1b2317 --- /dev/null +++ b/.config/zsh/plugins/sudo.zsh @@ -0,0 +1,19 @@ +# Source: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/sudo/sudo.plugin.zsh + +sudo-command-line() { + [[ -z $BUFFER ]] && zle up-history + if [[ $BUFFER == sudo\ * ]]; then + LBUFFER="${LBUFFER#sudo }" + elif [[ $BUFFER == $EDITOR\ * ]]; then + LBUFFER="${LBUFFER#$EDITOR }" + LBUFFER="sudoedit $LBUFFER" + elif [[ $BUFFER == sudoedit\ * ]]; then + LBUFFER="${LBUFFER#sudoedit }" + LBUFFER="$EDITOR $LBUFFER" + else + LBUFFER="sudo $LBUFFER" + fi +} +zle -N sudo-command-line +# Defined shortcut keys: [Esc] [Esc] +bindkey "\e\e" sudo-command-line diff --git a/.zshrc b/.zshrc index ad8a1ac..24f4ec2 100644 --- a/.zshrc +++ b/.zshrc @@ -53,7 +53,6 @@ if [ ! -f "$antigen_src" ]; then fi source "$antigen_src" -antigen bundle sudo antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-autosuggestions antigen bundle Tarrasch/zsh-syntax-highlighting @@ -119,5 +118,11 @@ ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=cyan' ZSH_HIGHLIGHT_STYLES[assign]='fg=green' ZSH_HIGHLIGHT_STYLES[redirection]='fg=cyan' -source "$ZSH_DIR/fish-theme.zsh" source "$DOTFILES/aliases" + +# Load some manual plugins +source "$ZSH_DIR/plugins/sudo.zsh" +source "$ZSH_DIR/plugins/fish-theme.zsh" + +# Reload zsh-syntax-highlighting, because reasons -_- +source "$ADOTDIR/bundles/Tarrasch/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" From 878b13b2fa87f82652a0411070bdd6dd9971a3fe Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 16 Nov 2017 00:30:45 +0000 Subject: [PATCH 084/116] Customise sudo plugin to fit my aliases --- .config/zsh/plugins/sudo.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.config/zsh/plugins/sudo.zsh b/.config/zsh/plugins/sudo.zsh index e1b2317..8f3d680 100644 --- a/.config/zsh/plugins/sudo.zsh +++ b/.config/zsh/plugins/sudo.zsh @@ -4,11 +4,13 @@ sudo-command-line() { [[ -z $BUFFER ]] && zle up-history if [[ $BUFFER == sudo\ * ]]; then LBUFFER="${LBUFFER#sudo }" - elif [[ $BUFFER == $EDITOR\ * ]]; then + elif [[ $BUFFER == $EDITOR\ * ]] || [[ $BUFFER == vi\ * ]]; then LBUFFER="${LBUFFER#$EDITOR }" - LBUFFER="sudoedit $LBUFFER" - elif [[ $BUFFER == sudoedit\ * ]]; then + LBUFFER="${LBUFFER#vi }" + LBUFFER="svi $LBUFFER" + elif [[ $BUFFER == sudoedit\ * ]] || [[ $BUFFER == svi\ * ]]; then LBUFFER="${LBUFFER#sudoedit }" + LBUFFER="${LBUFFER#svi }" LBUFFER="$EDITOR $LBUFFER" else LBUFFER="sudo $LBUFFER" From b22ae1cbd6f934b67d9f1603e6a4fc65d3bd12b4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 16 Nov 2017 00:31:47 +0000 Subject: [PATCH 085/116] Update vim plugins --- .vimrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index e22f762..dbb82c8 100644 --- a/.vimrc +++ b/.vimrc @@ -64,12 +64,14 @@ Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'PotatoesMaster/i3-vim-syntax' -Plugin 'solarnz/thrift.vim' -Plugin 'lervag/vimtex' +Plugin 'xuhdev/vim-latex-live-preview' Plugin 'JamshedVesuna/vim-markdown-preview' +Plugin 'tpope/vim-abolish' call vundle#end() +filetype plugin on + set omnifunc=syntaxcomplete#Complete " Vim-Airline config From 707fca2d11ede0f600eaa98f549d1f1ba89a8af0 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 16 Nov 2017 00:43:14 +0000 Subject: [PATCH 086/116] Hacky fix for sudo plugin and zsh-syn-hl --- .config/zsh/plugins/sudo.zsh | 2 ++ .zshrc | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.config/zsh/plugins/sudo.zsh b/.config/zsh/plugins/sudo.zsh index 8f3d680..744e4ab 100644 --- a/.config/zsh/plugins/sudo.zsh +++ b/.config/zsh/plugins/sudo.zsh @@ -15,6 +15,8 @@ sudo-command-line() { else LBUFFER="sudo $LBUFFER" fi + + _zsh_highlight } zle -N sudo-command-line # Defined shortcut keys: [Esc] [Esc] diff --git a/.zshrc b/.zshrc index 24f4ec2..c26888c 100644 --- a/.zshrc +++ b/.zshrc @@ -123,6 +123,3 @@ source "$DOTFILES/aliases" # Load some manual plugins source "$ZSH_DIR/plugins/sudo.zsh" source "$ZSH_DIR/plugins/fish-theme.zsh" - -# Reload zsh-syntax-highlighting, because reasons -_- -source "$ADOTDIR/bundles/Tarrasch/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" From 8e1299ca5b93600c9857083d685b3bb8c800f05d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 17 Nov 2017 13:09:36 +0000 Subject: [PATCH 087/116] Wrap lines again in less --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 4768f33..025e32b 100644 --- a/.profile +++ b/.profile @@ -9,8 +9,8 @@ export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open export EDITOR="vim" export VISUAL="vim" -export LESS="-RSNI" -export PAGER="less -R" +export LESS="-RNI" +export PAGER="less $LESS" export TERMINAL="termite" export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" From 7afdacabbe2cce189e86902e896e7e771cbb9080 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 17 Nov 2017 13:09:58 +0000 Subject: [PATCH 088/116] Don't background an already forking process --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 025e32b..a830baa 100644 --- a/.profile +++ b/.profile @@ -25,8 +25,8 @@ fi # Merge system clipboards if [ -n "$DISPLAY" ] && which autocutsel &>/dev/null; then - autocutsel -fork & - autocutsel -selection PRIMARY -fork & + autocutsel -fork + autocutsel -selection PRIMARY -fork fi if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then From 5cb4694c6e7fc15ed075449e01132a37ea3e12b1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 22 Nov 2017 12:49:46 +0000 Subject: [PATCH 089/116] Auto start latex preview in *.tex files --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index dbb82c8..2c4bda5 100644 --- a/.vimrc +++ b/.vimrc @@ -186,3 +186,4 @@ cmap w!! w !sudo tee > /dev/null % autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et +autocmd FileType tex LLPStartPreview From 85373cf577f4790f30840792d47af00c2657a384 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 22 Nov 2017 12:50:57 +0000 Subject: [PATCH 090/116] Add missing rd alias --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index c8e65e3..8fe3a99 100644 --- a/aliases +++ b/aliases @@ -17,6 +17,7 @@ alias lat='la -t' alias al=la # No, I don't need the Mono Assembly Linker alias md="mkdir -p" +alias rd="rmdir -p" mcd(){ mkdir -p $1 && cd $1 } From f556507fabb3cc02d981357315ff8a490377f0f8 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 23 Nov 2017 19:07:36 +0000 Subject: [PATCH 091/116] Reinstall lervag/vimtex and cleanup vimrc --- .vimrc | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.vimrc b/.vimrc index 2c4bda5..02001a7 100644 --- a/.vimrc +++ b/.vimrc @@ -1,6 +1,7 @@ set nocompatible " be iMproved, required syntax enable +filetype plugin on set tabstop=4 set shiftwidth=0 " Use tabstop set softtabstop=-1 " Use tabstop @@ -28,8 +29,8 @@ set scrolloff=6 set autowriteall set nojoinspaces -"nnoremap -"nnoremap +nnoremap +nnoremap " Search options set hlsearch @@ -44,12 +45,6 @@ set guioptions= set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< -nnoremap -nnoremap - -" Change to dvorak-mapped keys -let g:use_dvorak = 1 - " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -58,21 +53,22 @@ Plugin 'VundleVim/Vundle.vim' Plugin 'Valloric/YouCompleteMe' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-sensible' +Plugin 'tpope/vim-fugitive' +Plugin 'tpope/vim-rhubarb' +Plugin 'tpope/vim-abolish' Plugin 'vim-scripts/vim-auto-save' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'PotatoesMaster/i3-vim-syntax' -Plugin 'xuhdev/vim-latex-live-preview' +Plugin 'lervag/vimtex' Plugin 'JamshedVesuna/vim-markdown-preview' -Plugin 'tpope/vim-abolish' call vundle#end() -filetype plugin on - -set omnifunc=syntaxcomplete#Complete +" Change to dvorak-mapped keys +let g:use_dvorak = 1 " Vim-Airline config let g:Powerline_symbols = 'fancy' @@ -89,6 +85,14 @@ let vim_markdown_preview_browser='Chromium' let vim_markdown_preview_use_xdg_open=1 let vim_markdown_preview_github=1 +" lervag/vimtex plugin +nmap (vimtex-env-delete) +nmap (vimtex-cmd-delete) +nmap (vimtex-env-delete-math) +nmap (vimtex-env-toggle-star) +nmap (vimtex-delim-toggle-modifier) +xmap (vimtex-delim-toggle-modifier) + let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] @@ -139,10 +143,10 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) nnoremap nnoremap - "nnoremap h - "nnoremap j - "nnoremap k - "nnoremap l + nnoremap h + nnoremap j + nnoremap k + nnoremap l " Account for tag jumping nnoremap @@ -186,4 +190,3 @@ cmap w!! w !sudo tee > /dev/null % autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et -autocmd FileType tex LLPStartPreview From 004875f664f75fdab62bae2b071925d3da50ecae Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 23 Nov 2017 19:15:43 +0000 Subject: [PATCH 092/116] Move .vim{,rc} to .config --- .config/imgur-screenshot/settings.conf | 4 +++- .config/vim/.gitignore | 6 ++++++ {.vim => .config/vim}/ftplugin/javascript/config.vim | 0 {.vim => .config/vim}/ftplugin/ocaml/config.vim | 0 {.vim => .config/vim}/ftplugin/ocaml/keybinds.vim | 0 .vimrc => .config/vim/vimrc | 11 +++++++++-- .profile | 9 +++++++-- aliases | 2 +- 8 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .config/vim/.gitignore rename {.vim => .config/vim}/ftplugin/javascript/config.vim (100%) rename {.vim => .config/vim}/ftplugin/ocaml/config.vim (100%) rename {.vim => .config/vim}/ftplugin/ocaml/keybinds.vim (100%) rename .vimrc => .config/vim/vimrc (93%) diff --git a/.config/imgur-screenshot/settings.conf b/.config/imgur-screenshot/settings.conf index e0821a9..1eeddc4 100644 --- a/.config/imgur-screenshot/settings.conf +++ b/.config/imgur-screenshot/settings.conf @@ -1,5 +1,7 @@ imgur_icon_path="$HOME/.config/imgur-screenshot/imgur.ico" -login="true" +imgur_acct_key="" +imgur_secret="" +login="false" log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log" credentials_file="$HOME/.config/imgur-screenshot/credentials.conf" file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png! diff --git a/.config/vim/.gitignore b/.config/vim/.gitignore new file mode 100644 index 0000000..1a49755 --- /dev/null +++ b/.config/vim/.gitignore @@ -0,0 +1,6 @@ +/bundle/ +/spell/ +/swapfiles/ +/viminfo +/vim-latex +/.netrwhist diff --git a/.vim/ftplugin/javascript/config.vim b/.config/vim/ftplugin/javascript/config.vim similarity index 100% rename from .vim/ftplugin/javascript/config.vim rename to .config/vim/ftplugin/javascript/config.vim diff --git a/.vim/ftplugin/ocaml/config.vim b/.config/vim/ftplugin/ocaml/config.vim similarity index 100% rename from .vim/ftplugin/ocaml/config.vim rename to .config/vim/ftplugin/ocaml/config.vim diff --git a/.vim/ftplugin/ocaml/keybinds.vim b/.config/vim/ftplugin/ocaml/keybinds.vim similarity index 100% rename from .vim/ftplugin/ocaml/keybinds.vim rename to .config/vim/ftplugin/ocaml/keybinds.vim diff --git a/.vimrc b/.config/vim/vimrc similarity index 93% rename from .vimrc rename to .config/vim/vimrc index 02001a7..32030e4 100644 --- a/.vimrc +++ b/.config/vim/vimrc @@ -1,5 +1,10 @@ set nocompatible " be iMproved, required +" Reconfigure Vim to be clean! +set rtp+=~/.config/vim +set directory=.,~/.config/vim +set viminfo+=n~/.config/vim/viminfo + syntax enable filetype plugin on set tabstop=4 @@ -15,7 +20,8 @@ set laststatus=2 set mouse=nicr set encoding=utf-8 set background=dark -set directory=$HOME/.vim/swapfiles// +set directory=$HOME/.config/vim/swapfiles// +set omnifunc=syntaxcomplete#Complete set title set clipboard=unnamed @@ -46,8 +52,9 @@ set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< " set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim +set rtp+=~/.config/vim/bundle/Vundle.vim call vundle#begin() +call vundle#rc('~/.config/vim/bundle') Plugin 'VundleVim/Vundle.vim' Plugin 'Valloric/YouCompleteMe' diff --git a/.profile b/.profile index a830baa..ad4fa9a 100644 --- a/.profile +++ b/.profile @@ -2,11 +2,16 @@ export LC_ALL=en_GB.UTF-8 export LANG=en_GB.UTF-8 export LC_NUMERIC=en_GB -export CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" -export DOTFILES=$CONFIG_DIR/dotfiles +export CONFIG_DIR="$HOME/.config" +export XDG_CONFIG_HOME="$CONFIG_DIR" +export DOTFILES="$CONFIG_DIR/dotfiles" export PATH="${PATH}:$DOTFILES/scripts" export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open +# Allow Vim to load from ~/.config/vim +export MYVIMRC="$CONFIG_DIR/vim/vimrc" +export VIMINIT=":so $MYVIMRC" + export EDITOR="vim" export VISUAL="vim" export LESS="-RNI" diff --git a/aliases b/aliases index 8fe3a99..6ce29c2 100644 --- a/aliases +++ b/aliases @@ -247,7 +247,7 @@ alias zp=zpool # General Aliases alias ssha='eval `ssh-agent` ; ssh-add' alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh" -alias vimrc="$EDITOR ~/.vimrc" +alias vimrc="$EDITOR $MYVIMRC" alias zshrc="$EDITOR ~/.zshrc ; exec zsh" alias xinitrc="$EDITOR ~/.xinitrc" alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources" From 36588f8de570d9174c47185ca47a14e012d27a48 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 23 Nov 2017 20:03:36 +0000 Subject: [PATCH 093/116] Set listchars colour to be less invasive --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 32030e4..87c91fb 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -50,6 +50,7 @@ set guioptions= " Whitespace highlight settings set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< +highlight SpecialKey ctermfg=7 " set the runtime path to include Vundle and initialize set rtp+=~/.config/vim/bundle/Vundle.vim From 3042e747e5e22f2d0e022b69737731c9e97ff2ee Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 23 Nov 2017 21:26:29 +0000 Subject: [PATCH 094/116] Fix vimtex mapping breaking navigation Thanks, lervag! https://github.com/lervag/vimtex/issues/1004 --- .config/vim/vimrc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 87c91fb..3a7603f 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -93,14 +93,6 @@ let vim_markdown_preview_browser='Chromium' let vim_markdown_preview_use_xdg_open=1 let vim_markdown_preview_github=1 -" lervag/vimtex plugin -nmap (vimtex-env-delete) -nmap (vimtex-cmd-delete) -nmap (vimtex-env-delete-math) -nmap (vimtex-env-toggle-star) -nmap (vimtex-delim-toggle-modifier) -xmap (vimtex-delim-toggle-modifier) - let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] @@ -179,6 +171,12 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) noremap zh zj noremap zt zk + " Disable some default vimtex mappings that conflict with rebound keys + let g:vimtex_mappings_disable = { + \ 'n': ['tse', 'tsd', 'tsD', 'tsc', 'dse', 'dsc', 'ds$', 'dsd'], + \ 'x': ['tsd', 'tsD'], + \} + endif " Interface with system clipboard From d51b6dba8045b8949d91332e2a915e84cb195d9e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 23 Nov 2017 21:33:03 +0000 Subject: [PATCH 095/116] Prevent YCM asking for every c file opened --- .config/vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 3a7603f..25943f7 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -78,6 +78,9 @@ call vundle#end() " Change to dvorak-mapped keys let g:use_dvorak = 1 +" YouCompleteMe config +let g:ycm_confirm_extra_conf = 0 + " Vim-Airline config let g:Powerline_symbols = 'fancy' let g:airline_powerline_fonts = 1 From d1ed7c42225e1d368adab21ac64514204278d939 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 24 Nov 2017 00:16:24 +0000 Subject: [PATCH 096/116] Use patience algo for git-diff --- .config/git/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/git/config b/.config/git/config index 84ca685..f510ae5 100644 --- a/.config/git/config +++ b/.config/git/config @@ -20,6 +20,8 @@ rebase = true [core] autocrlf = input +[diff] + algorithm = patience [sendemail] from = Joe Groocock smtpserver = smtp.gmail.com From a24abd9de591edd22a0a5408c5637e52633f32dd Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 24 Nov 2017 00:16:57 +0000 Subject: [PATCH 097/116] Start VimtexCompile when opening a tex file --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 25943f7..c1e4e67 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -199,3 +199,4 @@ cmap w!! w !sudo tee > /dev/null % autocmd FileType markdown setlocal ts=2 sts=2 sw=2 et autocmd FileType yaml setlocal ts=2 sts=2 sw=2 et +autocmd FileType tex silent VimtexCompile From 2dac4b461f3032249cf4994fdab5c6d1e20c11e5 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 26 Nov 2017 00:57:47 +0000 Subject: [PATCH 098/116] Tidy up vimrc and improve autosaving --- .config/vim/vimrc | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index c1e4e67..8174964 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -4,9 +4,11 @@ set nocompatible " be iMproved, required set rtp+=~/.config/vim set directory=.,~/.config/vim set viminfo+=n~/.config/vim/viminfo +set directory=$HOME/.config/vim/swapfiles// syntax enable filetype plugin on + set tabstop=4 set shiftwidth=0 " Use tabstop set softtabstop=-1 " Use tabstop @@ -17,12 +19,9 @@ set number set linebreak set autoindent set laststatus=2 -set mouse=nicr set encoding=utf-8 set background=dark -set directory=$HOME/.config/vim/swapfiles// set omnifunc=syntaxcomplete#Complete - set title set clipboard=unnamed set wildmenu @@ -32,11 +31,11 @@ set ttyfast set autoread set showmatch set scrolloff=6 -set autowriteall set nojoinspaces -nnoremap -nnoremap +" Autosave settings +set autowrite +autocmd InsertLeave * save " Search options set hlsearch @@ -52,6 +51,7 @@ set list set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< highlight SpecialKey ctermfg=7 + " set the runtime path to include Vundle and initialize set rtp+=~/.config/vim/bundle/Vundle.vim call vundle#begin() @@ -64,7 +64,6 @@ Plugin 'tpope/vim-sensible' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-rhubarb' Plugin 'tpope/vim-abolish' -Plugin 'vim-scripts/vim-auto-save' Plugin 'airblade/vim-gitgutter' Plugin 'ryanoasis/vim-devicons' Plugin 'vim-airline/vim-airline' @@ -87,15 +86,18 @@ let g:airline_powerline_fonts = 1 let g:airline_theme='solarized' let g:airline#extensions#tabline#enabled = 1 -" vim-auto-save -let g:auto_save = 1 " enable AutoSave on Vim startup - " vim-markdown plugin let vim_markdown_preview_toggle=0 let vim_markdown_preview_browser='Chromium' let vim_markdown_preview_use_xdg_open=1 let vim_markdown_preview_github=1 + +" Disable mouse +set mouse=nicr +nnoremap +nnoremap + let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] @@ -160,7 +162,7 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) " Remappings for the T key noremap j t - noremap J T + "noremap J T " Remapping for the L key noremap l n @@ -182,12 +184,6 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) endif -" Interface with system clipboard -noremap y "*y -noremap p "*p -noremap Y "+y -noremap P "+p - " Save aliases. noremap q :wq com W w From e446c409ccff3f899da852f845801da583d9e11d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 26 Nov 2017 00:59:13 +0000 Subject: [PATCH 099/116] Poll for iface changes more often --- .config/i3/blocks/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/blocks/config b/.config/i3/blocks/config index 4c7432a..aa1c814 100644 --- a/.config/i3/blocks/config +++ b/.config/i3/blocks/config @@ -49,7 +49,7 @@ signal=10 [iface] label= -interval=300 +interval=60 signal=15 [separator] From 6c87f72663a8f8525f576ba21e59998cadd1f69a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 26 Nov 2017 00:59:45 +0000 Subject: [PATCH 100/116] Always show i3bar on primary output --- .config/i3/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3/config b/.config/i3/config index 8202737..8bdbc63 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -117,6 +117,7 @@ bar { output $bl output $br + output primary position bottom colors { From 5195324dee3a9894f47d9df55b68db722f301d43 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 26 Nov 2017 01:01:28 +0000 Subject: [PATCH 101/116] Update .fehbg script For some reason feh decided to quote everything now --- .fehbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fehbg b/.fehbg index 05f3c2f..94f6942 100755 --- a/.fehbg +++ b/.fehbg @@ -1,2 +1,2 @@ #!/bin/sh -feh --no-xinerama --bg-fill '/home/frebib/pictures/lakesidesunrise.jpg' +'feh' '--no-xinerama' '--bg-fill' '/home/frebib/pictures/lakesidesunrise.jpg' From bd549b64241f06eb8ceb2799999753c26e4c790d Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 11 Dec 2017 14:16:13 +0000 Subject: [PATCH 102/116] Fix man and less line wrapping --- .profile | 1 + 1 file changed, 1 insertion(+) diff --git a/.profile b/.profile index ad4fa9a..526626e 100644 --- a/.profile +++ b/.profile @@ -16,6 +16,7 @@ export EDITOR="vim" export VISUAL="vim" export LESS="-RNI" export PAGER="less $LESS" +export MANPAGER="less -+N" export TERMINAL="termite" export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" From 3351a95a0a3a3c95dbcd73eb81510eac161cf2e3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 18 Dec 2017 16:53:43 +0000 Subject: [PATCH 103/116] Modernise and improve vim-setup script --- .profile | 3 ++- scripts/vim-setup | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.profile b/.profile index 526626e..ce8e579 100644 --- a/.profile +++ b/.profile @@ -9,7 +9,8 @@ export PATH="${PATH}:$DOTFILES/scripts" export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open # Allow Vim to load from ~/.config/vim -export MYVIMRC="$CONFIG_DIR/vim/vimrc" +export VIMDIR="$CONFIG_DIR/vim" +export MYVIMRC="$VIMDIR/vimrc" export VIMINIT=":so $MYVIMRC" export EDITOR="vim" diff --git a/scripts/vim-setup b/scripts/vim-setup index 2810569..3719dce 100755 --- a/scripts/vim-setup +++ b/scripts/vim-setup @@ -1,18 +1,29 @@ -YCM=~/.vim/bundle/YouCompleteMe +#!/bin/sh +set -e -sudo pacman -Sy python cmake clang --needed --noconfirm +############################ +## Check for dependencies ## +############################ +error() { >&2 printf "Error: %s" "$1"; exit 1; } + +which cmake >/dev/null 2>&1 || error 'cmake is not installed' +which clang >/dev/null 2>&1 || error 'clang is not installed' +which python >/dev/null 2>&1 || error 'python is not installed' + +[ -z "$VIMDIR" ] && error '$VIMDIR is not set' ####################### ## Initialise Vundle ## ####################### -mkdir -p ~/.vim/{bundle,swapfiles} -git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim +mkdir -p "$VIMDIR/bundle" "$VIMDIR/swapfiles" +if [ ! -d "$VIMDIR/bundle/Vundle.vim" ]; then + git clone https://github.com/VundleVim/Vundle.vim.git "$VIMDIR/bundle/Vundle.vim" +fi vim +PluginUpdate +qall - ######################### ## Setup YouCompleteMe ## ######################### -cd "$YCM" +cd "$VIMDIR/bundle/YouCompleteMe" git submodule update --init --recursive ./install.py --system-libclang --clang-completer From a4aa5c0830f218bc9ec79e5c224db0ba64787f2b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 18 Dec 2017 17:13:42 +0000 Subject: [PATCH 104/116] Fix bash-isms in .profile, causing errors on some devices --- .profile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.profile b/.profile index ce8e579..b4ed5f4 100644 --- a/.profile +++ b/.profile @@ -31,17 +31,17 @@ if [ -f "$CONFIG_DIR/secrets" ]; then fi # Merge system clipboards -if [ -n "$DISPLAY" ] && which autocutsel &>/dev/null; then +if [ -n "$DISPLAY" ] && which autocutsel >/dev/null 2>&1; then autocutsel -fork autocutsel -selection PRIMARY -fork fi -if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then +if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && which dbus-launch >/dev/null 2>&1; then eval $(dbus-launch --sh-syntax --exit-with-session) dbus-update-activation-environment --systemd DISPLAY fi # Start the gnome-keyring if it's installed -if which gnome-keyring-daemon &>/dev/null; then +if which gnome-keyring-daemon >/dev/null 2>&1; then export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg) fi From cada40f9bec688c6df9cc58247aa08e62cecd1a1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 26 Dec 2017 15:42:32 +0000 Subject: [PATCH 105/116] Fix Del & Alt+Del key sequences --- .zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.zshrc b/.zshrc index c26888c..8cad46c 100644 --- a/.zshrc +++ b/.zshrc @@ -69,6 +69,8 @@ bindkey "^[[1;3D" backward-word bindkey "^[[1;5D" backward-word bindkey "^[[7~" beginning-of-line bindkey "^[[8~" end-of-line +bindkey "^[[3~" delete-char +bindkey "^[[3;3~" delete-word export WORDCHARS='*?_[]~=&;!#$%^(){}' x-bash-backward-kill-word(){ From 7301d2476ee3fc9c18724d41262abdf7befbde1c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 26 Jan 2018 23:44:24 +0000 Subject: [PATCH 106/116] add global gitignore --- .config/git/config | 1 + .config/git/gitignore | 1 + aliases | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 .config/git/gitignore diff --git a/.config/git/config b/.config/git/config index f510ae5..52e1148 100644 --- a/.config/git/config +++ b/.config/git/config @@ -20,6 +20,7 @@ rebase = true [core] autocrlf = input + excludesfile = /home/frebib/.config/git/gitignore [diff] algorithm = patience [sendemail] diff --git a/.config/git/gitignore b/.config/git/gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.config/git/gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/aliases b/aliases index 6ce29c2..32460c8 100644 --- a/aliases +++ b/aliases @@ -93,6 +93,7 @@ alias -s git="git clone --recursive" # Git Aliases alias g=git alias gignore='$EDITOR .gitignore' +alias ggignore='$EDITOR ~/.config/git/gitignore' alias gcl="git clone --recursive" alias gco="git checkout" alias gcom="git checkout master" @@ -249,6 +250,7 @@ alias ssha='eval `ssh-agent` ; ssh-add' alias aliases="$EDITOR $DOTFILES/aliases ; exec zsh" alias vimrc="$EDITOR $MYVIMRC" alias zshrc="$EDITOR ~/.zshrc ; exec zsh" +alias gitrc="$EDITOR ~/.config/git/config" alias xinitrc="$EDITOR ~/.xinitrc" alias xresources="$EDITOR ~/.Xresources ; xrdb merge ~/.Xresources" alias xsession="$EDITOR ~/.xsession" From 30c680db3fd3bd0e5cbd36e5b9f3c7347fd497b2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 14 Feb 2018 18:52:26 +0000 Subject: [PATCH 107/116] Fix volume desync with xbindkeys --- .config/i3/config | 4 ++-- .xbindkeysrc | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 8bdbc63..61f41cc 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -175,8 +175,8 @@ bindsym XF86AudioPause exec --no-startup-id mpc pause bindsym XF86AudioStop exec --no-startup-id mpc stop bindsym XF86AudioNext exec --no-startup-id mpc next bindsym XF86AudioPrev exec --no-startup-id mpc previous -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +2% && pkill -RTMIN+10 i3blocks -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -2% && pkill -RTMIN+10 i3blocks +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000 && pkill -RTMIN+10 i3blocks +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000 && pkill -RTMIN+10 i3blocks bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+10 i3blocks exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; done" diff --git a/.xbindkeysrc b/.xbindkeysrc index 9e4f8b0..44a9751 100644 --- a/.xbindkeysrc +++ b/.xbindkeysrc @@ -1,15 +1,15 @@ -# thumb wheel up => increase volume and unmute -"amixer -D pulse set Master 1000+ unmute ; pkill -RTMIN+10 i3blocks" - b:6 - -# thumb wheel down => lower volume -"amixer -D pulse set Master 1000- ; pkill -RTMIN+10 i3blocks" - b:7 - -# backward button => previous song -"xte 'key XF86AudioPrev'" - b:8 - -# forward button => next song -"xte 'key XF86AudioNext'" +# thumb wheel up => increase volume and unmute +"xdotool key --clearmodifiers XF86AudioRaiseVolume" + b:6 + +# thumb wheel down => lower volume +"xdotool key --clearmodifiers XF86AudioLowerVolume" + b:7 + +# backward button => previous song +"xte 'key XF86AudioPrev'" + b:8 + +# forward button => next song +"xte 'key XF86AudioNext'" b:9 From 2268a03a8a53983e6ec62d28ae763ca4f0ac04ae Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 12:43:25 +0000 Subject: [PATCH 108/116] Use persistent volume block Modified from https://github.com/vivien/i3blocks-contrib/tree/master/volume-pulseaudio --- .config/i3/blocks/config | 3 +- .config/i3/blocks/volume | 249 ++++++++++++++++++++++++++------------- .config/i3/config | 10 +- 3 files changed, 176 insertions(+), 86 deletions(-) diff --git a/.config/i3/blocks/config b/.config/i3/blocks/config index aa1c814..0487ca5 100644 --- a/.config/i3/blocks/config +++ b/.config/i3/blocks/config @@ -41,8 +41,7 @@ separator_block_width=12 #interval=persist [volume] -instance=Master -interval=10 +interval=persist signal=10 [separator] diff --git a/.config/i3/blocks/volume b/.config/i3/blocks/volume index f33b059..b8594e1 100755 --- a/.config/i3/blocks/volume +++ b/.config/i3/blocks/volume @@ -1,93 +1,182 @@ #!/bin/bash -# Copyright (C) 2014 Julien Bonjean -# Copyright (C) 2014 Alexander Keller +# Displays the default device, volume, and mute status for i3blocks -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +AUDIO_HIGH_SYMBOL=' ' -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +AUDIO_MED_THRESH=59 +AUDIO_MED_SYMBOL=' ' -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +AUDIO_LOW_THRESH=0 +AUDIO_LOW_SYMBOL=' ' -#------------------------------------------------------------------------ +AUDIO_MUTED_SYMBOL='X' -# The second parameter overrides the mixer selection -# For PulseAudio users, use "pulse" -# For Jack/Jack2 users, use "jackplug" -# For ALSA users, you may use "default" for your primary card -# or you may use hw:# where # is the number of the card desired -MIXER="default" -[ -n "$(lsmod | grep pulse)" ] && MIXER="pulse" -[ -n "$(lsmod | grep jack)" ] && MIXER="jackplug" -MIXER="${2:-$MIXER}" +AUDIO_INTERVAL=5 -# The instance option sets the control to report and configure -# This defaults to the first control of your selected mixer -# For a list of the available, use `amixer -D $Your_Mixer scontrols` -SCONTROL="${BLOCK_INSTANCE:-$(amixer -D $MIXER scontrols | - sed -n "s/Simple mixer control '\([A-Za-z ]*\)',0/\1/p" | - head -n1 - )}" +DEFAULT_COLOR="#ffffff" +MUTED_COLOR="#a0a0a0" -# The first parameter sets the step to change the volume by (and units to display) -# This may be in in % or dB (eg. 5% or 3dB) -STEP="${1:-2%}" +LONG_FORMAT=0 +SHORT_FORMAT=3 +USE_PERCENT=0 +USE_ALSA_NAME=0 +USE_DESCRIPTION=0 +SUBSCRIBE=1 -#------------------------------------------------------------------------ +while getopts F:Sf:padH:M:L:X:T:t:C:c:i:m:s:h opt; do + case "$opt" in + S) SUBSCRIBE=1 ;; + F) LONG_FORMAT="$OPTARG" ;; + f) SHORT_FORMAT="$OPTARG" ;; + p) USE_PERCENT=0 ;; + a) USE_ALSA_NAME=1 ;; + d) USE_DESCRIPTION=1 ;; + H) AUDIO_HIGH_SYMBOL="$OPTARG" ;; + M) AUDIO_MED_SYMBOL="$OPTARG" ;; + L) AUDIO_LOW_SYMBOL="$OPTARG" ;; + X) AUDIO_MUTED_SYMBOL="$OPTARG" ;; + T) AUDIO_MED_THRESH="$OPTARG" ;; + t) AUDIO_LOW_THRESH="$OPTARG" ;; + C) DEFAULT_COLOR="$OPTARG" ;; + c) MUTED_COLOR="$OPTARG" ;; + i) AUDIO_INTERVAL="$OPTARG" ;; + m) MIXER="$OPTARG" ;; + s) SCONTROL="$OPTARG" ;; + h) printf \ +"Usage: volume-pulseaudio [-S] [-F format] [-f format] [-p] [-a|-d] [-H symb] [-M symb] + [-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-i inter] + [-m mixer] [-s scontrol] [-h] +Options: +-F, -f\tOutput format (-F long format, -f short format) to use, amongst: +\t0\t symb vol [index:name]\t (default long) +\t1\t symb vol [name] +\t2\t symb vol [index]\t (default short) +\t3\t symb vol +-S\tSubscribe to volume events (requires persistent block, always uses long format) +-p\tOmit the percent sign (%%) in volume +-a\tUse ALSA name if possible +-d\tUse device description instead of name if possible +-H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL' +-M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL' +-L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL' +-X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL' +-T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH +-t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH +-C\tColor for non-muted audio. Default: $DEFAULT_COLOR +-c\tColor for muted audio. Default: $MUTED_COLOR +-i\tInterval size of volume increase/decrease. Default: $AUDIO_INTERVAL +-m\tUse the given mixer. +-s\tUse the given scontrol. +-h\tShow this help text +" && exit 0;; + esac +done -capability() { # Return "Capture" if the device is a capture device - amixer -D $MIXER get $SCONTROL | - sed -n "s/ Capabilities:.*cvolume.*/Capture/p" -} - -volume() { - amixer -D $MIXER get $SCONTROL $(capability) -} - -format() { - perl_filter='if (/.*\[(\d+)%\] (\[(-?\d+.\d+)dB\] )?\[(on|off)\]/)' - perl_filter+='{CORE::say $4 eq "off" ? "-1" : "' - perl_filter+=$([[ $STEP = *dB ]] && echo '$3' || echo '$1') - perl_filter+='"; exit}' - perl -ne "$perl_filter" -} - -#------------------------------------------------------------------------ - -case $BLOCK_BUTTON in - 1) pavucontrol &>/dev/null &;; - 2) ~/.config/i3/cycleaudio.py;; - 3) amixer -q -D $MIXER sset $SCONTROL $(capability) toggle ;; # right click, mute/unmute - 4) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}+ unmute ;; # scroll up, increase - 5) amixer -q -D $MIXER sset $SCONTROL $(capability) ${STEP}- unmute ;; # scroll down, decrease -esac - -#------------------------------------------------------------------------ - -VOL=$(volume | format) - -ACTIVE=$(pacmd list-sinks | grep '* index' | awk -F": " '{print $2}') - -if pactl list short sinks | grep -q \^$ACTIVE".*Yeti"; then - printf "" -elif pactl list short sinks | grep -q \^$ACTIVE".*bluez"; then - printf " " -elif [ "$VOL" -eq -1 ]; then - printf "X" - exit 0 -elif [ "$VOL" -eq 0 ]; then - printf "" -elif [ "$VOL" -gt 59 ]; then - printf "" -else - printf "" +if [[ -z "$MIXER" ]] ; then + MIXER="default" + if amixer -D pulse info >/dev/null 2>&1 ; then + MIXER="pulse" + fi fi -printf " $VOL" +if [[ -z "$SCONTROL" ]] ; then + SCONTROL=$(amixer -D "$MIXER" scontrols | sed -n "s/Simple mixer control '\([^']*\)',0/\1/p" | head -n1) +fi + +CAPABILITY=$(amixer -D $MIXER get $SCONTROL | sed -n "s/ Capabilities:.*cvolume.*/Capture/p") + + +function move_sinks_to_new_default { + DEFAULT_SINK=$1 + pacmd list-sink-inputs | grep index: | grep -o '[0-9]\+' | while read SINK + do + pacmd move-sink-input $SINK $DEFAULT_SINK + done +} + +function set_default_playback_device_next { + inc=${1:-1} + num_devices=$(pacmd list-sinks | grep -c index:) + sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+')) + default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 )) + default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices )) + default_sink=${sink_arr[$default_sink_index]} + pacmd set-default-sink $default_sink + move_sinks_to_new_default $default_sink +} + +case "$BLOCK_BUTTON" in + 1) set_default_playback_device_next ;; + 2) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY toggle ;; + 3) set_default_playback_device_next -1 ;; + 4) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%+ ;; + 5) amixer -q -D $MIXER sset $SCONTROL $CAPABILITY $AUDIO_INTERVAL%- ;; +esac + +function print_format { + PERCENT="%" + [[ $USE_PERCENT == 0 ]] && PERCENT="" + case "$1" in + 1) echo "$SYMBOL$VOL$PERCENT [$NAME]" ;; + 2) echo "$SYMBOL$VOL$PERCENT [$INDEX]";; + 3) echo "$SYMBOL$VOL$PERCENT" ;; + *) echo "$SYMBOL$VOL$PERCENT [$INDEX:$NAME]" ;; + esac +} + +function print_block { + for name in INDEX NAME VOL MUTED; do + read $name + done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*') + INDEX=$(echo "$INDEX" | grep -o '[0-9]\+') + VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 ) + VOL="${VOL%?}" + + NAME=$(echo "$NAME" | sed \ +'s/.*<.*\.\(.*\)>.*/\1/; t;'\ +'s/.*<\(.*\)>.*/\1/; t;'\ +'s/.*/unknown/') + + if [[ $USE_ALSA_NAME == 1 ]] ; then + ALSA_NAME=$(pacmd list-sinks |\ +awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\ +grep "alsa.name\|alsa.mixer_name" |\ +head -n1 |\ +sed 's/.*= "\(.*\)".*/\1/') + NAME=${ALSA_NAME:-$NAME} + elif [[ $USE_DESCRIPTION == 1 ]] ; then + DESCRIPTION=$(pacmd list-sinks |\ +awk '/^\s*\*/{f=1}/^\s*index:/{f=0}f' |\ +grep "device.description" |\ +head -n1 |\ +sed 's/.*= "\(.*\)".*/\1/') + NAME=${DESCRIPTION:-$NAME} + fi + + if [[ $MUTED =~ "no" ]] ; then + SYMBOL=$AUDIO_HIGH_SYMBOL + [[ $VOL -le $AUDIO_MED_THRESH ]] && SYMBOL=$AUDIO_MED_SYMBOL + [[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMBOL=$AUDIO_LOW_SYMBOL + COLOR=$DEFAULT_COLOR + else + SYMBOL=$AUDIO_MUTED_SYMBOL + COLOR=$MUTED_COLOR + VOL="" + fi + +# if [[ $SUBSCRIBE == 1 ]] ; then +# print_format "$LONG_FORMAT" +# else +# print_format "$LONG_FORMAT" + print_format "$SHORT_FORMAT" +# echo "$COLOR" +# fi +} + +print_block +if [[ $SUBSCRIBE == 1 ]] ; then + while read -r EVENT; do + print_block + done < <(pactl subscribe | stdbuf -oL grep change) +fi diff --git a/.config/i3/config b/.config/i3/config index 61f41cc..977dc06 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -175,10 +175,12 @@ bindsym XF86AudioPause exec --no-startup-id mpc pause bindsym XF86AudioStop exec --no-startup-id mpc stop bindsym XF86AudioNext exec --no-startup-id mpc next bindsym XF86AudioPrev exec --no-startup-id mpc previous -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000 && pkill -RTMIN+10 i3blocks -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000 && pkill -RTMIN+10 i3blocks -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+10 i3blocks -exec --no-startup-id "ip monitor | while read line; do pkill -RTMIN+15 i3blocks; done" +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1000 +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1000 +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86MonBrightnessUp exec xbacklight -inc 5 && pkill -RTMIN+12 i3blocks +bindsym XF86MonBrightnessDown exec xbacklight -dec 5 && pkill -RTMIN+12 i3blocks +exec --no-startup-id "ip monitor | while read; do pkill -RTMIN+15 i3blocks; done" # app launch shortcuts exec --no-startup-id ~/.fehbg From 885cc62671614753fee3218ae357028d6f6bf880 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 12:44:00 +0000 Subject: [PATCH 109/116] compton: don't blur onboard/slop(maim) background --- .config/compton.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/compton.conf b/.config/compton.conf index ddd55ef..fc2c69d 100644 --- a/.config/compton.conf +++ b/.config/compton.conf @@ -29,7 +29,7 @@ alpha-step = 0.06; # XRender backend: Step size for alpha pictures. Increasin #inactive-dim-fixed = true; # Do not let dimness adjust based on window opacity. inactive-opacity-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ]; blur-background = true; # Blur background of transparent windows. -blur-background-exclude = [ "class_g = 'Peek'" ]; +blur-background-exclude = [ "class_g = 'Peek'", "class_g = 'Onboard'", "class_g = 'slop'" ]; blur-background-frame = false; # Blur background of opaque windows with transparent # frames as well. blur-background-fixed = true; # Do not let blur radius adjust based on window opacity. From 3890246f83ae61f965ffd7dd7c13def762dcedba Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 12:44:50 +0000 Subject: [PATCH 110/116] maim: replace scrot with maim for screenshots --- .config/i3/lock.sh | 19 +++++++++---------- .config/imgur-screenshot/settings.conf | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh index 53217ca..43c383c 100755 --- a/.config/i3/lock.sh +++ b/.config/i3/lock.sh @@ -5,9 +5,6 @@ tmpbg='/tmp/screen.png' (( $# )) && { icon=$1; } -# screenshot -scrot "$tmpbg" - PX=0 PY=0 # lockscreen image info @@ -25,17 +22,19 @@ SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset PX=$(($SROX + $SRX/2 - $RX/2)) PY=$(($SROY + $SRY/2 - $RY/2)) +# screenshot, pixelise and overlay +maim | convert - -scale 5% -scale 2000% $icon -geometry +$PX+$PY -composite -matte $tmpbg -# pixelize and add lock icon -convert $tmpbg -scale 5% -scale 2000% $tmpbg -convert $tmpbg $icon -geometry +$PX+$PY -composite -matte $tmpbg - -playing=$(mpc status | grep playing | wc -l) -[[ $playing == 1 ]] && mpc pause +if command mpc 2>&1 1>/dev/null; then + playing=$(mpc status | grep playing | wc -l) + [[ $playing == 1 ]] && mpc pause +fi i3lock -i "$tmpbg" -n -e -[[ $playing == 1 ]] && mpc play +if command mpc 2>&1 1>/dev/null; then + [[ $playing == 1 ]] && mpc play +fi rm "$tmpbg" diff --git a/.config/imgur-screenshot/settings.conf b/.config/imgur-screenshot/settings.conf index 1eeddc4..301164f 100644 --- a/.config/imgur-screenshot/settings.conf +++ b/.config/imgur-screenshot/settings.conf @@ -4,10 +4,10 @@ imgur_secret="" login="false" log_file="$HOME/.config/imgur-screenshot/imgur-screenshot.log" credentials_file="$HOME/.config/imgur-screenshot/credentials.conf" -file_name_format="scrot-%Y-%m-%d--%H:%M:%S.png" # when using scrot, must end with .png! +file_name_format="screenshot-%Y-%m-%d-%H%M%S.png" # when using scrot, must end with .png! file_dir="$HOME/pictures/screenshots" -screenshot_select_command="scrot -q 0 -s %img" -screenshot_window_command="scrot -q 0 -b %img" +screenshot_select_command="maim -m 10 -us %img" +screenshot_window_command="maim -m 10 -uw %img" edit_command="gimp %img" edit="false" exit_on_selection_fail="true" From 74b9523476ff27bbcac2aa60d6010249db9f92fc Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 13:03:01 +0000 Subject: [PATCH 111/116] Use persistent CPU usage block --- .config/i3/blocks/config | 2 +- .config/i3/blocks/cpu_usage | 72 +++++++++++++------------------------ 2 files changed, 26 insertions(+), 48 deletions(-) diff --git a/.config/i3/blocks/config b/.config/i3/blocks/config index 0487ca5..5b764ee 100644 --- a/.config/i3/blocks/config +++ b/.config/i3/blocks/config @@ -62,7 +62,7 @@ signal=5 [cpu_usage] label= -interval=2 +interval=persist [separator] diff --git a/.config/i3/blocks/cpu_usage b/.config/i3/blocks/cpu_usage index c0d659a..1703296 100755 --- a/.config/i3/blocks/cpu_usage +++ b/.config/i3/blocks/cpu_usage @@ -1,53 +1,31 @@ -#!/usr/bin/perl -# -# Copyright 2014 Pierre Mavro -# Copyright 2014 Vivien Didelot -# Copyright 2014 Andreas Guldstrand -# -# Licensed under the terms of the GNU GPL v3, or any later version. +#!/bin/bash +# by Paul Colby (http://colby.id.au), no rights reserved ;) +# https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated -use strict; -use warnings; -use utf8; -use Getopt::Long; +PREV_TOTAL=0 +PREV_IDLE=0 -# default values -my $t_warn = 50; -my $t_crit = 80; -my $cpu_usage = -1; +while true; do + # Get the total CPU statistics, discarding the 'cpu ' prefix. + CPU=(`sed -n 's/^cpu\s//p' /proc/stat`) + IDLE=${CPU[3]} # Just the idle CPU time. -sub help { - print "Usage: cpu_usage [-w ] [-c ]\n"; - print "-w : warning threshold to become yellow\n"; - print "-c : critical threshold to become red\n"; - exit 0; -} + # Calculate the total CPU time. + TOTAL=0 + for VALUE in "${CPU[@]}"; do + let "TOTAL=$TOTAL+$VALUE" + done -GetOptions("help|h" => \&help, - "w=i" => \$t_warn, - "c=i" => \$t_crit); + # Calculate the CPU usage since we last checked. + let "DIFF_IDLE=$IDLE-$PREV_IDLE" + let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" + let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" + echo -e "$DIFF_USAGE%\n$DIFF_USAGE%" -# Get CPU usage -$ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is -open (MPSTAT, 'mpstat 1 1 |') or die 'Cannot run mpstat'; -while () { - if (/^.*\s+(\d+\.\d+)\s+$/) { - $cpu_usage = 100 - $1; # 100% - %idle - last; - } -} -close(MPSTAT); + # Remember the total and idle CPU times for the next check. + PREV_TOTAL="$TOTAL" + PREV_IDLE="$IDLE" -#$cpu_usage eq -1 and die 'Can\'t find CPU information'; - -# Print short_text, full_text -printf "%.0f%%\n"x2, $cpu_usage; - -# Print color, if needed -if ($cpu_usage >= $t_crit) { - print "#FF0000\n"; -} elsif ($cpu_usage >= $t_warn) { - print "#FFCB00\n"; -} - -exit 0; + # Wait before checking again. + sleep 1 +done From 3faad3df4b18968bf7c02b498bf52634dc85dc16 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 13:03:37 +0000 Subject: [PATCH 112/116] Add/improve various shell aliases --- aliases | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/aliases b/aliases index 32460c8..c97eea2 100644 --- a/aliases +++ b/aliases @@ -11,16 +11,15 @@ alias ..ll="cd..;ll" alias ..l="..ll" alias l=ll -alias ll="ls -lFh" -alias la="ls -lAFh" -alias lat='la -t' +alias ll="ls -lFh --group-directories-first" +alias la="ls -lAFh --group-directories-first" +alias lt='ls -lAFh --sort=time' alias al=la # No, I don't need the Mono Assembly Linker alias md="mkdir -p" alias rd="rmdir -p" -mcd(){ - mkdir -p $1 && cd $1 -} +mcd(){ mkdir -p $@ && cd $@; } +alias -- -='cd -' alias cdt='cd `mktemp -d`' alias grep='grep --color' alias -g H='| head' @@ -53,6 +52,7 @@ alias cp='cp -ir' alias pacman='pacman --color=always' alias pacaur='pacaur --color=always' alias tree='tree --dirsfirst -C -F' +alias make="make -j$(nproc)" alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" @@ -132,6 +132,7 @@ gd() { fi } alias gds="git diff --staged --color-words" +alias gsh="git show --color-words" alias glg="git log --stat --color" alias glog="git log --oneline --decorate --color --graph" @@ -148,7 +149,7 @@ alias grro="grr origin" alias gsta='git stash' alias gstd='gsta drop' -alias gstl='gsta list' +alias gstl='gsta list --stat --color' alias gstp='gsta pop' alias gstv="gsta show -p stash@{0}" From eba5e15cf862ebbd3a3fc89b9b0502410f888587 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 13:21:08 +0000 Subject: [PATCH 113/116] Add cmake build directories to global gitignore --- .config/git/gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/git/gitignore b/.config/git/gitignore index 9f11b75..4ce3357 100644 --- a/.config/git/gitignore +++ b/.config/git/gitignore @@ -1 +1,2 @@ .idea/ +cmake-build-*/ From 8ab712c37e510e4477f4901e1430dcf6aeaaaf0c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 22 Feb 2018 13:24:11 +0000 Subject: [PATCH 114/116] Print decrypted GPG messages into a terminal --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index 977dc06..7e92a8d 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -166,7 +166,7 @@ bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3 bindsym --release Print exec imgur-screenshot bindsym --release $mod+Print exec imgur-screenshot -f bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks -bindsym $mod+numbersign exec notify-send "$(xclip -o | gpg --decrypt 2>&1)" +bindsym $mod+numbersign exec "termite -e 'sh -c xclip\ -o\ |\ gpg\ --decrypt\ 2>&1\ &&\ read'" bindsym $mod+g exec "LINK=$(gist -PRpc); notify-send -c transfer \\"$LINK\\"" # Media player controls From b013a98e0dfb8bbf1938c728741829898e482b63 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 24 Feb 2018 11:08:40 +0000 Subject: [PATCH 115/116] i3/config: add rofi-emoji and rofi-pass keybinds --- .config/fontconfig/fonts.conf | 8 ++-- .config/i3/config | 4 +- scripts/rofi-emoji | 86 +++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 5 deletions(-) create mode 100755 scripts/rofi-emoji diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 02cb4ed..911a4a5 100644 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -5,7 +5,7 @@ sans-serif - + Noto Sans Noto Color Emoji @@ -14,7 +14,7 @@ serif - + Noto Serif Noto Color Emoji @@ -23,7 +23,7 @@ monospace - + Sauce Code Pro Noto Color Emoji @@ -32,7 +32,7 @@ Apple Color Emoji - + Noto Color Emoji diff --git a/.config/i3/config b/.config/i3/config index 7e92a8d..3d347e0 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -151,7 +151,7 @@ focus_follows_mouse yes # keybindings bindsym $mod+Shift+j reload -bindsym $mod+Shift+p restart +#bindsym $mod+Shift+p restart bindsym $mod+c exec chromium bindsym $mod+v exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\" bindsym $mod+Ctrl+v exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\" @@ -163,6 +163,8 @@ bindsym $mod+Ctrl+Shift+Return exec i3-sensible-terminal -r floating-term --ge bindsym $mod+l exec ~/.config/i3/lock.sh # -fg "#CCD3DAE3" -bg "#CC383C4A" -hlbg "#CC5294E2" bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window" +bindsym $mod+Shift+p exec rofi-pass +bindsym $mod+Shift+e exec rofi-emoji bindsym --release Print exec imgur-screenshot bindsym --release $mod+Print exec imgur-screenshot -f bindsym $mod+Mod1+space exec --no-startup-id ~/.config/i3/cycleaudio.py && pkill -RTMIN+10 i3blocks diff --git a/scripts/rofi-emoji b/scripts/rofi-emoji new file mode 100755 index 0000000..3618201 --- /dev/null +++ b/scripts/rofi-emoji @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +# +# Use rofi to pick emoji because that's what this +# century is about apparently... +# +# Requirements: +# rofi, xsel, xdotool, curl, xmllint +# +# Usage: +# 1. Download all emoji +# $ rofi-emoji --download +# +# 2. Run it! +# $ rofi-emoji +# +# Notes: +# * You'll need a emoji font like "Noto Emoji" or "EmojiOne". +# * Confirming an item will automatically paste it WITHOUT +# writing it to your clipboard. +# * Ctrl+C will copy it to your clipboard WITHOUT pasting it. +# + +# Where to save the emojis file. +EMOJI_FILE="$HOME/.cache/emojis.txt" + +# Urls of emoji to download. +# You can remove what you don't need. +URLS=( + 'https://emojipedia.org/people/' + 'https://emojipedia.org/nature/' + 'https://emojipedia.org/food-drink/' + 'https://emojipedia.org/activity/' + 'https://emojipedia.org/travel-places/' + 'https://emojipedia.org/objects/' + 'https://emojipedia.org/symbols/' + 'https://emojipedia.org/flags/' +) + + +function download() { + echo "" > "$EMOJI_FILE" + + for url in "${URLS[@]}"; do + echo "Downloading: $url" + + # Download the list of emoji and remove all the junk around it + emojis=$(curl -s "$url" | \ + xmllint --html \ + --xpath '//ul[@class="emoji-list"]' - 2>/dev/null) + + # Get rid of starting/closing ul tags + emojis=$(echo "$emojis" | head -n -1 | tail -n +1) + + # Extract the emoji and its description + emojis=$(echo "$emojis" | \ + sed -rn 's/.*(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p') + + echo "$emojis" >> "$EMOJI_FILE" + done +} + + +function display() { + emoji=$(cat "$EMOJI_FILE" | grep -v '#' | grep -v '^[[:space:]]*$') + line=$(echo "$emoji" | rofi -dmenu -i -p emoji -kb-custom-1 Ctrl+c $@) + exit_code=$? + + line=($line) + + if [ $exit_code == 0 ]; then + xdotool type --clearmodifiers "${line[0]}" + elif [ $exit_code == 10 ]; then + echo -n "${line[0]}" | xsel -i -b + fi +} + + +if [[ "$1" =~ -D|--download ]]; then + download + exit 0 +elif [[ "$1" =~ -h|--help ]]; then + echo "usage: $0 [-D|--download]" + exit 0 +fi + +display From 1ca210e7666d1887d488a90a486b366b53b4642e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 24 Feb 2018 11:12:16 +0000 Subject: [PATCH 116/116] compton: enable 'use-ewmh-active-win' for reliable focus changes --- .config/compton.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/compton.conf b/.config/compton.conf index fc2c69d..8cd53bb 100644 --- a/.config/compton.conf +++ b/.config/compton.conf @@ -50,7 +50,7 @@ backend = "glx" # Backend to use: "xrender" or "glx". GLX backend is typical # much faster but depends on a sane driver. mark-wmwin-focused = true; # Try to detect WM windows and mark them as active. mark-ovredir-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus). -use-ewmh-active-win = false; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused +use-ewmh-active-win = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused # instead of using FocusIn/Out events. Usually more reliable but # depends on a EWMH-compliant WM. detect-rounded-corners = false; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.