New scripts for sundry applications.

This commit is contained in:
Cyteen May 2019-03-26 13:46:28 +00:00
parent 9cb1bdf0e4
commit 31c15648f9
9 changed files with 205 additions and 3 deletions

Binary file not shown.

View File

@ -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

131
020_fmui.sh Normal file
View File

@ -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

View File

@ -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

8
020_surf.sh Normal file
View File

@ -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

28
020_vifm.sh Normal file
View File

@ -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

View File

@ -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 <F2> :NERDTreeToggle<CR>
silent! nmap <C-p> :NERDTreeToggle<CR>
silent! map <F3> :NERDTreeFind<CR>

23
020_xmonad.sh Normal file
View File

@ -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

View File

@ -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