From 10b00353d103829142ffa345a246d5542feacb53 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Tue, 31 Dec 2019 14:26:32 -0700 Subject: [PATCH] more zsh migration work --- config/xserver/screenlayout/workdock.sh | 17 ++++++----- config/xserver/set_randr_layout | 21 ++++++------- tmux/n-bindings.tmux | 32 ++++++++++++++++++++ tmux/tmux.conf | 39 ++++--------------------- vim/file_formatting.vim | 5 ++++ 5 files changed, 62 insertions(+), 52 deletions(-) create mode 100644 tmux/n-bindings.tmux diff --git a/config/xserver/screenlayout/workdock.sh b/config/xserver/screenlayout/workdock.sh index f75d49d..84c29b2 100755 --- a/config/xserver/screenlayout/workdock.sh +++ b/config/xserver/screenlayout/workdock.sh @@ -20,32 +20,35 @@ else fi - - -ROLL=$(($RANDOM%4)); +ROLL=$(($RANDOM%5)); if [ $ROLL -eq 0 ]; then feh --bg-fill\ $HOME/Pictures/bg/midoriya.jpg\ $HOME/Pictures/bg/altaria.jpg\ $HOME/Pictures/bg/captainfalcon.jpg\ - >/dev/null 2>&1 + >/dev/null 2>&1; elif [ $ROLL -eq 1 ]; then feh --bg-fill\ $HOME/Pictures/bg/dimitri.jpg\ $HOME/Pictures/bg/claude.jpg\ $HOME/Pictures/bg/edelgard.jpg\ - >/dev/null 2>&1 + >/dev/null 2>&1; elif [ $ROLL -eq 2 ]; then feh --bg-fill\ $HOME/Pictures/bg/fe8.jpg\ $HOME/Pictures/bg/micaiah.jpg\ $HOME/Pictures/bg/roy.jpg\ - >/dev/null 2>&1 + >/dev/null 2>&1; elif [ $ROLL -eq 3 ]; then feh --bg-fill\ $HOME/Pictures/bg/chrom.png\ $HOME/Pictures/bg/byleth.jpg\ $HOME/Pictures/bg/link.jpg\ - >/dev/null 2>&1 + >/dev/null 2>&1; +elif [ $ROLL -eq 4 ]; then + random_image="$(find $HOME/Pictures/bg -type f | shuf -n 1)"; + feh --bg-fill\ + $random_image\ + >/dev/null 2>&1; fi diff --git a/config/xserver/set_randr_layout b/config/xserver/set_randr_layout index 73057f9..128d22b 100755 --- a/config/xserver/set_randr_layout +++ b/config/xserver/set_randr_layout @@ -2,21 +2,18 @@ source $HOME/.my_zsh_env XSERVER_DIR="$DOTWRYN/config/xserver" -AT_HOME="$(xrandr | grep -q 'HDMI-0 connected')"; -AT_RENT="$(xrandr | grep -q 'DP-0 connected' || xrandr | grep -q 'DP-1 connected')"; +AT_HOME(){ + xrandr -q | grep -q 'HDMI-0 connected'; +} -echo at home >> /home/w0ryn/test -echo $AT_HOME >> /home/w0ryn/test +AT_RENT() { + xrandr -q | grep -q 'DP-[0134] connected'; +} -echo >> /home/w0ryn/test - -echo at rent >> /home/w0ryn/test -echo $AT_RENT >> /home/w0ryn/test - -if $AT_HOME ; then +if AT_HOME; then "$XSERVER_DIR/screenlayout/homedock_hdmionly.sh"; -elif $AT_RENT; then - "$XSERVER_DIR/screenlayout/workdock.sh" +elif AT_RENT; then + "$XSERVER_DIR/screenlayout/workdock.sh"; else; "$XSERVER_DIR/screenlayout/undock.sh"; fi diff --git a/tmux/n-bindings.tmux b/tmux/n-bindings.tmux new file mode 100644 index 0000000..9c29556 --- /dev/null +++ b/tmux/n-bindings.tmux @@ -0,0 +1,32 @@ +# pane switch with vim-like controls +bind -n M-h select-pane -L +bind -n M-j select-pane -D +bind -n M-k select-pane -U +bind -n M-l select-pane -R + +bind -n M-H resize-pane -L 2 +bind -n M-J resize-pane -D 2 +bind -n M-K resize-pane -U 2 +bind -n M-L resize-pane -R 2 + +# alt tab for window shift +bind-key -n M-Tab next-window +bind-key -n M-BTab previous-window + +# alt number for switch +bind-key -n M-1 select-window -t 0 +bind-key -n M-2 select-window -t 1 +bind-key -n M-3 select-window -t 2 +bind-key -n M-4 select-window -t 3 +bind-key -n M-5 select-window -t 4 +bind-key -n M-6 select-window -t 5 +bind-key -n M-7 select-window -t 6 +bind-key -n M-8 select-window -t 7 +bind-key -n M-9 select-window -t 8 + + +# new window and split pane quickly +bind-key -n M-c new-window +bind-key -n M-v split-window -v +bind-key -n M-b split-window -h +bind-key -n M-q killp diff --git a/tmux/tmux.conf b/tmux/tmux.conf index f8d1009..42f7c88 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,40 +1,13 @@ -# pane switch with vim-like controls -bind -n M-h select-pane -L -bind -n M-j select-pane -D -bind -n M-k select-pane -U -bind -n M-l select-pane -R +source-file ~/.wryn/tmux/n-bindings.tmux +# don't use escape key set -s escape-time 0 -bind -n M-H resize-pane -L 2 -bind -n M-J resize-pane -D 2 -bind -n M-K resize-pane -U 2 -bind -n M-L resize-pane -R 2 - -# alt tab for window shift -bind-key -n M-Tab next-window -bind-key -n M-BTab previous-window - -# alt number for switch -bind-key -n M-1 select-window -t 0 -bind-key -n M-2 select-window -t 1 -bind-key -n M-3 select-window -t 2 -bind-key -n M-4 select-window -t 3 -bind-key -n M-5 select-window -t 4 -bind-key -n M-6 select-window -t 5 -bind-key -n M-7 select-window -t 6 -bind-key -n M-8 select-window -t 7 -bind-key -n M-9 select-window -t 8 - - -# new window and split pane quickly -bind-key -n M-c new-window -bind-key -n M-v split-window -v -bind-key -n M-b split-window -h -bind-key -n M-q killp - - # quick reload bind-key r source-file ~/.tmux.conf\; display "TMUX CONFIG RELOADED" +# force color set -g default-terminal "screen-256color" + +# force utf-8 +setw -gq utf8 on diff --git a/vim/file_formatting.vim b/vim/file_formatting.vim index 43544ae..f379c57 100644 --- a/vim/file_formatting.vim +++ b/vim/file_formatting.vim @@ -13,6 +13,11 @@ augroup filetype_specific_formatting autocmd FileType lisp setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab foldmethod=manual foldlevel=99 autocmd FileType markdown setlocal tabstop=2 noexpandtab foldmethod=indent foldlevel=99 spell autocmd FileType tex setlocal noexpandtab foldmethod=indent foldlevel=99 spell + +augroup end + +augroup forced_filetype_recognition + autocmd BufRead,BufNewFile *.tmux setfiletype tmux augroup end " }}}