diff --git a/.020_pycharm-install.sh.swp b/.020_pycharm-install.sh.swp deleted file mode 100644 index 0bd2cab..0000000 Binary files a/.020_pycharm-install.sh.swp and /dev/null differ diff --git a/010_alsa.sh b/010_alsa.sh index 44b7a43..4a6922e 100644 --- a/010_alsa.sh +++ b/010_alsa.sh @@ -16,3 +16,9 @@ apt-get -y install pnmixer kill -HUP `ps aux | grep -v grep | grep pnmixer | awk {'print $2'}` sed -i 's,^\(VolumeControlCommand=\).*,\1'xfce4-mixer',' ~/.config/pnmixer/config pnmixer & + +cat > /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_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 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 0cb941e..b0fe72a 100644 --- a/020_zsh.sh +++ b/020_zsh.sh @@ -213,6 +213,13 @@ ZSH_THEME="agnoster" # powerline based theme #ZSH_THEME="Pure" EOF +cat > ~/.zshrc.d/001-vi-mode.sh << 'EOF' + # Set vi mode + bindkey -v + bindkey '^R' history-incremental-search-backward +EOF + + #git clone https://github.com/bhilburn/powerlevel9k.git ~/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k ## add a separate zsh aliases directory