From 6cefc1ef1484bac7dec15be7b7dec0d51110bf48 Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Mon, 25 Mar 2019 11:51:34 +0000 Subject: [PATCH 1/3] Change to vi mode in zsh. --- 020_zsh.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/020_zsh.sh b/020_zsh.sh index 0cb941e..3b63d28 100644 --- a/020_zsh.sh +++ b/020_zsh.sh @@ -213,6 +213,12 @@ ZSH_THEME="agnoster" # powerline based theme #ZSH_THEME="Pure" EOF +cat > ~/.zshrc.d/001-vi-mode.sh << 'EOF' + # Set vi mode + bindkey -v +EOF + + #git clone https://github.com/bhilburn/powerlevel9k.git ~/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k ## add a separate zsh aliases directory From 9cb1bdf0e4a284b669e28459134aaf5515324f9f Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Tue, 26 Mar 2019 13:45:10 +0000 Subject: [PATCH 2/3] Set meld as the diff tool for git difftool. --- 020_git-mergetool.sh | 71 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/020_git-mergetool.sh b/020_git-mergetool.sh index 33f8131..e386a59 100644 --- a/020_git-mergetool.sh +++ b/020_git-mergetool.sh @@ -1,3 +1,70 @@ -git config merge.tool meld -#git config merge.tool gvimdiff3 +BIN_DIR=/usr/local/bin +#BIN_DIR=~/bin + +# Available tools: +git difftool --tool-help + +DIFF_TOOL=meld # graphical diff/merge tool +MERGE_TOOL=meld + + # DIFF_TOOL=vimdiff3 # terminal diff/merge tool + # MERGE_TOOL=vimdiff3 + +# $LOCAL is the file in the current branch (e.g. master). +# $REMOTE is the file in the branch being merged (e.g. branch_name). +# $MERGED is the partially merged file with the merge conflict information in it. +# $BASE is the shared commit ancestor of $LOCAL and $REMOTE, this is to say the file as it was when the branch containing $REMOTE was originally created. + + +git config --global merge.tool ${MERGE_TOOL} +git config --global merge.conflictstyle diff3 +#git config --global mergetool.${MERGE_TOOL}.cmd ${MERGE_TOOL} '$LOCAL $BASE $MERGED' + +git config --global diff.tool ${DIFF_TOOL} +git config --global difftool.prompt false +git config --global alias.d difftool +#git config --global difftool.${DIFF_TOOL}.cmd ${DIFF_TOOL} '$LOCAL $REMOTE' + +git config merge.tool ${MERGE_TOOL} git config merge.conflictstyle diff3 +#git config mergetool.${MERGE_TOOL}.cmd ${MERGE_TOOL} '$LOCAL $BASE $MERGED' + +git config diff.tool ${DIFF_TOOL} +git config difftool.prompt false +git config alias.d difftool +#git config --global difftool.${DIFF_TOOL}.cmd ${DIFF_TOOL} '$LOCAL $REMOTE' + +echo "Global: Active mergetool: $(git config --global merge.tool)" +echo "Global: Merge style: $(git config --global merge.conflictstyle)" + +echo "Global: Active difftool: $(git config --global diff.tool)" +echo "Global: Prompt for difftool: $(git config --global difftool.prompt)" + +echo "Active mergetool: $(git config merge.tool)" +echo "Merge style: $(git config merge.conflictstyle)" + +echo "Active difftool: $(git config diff.tool)" +echo "Prompt for difftool: $(git config difftool.prompt)" + +# to use an unsupported tool see below. +#git config --global diff.external ${BIN_DIR}/git-diff-vimdiff.sh + +# the executable specified by GIT_EXTERNAL_DIFF will be called with a fixed set of 7 arguments: + +# path old-file old-hex old-mode new-file new-hex new-mode + +#cat > ${BIN_DIR}/git-diff-meld.sh <<'EOF' +##!/bin/bash +#echo $* +#meld $2 $5 +#EOF +# +#chmod +x ${BIN_DIR}/git-diff-meld.sh +# +#cat > ${BIN_DIR}/git-diff-vimdiff.sh <<'EOF' +##!/bin/bash +#echo $* +#vimdiff $2 $5 +#EOF +# +#chmod +x ${BIN_DIR}/git-diff-vimdiff.sh From 31c15648f965986de65715812c967349ff25d59c Mon Sep 17 00:00:00 2001 From: Cyteen May Date: Tue, 26 Mar 2019 13:46:28 +0000 Subject: [PATCH 3/3] New scripts for sundry applications. --- .020_pycharm-install.sh.swp | Bin 12288 -> 0 bytes 010_alsa.sh | 6 ++ 020_fmui.sh | 131 ++++++++++++++++++++++++++++++++++++ 020_lsd.sh | 3 +- 020_surf.sh | 8 +++ 020_vifm.sh | 28 ++++++++ 020_vim.sh | 8 ++- 020_xmonad.sh | 23 +++++++ 020_zsh.sh | 1 + 9 files changed, 205 insertions(+), 3 deletions(-) delete mode 100644 .020_pycharm-install.sh.swp create mode 100644 020_fmui.sh create mode 100644 020_surf.sh create mode 100644 020_vifm.sh create mode 100644 020_xmonad.sh diff --git a/.020_pycharm-install.sh.swp b/.020_pycharm-install.sh.swp deleted file mode 100644 index 0bd2cabd73bdaba4d6029b4abbd7240a22b02082..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&u`pB6vtnYssg3_6!%9`QjlUh2?a&jZXnuhLWGi*q(nj$3bXdC*In<}8qX%# z5QI3uox*{?0PzR(${7#`#DTwn1EO3I;)am;+VO68yG@{iOQc!p8^`vWH}8Gk%v(j7 z#?1EGI?uZ^gwK;i8xv36SpE4dou42IWK(owlfOCfBib^S>O_;`rMD}zXF93Z5SerX zZ)R?0C++zyp*v2bG9%*H&07EL$68ndmcRoN=$fW8e}P__n=Q8bKxH04t-5iHq-Dd%O1f(&qZkc71be?drz+6W*BF&i%}s*&WddUb*ZBvO&^s zC49+mNxxm5KV+xJj?>JH7AmW%1UKcI{08S1TkLw}lm6L7oLS_##i?07WFsX@tuOH+ z4|^T9oSN#pImUvheszVmrOu*6v7acTlb9oAWT=I~vjql)W+VgdW>Ob#bW`|}n~CNy zGA^wqNf=9BN>i?@FjA7Q^-K%i0=X;WB<)BAtF_W)?g&^Bd}bmQPV-)5S{!4T)95+* z6;TBFk6o!nC`U#P95=dQD78yl-84ZY(1hO%g_E@NZ zS7MR1sq~_8;M6yXMidJy_fZ7ja7QBaU^>rJCqWl^;uvWp8nGOH22MCYs?0Q}-8klM zT6j;ps7;XUDVJ(V0Jki%EXobxCZAp?5%=(o4ZT3<_$dHKK&UP$#%u!sM{)5`{M?5@t5QiF`5RbR)uBZ^6gZas z0527GX;~D^K}G)99B~AyAV@csW!5%HzFUm$y+b3gN75^s47x`#fGAe%WKAA1${C>}p=aqO|q>5Thu zG0Y7Q*r^rXXmT%?<#-t0Lmv6E-5rKPCnuZog(nUyE3VGk@uZR<)EN37;7(~X0 zhiC(lp?kW0bv(X7&5riRc#EcC$Nwsz!R#YL84Y|m_w4^nK6n1#>NAFFZf17gopmqM Q /etc/udev/rules.d/00_alsa-usb.rules << 'EOF' +# Default to using additional (USB) sound cards when they are available. +KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'" +KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'" +EOF diff --git a/020_fmui.sh b/020_fmui.sh new file mode 100644 index 0000000..174c0cf --- /dev/null +++ b/020_fmui.sh @@ -0,0 +1,131 @@ +cd /var/tmp + +apt-get install -y toilet fzf mpc vis ffmpeg + +# pip3 install --user fmui + +git clone https://github.com/seebye/fmui /usr/local + +PROJECT=seebye/fmui +PRERELEASE=false +# RELEASE=$(curl "https://api.github.com/repos/${PROJECT}/releases?per_page=5" | jq -r '.[0] | select( .prerelease = false ) |.tag_name') +# VERSION=$(echo "${RELEASE}" | cut -c 2- | cut -f1 -d"-") +VERSION=$( date +%Y-%m-%d_ )git +DOWNLOAD_DIR=/tmp + +# make a containing directory +mkdir -p /var/tmp/fmui-"${RELEASE}" +cd /var/tmp/fmui-"${RELEASE}" || exit + +cat > ./description-pak << EOF +**f**zf **m**pd **u**ser **i**nterface +EOF + +cat > ./checkinstall_it.sh << 'EOF' + +echo "ENTERING CHECKINSTALL" + +BASE_URL='https://api.github.com/repos' +BASE_USER='seebye' +BASE_REPO='fmui' +LICENSE_PAGE_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/license +RELEASES_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/releases + +# CONTENT=$(curl -s ${RELEASES_URL}/latest) +# LATEST_URL=$(echo "${CONTENT}" | jq --raw-output '.assets[] | select(.browser_download_url | test("Linux-x86_64")) | .browser_download_url') + +echo "LATEST_URL: " "${LATEST_URL}" + +# RELEASE=$(echo "${CONTENT}" | jq --raw-output '.tag_name') + +# LICENSE_URL=$(curl "${LICENSE_PAGE_URL}" | jq --raw-output '.download_url') +# wget -c ${LICENSE_URL} + +VERSION=$( date +%Y-%m-%d_ )git +VERSION=1.0 +RELEASE=git + +# make a new temporary directory for this use +BASE_TMP_DIR=~/tmptmp/checkinstall_tmp +mkdir -p ${BASE_TMP_DIR} + +# do your work +checkinstall -y --fstrans \ + --pkgname=fmui \ + --pkgversion=${VERSION}\ + --pkgrelease=${RELEASE} \ + --pkgarch=amd64 \ + --pkggroup=admin \ + --pkglicense=LICENSE \ + --pkgsource=${LATEST_URL} \ + --maintainer=cyteen@ring-zero.co.uk \ + --requires=toilet,fzf,mpc,vis,ffmpeg \ + -D \ + bash ./install.sh +EOF + +cat > ./install.sh << 'EOF' +BASE_URL='https://api.github.com/repos' +BASE_USER='seebye' +BASE_REPO='fmui' +# RELEASES_URL="${BASE_URL}/${BASE_USER}/${BASE_REPO}"/releases +# CONTENT=$(curl -s ${RELEASES_URL}/latest) +# LATEST_URL=$(echo "${CONTENT}" | jq --raw-output '.assets[] | select(.browser_download_url | test("Linux-x86_64")) | .browser_download_url') +LATEST_URL=https://github.com/seebye/fmui + +# Download and copy the latest version to /usr/local/bin and make executable +git clone ${LATEST_URL} /var/tmp/fmui +cp -a /var/tmp/fmui /usr/local/ +chmod 0775 /usr/local/fmui +chmod +x /usr/local/fmui/fmui && +chmod +x /usr/local/fmui/actions.sh +chmod +x /usr/local/fmui/cover.sh +chmod +x /usr/local/fmui/defaults.sh +chmod +x /usr/local/fmui/essentials.sh +chmod +x /usr/local/fmui/info.sh +chmod +x /usr/local/fmui/keys.sh +chmod +x /usr/local/fmui/mpc.sh +ln -s /usr/local/fmui/fmui /usr/local/bin/fmui +EOF + +bash ./checkinstall_it.sh + + + +cat > ~/.config/fmui << 'EOF' +# Default keybindings +# Key Action Subscreens +# q Quit fzf +# u Update fzf preview window +# v Start visualizer +# i Show song info screen +# j Go down +# k Go up +# down Go down +# up Go up +# return Play choice +# mod-r Toggle repeat +# mod-s Shuffle +# mod-d Update mpd database, restart +# left Seek backwards +# right Seek forwards +# h Seek backwards ✓ +# l Seek forwards ✓ +# p Toggle play ✓ +# c Toggle consume ✓ +# s Toggle single song ✓ +# r Toggle random ✓ +# < Play previous song ✓ +# > Play next song ✓ + +# readonly VOLUME_STEP=2 +# # format? see man fzf +# readonly ACTION_VOLUME_UP="execute-silent:amixer set Master ${VOLUME_STEP}%+ unmute" +# readonly ACTION_VOLUME_DOWN="execute-silent:amixer set Master ${VOLUME_STEP}%- unmute" +# +# key_bindings+=( +# [+]="$ACTION_VOLUME_UP" +# [=]="$ACTION_VOLUME_UP" +# [-]="$ACTION_VOLUME_DOWN" +# ) +EOF diff --git a/020_lsd.sh b/020_lsd.sh index beff516..bb2e9c2 100644 --- a/020_lsd.sh +++ b/020_lsd.sh @@ -35,6 +35,7 @@ apt-get -f install ALIAS_FILE=/home/default/.zsh_aliases.d/003-lsd.sh cat > ${ALIAS_FILE} <<'EOF' if [ -x /usr/bin/lsd ]; then - alias lsd="/usr/bin/ls" + alias lsd="/usr/bin/lsd" + alias ls="lsd --group-dirs first" fi EOF diff --git a/020_surf.sh b/020_surf.sh new file mode 100644 index 0000000..04d9c3a --- /dev/null +++ b/020_surf.sh @@ -0,0 +1,8 @@ +apt-get -y install surf2 + +SOURCE_DIR= +cd $[SOURCE_DIR] +wget -c -P ${SOURCE_DIR} https://surf.suckless.org/patches/bookmarking/surf-bookmarks-20170722-723ff26.diff +patch -p1 < surf-bookmarks-20170722-723ff26.diff + +make install diff --git a/020_vifm.sh b/020_vifm.sh new file mode 100644 index 0000000..f7558cc --- /dev/null +++ b/020_vifm.sh @@ -0,0 +1,28 @@ +mkdir -p ~/.config/vifm/scripts + +# https://gitlab.com/dwt1/dotfiles/tree/master/.config/vifm/scripts + +cat > ~/.zsh_aliases.d/005-vifm.zsh << 'EOF' +alias vifm="~/.config/vifm/scripts/vifmrun" +EOF + +wget -c -P ~/.config/vifm/scripts https://gitlab.com/dwt1/dotfiles/raw/master/.config/vifm/scripts/vifmimg + +wget -c -P ~/.config/vifm/scripts https://gitlab.com/dwt1/dotfiles/raw/master/.config/vifm/scripts/vifmrun + +chmod +x ~/.config/vifm/scripts/vifmimg +chmod +x ~/.config/vifm/scripts/vifmrun + +apt-get install python3-setuptools libjpeg-dev python3-dev + +# libraqm +# libimagequant +# openjpeg +# libwebp +# littlecms +# libfreetype +# libtiff +# zlib +# libjpeg + +pip3 install --user ueberzug diff --git a/020_vim.sh b/020_vim.sh index 1ecebb2..8699497 100644 --- a/020_vim.sh +++ b/020_vim.sh @@ -1,5 +1,5 @@ set +x -#apt-get install vim-gtk vifm +#apt-get install vim-gtk sed -i -e 's/"syntax on/syntax on/' /etc/vim/vimrc sed -i -e 's/"set background=dark/set background=dark/' /etc/vim/vimrc @@ -18,6 +18,9 @@ cat > ~/.vimrc << 'EOF' " enable syntax highlighting syntax enable +" enable mouse +set mouse=a + set encoding=utf-8 " Show file options above the command line @@ -170,7 +173,6 @@ Plugin 'sudar/vim-arduino-syntax' Plugin 'ekalinin/Dockerfile.vim' Plugin ' mattboehm/vim-unstack' Plugin 'tmux-plugins/vim-tmux' - " vim-snipmate Plugin 'MarcWeber/vim-addon-mw-utils' Plugin 'tomtom/tlib_vim' @@ -192,7 +194,9 @@ Plugin 'vim-scripts/taglist.vim' Plugin 'majutsushi/tagbar' Plugin 'scrooloose/nerdtree' Plugin 'jistr/vim-nerdtree-tabs' +Plugin 'severin-lemaignan/vim-minimap' +let NERDTreeQuitOnOpen=1 map :NERDTreeToggle silent! nmap :NERDTreeToggle silent! map :NERDTreeFind diff --git a/020_xmonad.sh b/020_xmonad.sh new file mode 100644 index 0000000..1e230de --- /dev/null +++ b/020_xmonad.sh @@ -0,0 +1,23 @@ +apt-get install -y xmonad xmobar + +wget -c -P ~/.config/xmobar/ https://gitlab.com/dwt1/dotfiles/raw/master/.config/xmobar/xmobarrc0 +wget -c -P ~/.config/xmobar/ https://gitlab.com/dwt1/dotfiles/raw/master/.config/xmobar/xmobarrc1 +wget -c -P ~/.config/xmobar/ https://gitlab.com/dwt1/dotfiles/raw/master/.config/xmobar/xmobarrc2 + +wget -c -P ~/.xmonad/xmonad.hs https://gitlab.com/dwt1/dotfiles/raw/master/.xmonad/xmonad.hs + +cat > /tmp/xmonad-keybindings.txt << 'EOF' +MODKEY + Keypad Insert opens run launcher (dmenu is the run launcher but can be easily changed) +MODKEY + Enter opens terminal (st is the terminal but can be easily changed) +MODKEY + SHIFT + c closes window with focus +MODKEY + SHIFT + q quits xmonad +MODKEY + j windows focus down (switches focus between windows in the stack) +MODKEY + k windows focus up (switches focus between windows in the stack) +MODKEY + SHIFT + j windows swap down (swap windows in the stack) +MODKEY + SHIFT + k windows swap up (swap the windows in the stack) +MODKEY + h shrink window (decreases window width) +MODKEY + l expand window (increases window width) +MODKEY + w switches focus to monitor 1 +MODKEY + e switches focus to monitor 2 +MODKEY + r switches focus to monitor 3 +EOF diff --git a/020_zsh.sh b/020_zsh.sh index 3b63d28..b0fe72a 100644 --- a/020_zsh.sh +++ b/020_zsh.sh @@ -216,6 +216,7 @@ EOF cat > ~/.zshrc.d/001-vi-mode.sh << 'EOF' # Set vi mode bindkey -v + bindkey '^R' history-incremental-search-backward EOF