dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit 56cfbf05ef7ee14e037d2e48c55106745464a665
parent 2ac9aa66711bfaa5b2f06c64fee87feb713d660a
Author: Chris Noxz <chris@noxz.tech>
Date:   Thu, 26 Mar 2020 18:33:43 +0100

major commit with XDG support

Diffstat:
M.gitignore | 1+
Dbin/.bin/alias/calcurse | 5-----
Dbin/.bin/alias/irssi | 3---
Dbin/.bin/alias/keys | 2--
Dbin/.bin/alias/v | 2--
Dbin/.bin/alias/vi | 2--
Dbin/.bin/alias/wget | 3---
Dbin/.bin/compile | 61-------------------------------------------------------------
Dbin/.bin/dmenu_main | 53-----------------------------------------------------
Dbin/.bin/dwm-run | 4----
Dbin/.bin/operations | 57---------------------------------------------------------
Dbin/.bin/ssh-agent-init | 14--------------
Dbin/.bin/status.tmux | 18------------------
Dbin/.bin/tmux-term | 3---
Dbin/.bin/vifmimg | 79-------------------------------------------------------------------------------
Rbin/.bin/alias/backup -> bin/.local/bin/alias/backup | 0
Rbin/.bin/alias/bc -> bin/.local/bin/alias/bc | 0
Rbin/.bin/alias/borg -> bin/.local/bin/alias/borg | 0
Rbin/.bin/alias/cal -> bin/.local/bin/alias/cal | 0
Abin/.local/bin/alias/calcurse | 6++++++
Rbin/.bin/alias/df -> bin/.local/bin/alias/df | 0
Rbin/.bin/alias/diff -> bin/.local/bin/alias/diff | 0
Rbin/.bin/alias/egrep -> bin/.local/bin/alias/egrep | 0
Rbin/.bin/alias/fd -> bin/.local/bin/alias/fd | 0
Rbin/.bin/alias/fdr -> bin/.local/bin/alias/fdr | 0
Rbin/.bin/alias/fe -> bin/.local/bin/alias/fe | 0
Rbin/.bin/alias/fgrep -> bin/.local/bin/alias/fgrep | 0
Rbin/.bin/alias/free -> bin/.local/bin/alias/free | 0
Rbin/.bin/alias/grep -> bin/.local/bin/alias/grep | 0
Rbin/.bin/alias/ipp -> bin/.local/bin/alias/ipp | 0
Abin/.local/bin/alias/irssi | 12++++++++++++
Rbin/.bin/alias/isopen -> bin/.local/bin/alias/isopen | 0
Abin/.local/bin/alias/keys | 2++
Rbin/.bin/alias/la -> bin/.local/bin/alias/la | 0
Rbin/.bin/alias/less -> bin/.local/bin/alias/less | 0
Rbin/.bin/alias/ll -> bin/.local/bin/alias/ll | 0
Rbin/.bin/alias/ls -> bin/.local/bin/alias/ls | 0
Rbin/.bin/alias/lynx -> bin/.local/bin/alias/lynx | 0
Rbin/.bin/alias/make -> bin/.local/bin/alias/make | 0
Rbin/.bin/alias/mkdir -> bin/.local/bin/alias/mkdir | 0
Rbin/.bin/alias/mpv-xv -> bin/.local/bin/alias/mpv-xv | 0
Rbin/.bin/alias/mutt -> bin/.local/bin/alias/mutt | 0
Rbin/.bin/alias/path -> bin/.local/bin/alias/path | 0
Rbin/.bin/alias/rm -> bin/.local/bin/alias/rm | 0
Rbin/.bin/alias/ssh -> bin/.local/bin/alias/ssh | 0
Abin/.local/bin/alias/v | 2++
Abin/.local/bin/alias/vi | 2++
Rbin/.bin/alias/vifm -> bin/.local/bin/alias/vifm | 0
Rbin/.bin/alias/vim -> bin/.local/bin/alias/vim | 0
Rbin/.bin/alias/vimb-proxy -> bin/.local/bin/alias/vimb-proxy | 0
Rbin/.bin/alias/vimb-tabbed -> bin/.local/bin/alias/vimb-tabbed | 0
Rbin/.bin/alias/vimb-tor -> bin/.local/bin/alias/vimb-tor | 0
Abin/.local/bin/alias/wget | 3+++
Rbin/.bin/alias/wikid -> bin/.local/bin/alias/wikid | 0
Rbin/.bin/auto-open -> bin/.local/bin/auto-open | 0
Rbin/.bin/borg-stat -> bin/.local/bin/borg-stat | 0
Abin/.local/bin/clipd | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/colors | 26++++++++++++++++++++++++++
Abin/.local/bin/colors-256 | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abin/.local/bin/compile | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rbin/.bin/contacts -> bin/.local/bin/contacts | 0
Rbin/.bin/dmenu_bookmarks -> bin/.local/bin/dmenu_bookmarks | 0
Rbin/.bin/dmenu_confirm -> bin/.local/bin/dmenu_confirm | 0
Rbin/.bin/dmenu_layouts -> bin/.local/bin/dmenu_layouts | 0
Abin/.local/bin/dmenu_main | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Rbin/.bin/dmenu_man -> bin/.local/bin/dmenu_man | 0
Rbin/.bin/dmenu_mount -> bin/.local/bin/dmenu_mount | 0
Rbin/.bin/dmenu_passmenu -> bin/.local/bin/dmenu_passmenu | 0
Rbin/.bin/dmenu_path -> bin/.local/bin/dmenu_path | 0
Rbin/.bin/dmenu_power -> bin/.local/bin/dmenu_power | 0
Rbin/.bin/dmenu_radio -> bin/.local/bin/dmenu_radio | 0
Rbin/.bin/dmenu_run -> bin/.local/bin/dmenu_run | 0
Rbin/.bin/dmenu_sscw -> bin/.local/bin/dmenu_sscw | 0
Rbin/.bin/dmenu_themes -> bin/.local/bin/dmenu_themes | 0
Rbin/.bin/dmenu_todo -> bin/.local/bin/dmenu_todo | 0
Rbin/.bin/dmenu_umount -> bin/.local/bin/dmenu_umount | 0
Rbin/.bin/dmenu_url_extract -> bin/.local/bin/dmenu_url_extract | 0
Rbin/.bin/dmenu_url_open -> bin/.local/bin/dmenu_url_open | 0
Rbin/.bin/dmenu_vtc -> bin/.local/bin/dmenu_vtc | 0
Rbin/.bin/dmenu_yt_search -> bin/.local/bin/dmenu_yt_search | 0
Abin/.local/bin/dwm-run | 4++++
Rbin/.bin/fetch-icals -> bin/.local/bin/fetch-icals | 0
Rbin/.bin/fix-home-permissions -> bin/.local/bin/fix-home-permissions | 0
Rbin/.bin/fzf-history.tmux -> bin/.local/bin/fzf-history.tmux | 0
Rbin/.bin/fzf-move-to.tmux -> bin/.local/bin/fzf-move-to.tmux | 0
Rbin/.bin/fzf-url.tmux -> bin/.local/bin/fzf-url.tmux | 0
Rbin/.bin/gen-adblock -> bin/.local/bin/gen-adblock | 0
Rbin/.bin/generate-mutt-alias -> bin/.local/bin/generate-mutt-alias | 0
Rbin/.bin/gpg-edit -> bin/.local/bin/gpg-edit | 0
Rbin/.bin/lbry2rss -> bin/.local/bin/lbry2rss | 0
Rbin/.bin/listen-ac-change -> bin/.local/bin/listen-ac-change | 0
Rbin/.bin/listen-new-mail -> bin/.local/bin/listen-new-mail | 0
Rbin/.bin/listen-new-pkg -> bin/.local/bin/listen-new-pkg | 0
Rbin/.bin/mbsync-stdin -> bin/.local/bin/mbsync-stdin | 0
Rbin/.bin/mkthemes -> bin/.local/bin/mkthemes | 0
Rbin/.bin/mnt -> bin/.local/bin/mnt | 0
Rbin/.bin/monitor -> bin/.local/bin/monitor | 0
Rbin/.bin/msmtp-tpl -> bin/.local/bin/msmtp-tpl | 0
Rbin/.bin/nrowgrid.tmux -> bin/.local/bin/nrowgrid.tmux | 0
Abin/.local/bin/operations | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rbin/.bin/pedit -> bin/.local/bin/pedit | 0
Rbin/.bin/print-sxhkd -> bin/.local/bin/print-sxhkd | 0
Rbin/.bin/proxify -> bin/.local/bin/proxify | 0
Rbin/.bin/repo-graph -> bin/.local/bin/repo-graph | 0
Rbin/.bin/screenrec -> bin/.local/bin/screenrec | 0
Rbin/.bin/screenshot -> bin/.local/bin/screenshot | 0
Rbin/.bin/set-wallpaper -> bin/.local/bin/set-wallpaper | 0
Rbin/.bin/ssh-add-pass -> bin/.local/bin/ssh-add-pass | 0
Abin/.local/bin/ssh-agent-init | 14++++++++++++++
Abin/.local/bin/status.tmux | 26++++++++++++++++++++++++++
Rbin/.bin/timer -> bin/.local/bin/timer | 0
Abin/.local/bin/tmstat | 16++++++++++++++++
Abin/.local/bin/tmux-term | 3+++
Abin/.local/bin/vifmimg | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rbin/.bin/vifmrun -> bin/.local/bin/vifmrun | 0
Abin/.local/bin/web-report | 30++++++++++++++++++++++++++++++
Mcdm/.config/cdm/cdmrc | 11++++++-----
Mfreecad/.config/FreeCAD/user.cfg | 1+
Ainput/.config/readline/inputrc | 4++++
Dinput/.inputrc | 7-------
Mirssi/.config/irssi/config | 6+++---
Aksh/.config/ksh/kshrc | 9+++++++++
Rksh/.kshrc.d/00-options.sh -> ksh/.config/ksh/kshrc.d/00-options.sh | 0
Aksh/.config/ksh/kshrc.d/10-enviornment.sh | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aksh/.config/ksh/kshrc.d/11-less.sh | 24++++++++++++++++++++++++
Aksh/.config/ksh/kshrc.d/20-completion.sh | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aksh/.config/ksh/kshrc.d/30-alias.sh | 21+++++++++++++++++++++
Rksh/.kshrc.d/51-ssh-agent.sh -> ksh/.config/ksh/kshrc.d/51-ssh-agent.sh | 0
Rksh/.kshrc.d/90-prompt.sh -> ksh/.config/ksh/kshrc.d/90-prompt.sh | 0
Dksh/.kshrc | 9---------
Dksh/.kshrc.d/10-enviornment.sh | 125-------------------------------------------------------------------------------
Dksh/.kshrc.d/20-completion.sh | 69---------------------------------------------------------------------
Dksh/.kshrc.d/30-alias.sh | 21---------------------
Mksh/.profile | 47+++++++++++++++++++++++++++++++----------------
Mlink | 2+-
Mnewsboat/.config/newsboat/config | 2+-
Msxhkd/.config/sxhkd/sxhkdrc | 8+++++---
Msxiv/.config/sxiv/exec/key-handler | 6+++---
Mtmux/.config/tmux/tmux.conf | 9++++++---
Mvifm/.config/vifm/vifmrc | 4++++
Avim/.config/vim/plugins/vim-ctab/vim-ctab.vim | 349+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvim/.config/vim/vimrc | 56+++++++++++++++++++++++++-------------------------------
Ax/.config/X11/xinitrc | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ax/.config/X11/xresources | 1+
Dx/.xinitrc | 65-----------------------------------------------------------------
145 files changed, 1327 insertions(+), 668 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -5,6 +5,7 @@ calcurse/.config/calcurse/notes freecad/.config/FreeCAD/FreeCAD.conf gtk/.config/gtk-2.0/gtkfilechooser.ini newsboat/.config/newsboat/urls +vim/.config/vim/spell vifm/.config/vifm/vifminfo vimb/.config/vimb/* !vimb/.config/vimb/config diff --git a/bin/.bin/alias/calcurse b/bin/.bin/alias/calcurse @@ -1,5 +0,0 @@ -#!/bin/sh - -/bin/calcurse \ - -D ~/.config/calcurse \ - -c ~/.data/calcurse/$(ls ~/.data/calcurse/ | fzf) "$@" diff --git a/bin/.bin/alias/irssi b/bin/.bin/alias/irssi @@ -1,3 +0,0 @@ -#!/bin/sh - -proxychains4 -q irssi --home "$XDG_CONFIG_HOME/irssi" "$@" diff --git a/bin/.bin/alias/keys b/bin/.bin/alias/keys @@ -1 +0,0 @@ -../print-sxhkd- \ No newline at end of file diff --git a/bin/.bin/alias/v b/bin/.bin/alias/v @@ -1 +0,0 @@ -vim- \ No newline at end of file diff --git a/bin/.bin/alias/vi b/bin/.bin/alias/vi @@ -1 +0,0 @@ -vim- \ No newline at end of file diff --git a/bin/.bin/alias/wget b/bin/.bin/alias/wget @@ -1,3 +0,0 @@ -#!/bin/sh - -/bin/wget -c "$@" diff --git a/bin/.bin/compile b/bin/.bin/compile @@ -1,61 +0,0 @@ -#!/bin/sh - -_FILE=$(readlink -f "$1") -_DIR=$(dirname "$_FILE") -_BASE="${_FILE%.*}" -_PRFX="---COMPILE:" -_ARGS="$(grep -oP -- "$_PRFX.*$" "$_FILE" | sed -s "s|$_PRFX||")" - -cd "$_DIR" || return - -case "$_FILE" in -*\.ps.ms) preconv "$_FILE" \ - | refer \ - | tapas \ - | grap \ - | pic -Tps \ - | tbl -Tps \ - | eqn -Tps \ - | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -Tps \ - | ps2pdf - \ - | gs \ - -q \ - -dNOPAUSE \ - -dBATCH \ - -dPDFSETTINGS=/prepress \ - -sDEVICE=pdfwrite \ - -dPrinted=false \ - -sOutputFile="$_BASE.pdf" - - ;; -*\.ms) preconv "$_FILE" \ - | refer \ - | tapas \ - | grap \ - | pic -Tpdf \ - | tbl -Tpdf \ - | eqn -Tpdf \ - | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -P-e -Tpdf \ - | gs \ - -q \ - -dNOPAUSE \ - -dBATCH \ - -dPDFSETTINGS=/prepress \ - -sDEVICE=pdfwrite \ - -dPrinted=false \ - -sOutputFile="$_BASE.pdf" - - ;; -*\.md) lowdown -s -Tms "$_FILE" \ - | sed -e 's/\.nr PS 10/\.nr PS 12\n\.nr VS 18/g' \ - | preconv \ - | tbl -Tpdf \ - | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -P-e -Tpdf \ - | gs \ - -q \ - -dNOPAUSE \ - -dBATCH \ - -dPDFSETTINGS=/prepress \ - -sDEVICE=pdfwrite \ - -dPrinted=false \ - -sOutputFile="$_BASE.pdf" - - ;; -esac diff --git a/bin/.bin/dmenu_main b/bin/.bin/dmenu_main @@ -1,53 +0,0 @@ -#!/bin/sh - -args=" -p main: -l 20" -options=" - bookmarks - radio - man - operations - pass - power - soundcloud - todo - youtube -" - -get_fm_key () { - local key_location="/tmp/.di.fm.key" - local key_pass="di.fm/listen-key" - - [ ! -f "$key_location" ] \ - && touch "$key_location" \ - && chmod 600 "$key_location" \ - && pass "$key_pass" > "$key_location" - - echo $(cat "$key_location") -} - -while :; do - case "$(printf "$options" \ - | sed -e '/^$/d' -e 's/^[ \t]*//' \ - | sort \ - | dmenu_vtc${args})" in - bookmarks) - dmenu_bookmarks "$HOME/.data/bookmarks" ${args} -i -p bookmark:;; - radio) - dmenu_radio "$(get_fm_key)" ${args} -i -p provider:;; - man) - dmenu_man${args} -i -p man:;; - operations) - operations dmenu${args} -i -p operations:;; - pass) - dmenu_passmenu ${args} -i -p pass:;; - power) - dmenu_power${args} -i;; - soundcloud) - dmenu_sscw${args} -i;; - todo) - dmenu_todo "$HOME/.data/todo" ${args} -i -p todo:;; - youtube) - dmenu_yt_search${args} -i;; - *) break;; - esac -done diff --git a/bin/.bin/dwm-run b/bin/.bin/dwm-run @@ -1,4 +0,0 @@ -#!/bin/sh -while true; do - /usr/local/bin/dwm 2>"$HOME/.data/dwm/dwm.log" -done diff --git a/bin/.bin/operations b/bin/.bin/operations @@ -1,57 +0,0 @@ -#!/bin/sh - -args="${@}" -args="${args#$1}" -args="${args#dmenu}" -option="$([ "$1" = "-" ] && cat - || echo "$1")" - -case "$option" in -list) - echo notify - echo sync-mail - echo ztatus -;; -notify) - text="$( - [ "$2" = "" ] \ - && echo "$(echo -n | dmenu_vtc${args} -l 0 -p text:)" \ - || echo "$2" - )" - if [ "$text" != "" ]; then - ztatusc notify "$text" - else - operations dmenu ${args} - fi -;; -ztatus) - case "$2" in - list) - echo show-time - ;; - show-time) - ztatusc toggle datetime - ;; - dmenu|"") - option="$(operations ztatus list | dmenu_vtc${args} -p ztatus:)" - if [ "$option" != "" ]; then - operations ztatus "$option" - else - operations dmenu "${args}" - fi - ;; - esac -;; -sync-mail) - ~/.bin/mbsync-stdin < ~/.config/mbsync/template -a -V - for f in ~/mail/webmail-*/INBOX/new/*; do touch "$f" 2>/dev/null; done -;; -dmenu|"") - option="$(operations list | dmenu_vtc${@#dmenu})" - if [ "$option" != "" ]; then - operations "$option" "${@#dmenu}" - fi -;; -*) - printf 'the operation "%s" is not implamented.\n' "$option" -;; -esac diff --git a/bin/.bin/ssh-agent-init b/bin/.bin/ssh-agent-init @@ -1,14 +0,0 @@ -#!/bin/sh - -ssh-add -D -set -- $(ls ~/.password-store/ssh); for key -do - pass ssh/$key/passphrase | ssh-add-pass "$HOME/.ssh/keys/.$key.key" \ - 2>&1 >/dev/null && printf '[%s+%s] identity added: %s%s%s\n' \ - "$(tput setaf 10)" \ - "$(tput sgr0)" \ - "$(tput setaf 15)" \ - "$key" \ - "$(tput sgr0)" -done -touch "$HOME/.tmp/.ssh-agent-init-done" diff --git a/bin/.bin/status.tmux b/bin/.bin/status.tmux @@ -1,18 +0,0 @@ -#!/bin/sh - -case "$1" in -battery) - _PATH="/sys/class/power_supply/BAT0" - _STATUS="$(cat "$_PATH/status")" - _FULL="$(cat "$_PATH/energy_full")" - _NOW="$(cat "$_PATH/energy_now")" - - [ "$_STATUS" = "Discharging" ] && _STATUS="-" || _STATUS="+" - echo "$_STATUS$((100 * _NOW / _FULL))%" - ;; -temp) - _TEMP="$(sensors | awk '/Core\ 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}')" - - echo "$_TEMP°c" - ;; -esac diff --git a/bin/.bin/tmux-term b/bin/.bin/tmux-term @@ -1,3 +0,0 @@ -#!/bin/sh - -cd $HOME && $TERMINAL -e /bin/tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf "$@" diff --git a/bin/.bin/vifmimg b/bin/.bin/vifmimg @@ -1,79 +0,0 @@ -#!/bin/sh -readonly ID_PREVIEW="preview" -readonly TMP="/tmp$PWD" -readonly _X="$2" -readonly _Y="$3" -readonly _W="$4" -readonly _H="$5" - -#PLAY_GIF="yes" -#AUTO_REMOVE="yes" - -# exit if required FIFO doesn't exist -[ ! -e "$FIFO_UEBERZUG" ] && exit - -_draw () { - echo "{ \ - \"action\" : \"add\", \ - \"identifier\" : \"$ID_PREVIEW\", \ - \"x\" : $_X, \ - \"y\" : $_Y, \ - \"width\" : $_W, \ - \"height\" : $_H, \ - \"path\" : \"$1\" \ - }" > "$FIFO_UEBERZUG" -} - -case "$1" in -draw) - _draw "$PWD/$6" - ;; -drawff) - [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" - if [ ! -f "$TMP/$6.png" ]; then - case "$6" in - *.ff.bz) bzip2 -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; - *.ff.gz) gzip -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; - *.ff.xz) xz -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; - *.ff) ff2png < "$PWD/$6" > "$TMP/$6.png" ;; - *) exit ;; - esac - convert -resize 512x512\> "$TMP/$6.png" "$TMP/$6.png" - fi - _draw "$TMP/$6.png" - ;; -videopreview) - [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" - [ ! -f "$TMP/$6.png" ] && ffmpegthumbnailer -i "$PWD/$6" -o "$TMP/$6.png" -s 0 -q 10 - _draw "$TMP/$6.png" - ;; -gifpreview) - [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" && convert -coalesce "$PWD/$6" "$TMP/$6/$6.png" - if [ -n "$PLAY_GIF" ]; then - for frame in $(find "$TMP/$6" -name "*.png" | sort -V); do - _draw "$frame" - sleep .07 - done - else - _draw "$TMP/$6/$6-0.png" - fi - ;; -epubpreview) - [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" - [ ! -f "$TMP/$6.png" ] && epub-thumbnailer "$6" "$TMP/$6.png" 512 - _draw "$TMP/$6.png" - ;; -pdfpreview) - [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" - [ ! -f "$TMP/$6.png" ] && pdftoppm -png -singlefile "$6" "$TMP/$6" - _draw "$TMP/$6.png" - ;; -clear) - echo "{ \ - \"action\" : \"remove\", \ - \"identifier\" : \"$ID_PREVIEW\" \ - }" > "$FIFO_UEBERZUG" - [ -n "$AUTO_REMOVE" ] && [ -f "$TMP/$6.png" ] && rm -f "$TMP/$6.png" - [ -n "$AUTO_REMOVE" ] && [ -d "$TMP/$6/" ] && rm -rf "$TMP/$6/" - ;; -esac diff --git a/bin/.bin/alias/backup b/bin/.local/bin/alias/backup diff --git a/bin/.bin/alias/bc b/bin/.local/bin/alias/bc diff --git a/bin/.bin/alias/borg b/bin/.local/bin/alias/borg diff --git a/bin/.bin/alias/cal b/bin/.local/bin/alias/cal diff --git a/bin/.local/bin/alias/calcurse b/bin/.local/bin/alias/calcurse @@ -0,0 +1,6 @@ +#!/bin/sh + +/bin/calcurse \ + -C "$XDG_CONFIG_HOME/calcurse" \ + -D "$XDG_DATA_HOME/calcurse" \ + -c "$XDG_DATA_HOME/calcurse/cals"/$(ls "$XDG_DATA_HOME/calcurse/cals" | fzf) "$@" diff --git a/bin/.bin/alias/df b/bin/.local/bin/alias/df diff --git a/bin/.bin/alias/diff b/bin/.local/bin/alias/diff diff --git a/bin/.bin/alias/egrep b/bin/.local/bin/alias/egrep diff --git a/bin/.bin/alias/fd b/bin/.local/bin/alias/fd diff --git a/bin/.bin/alias/fdr b/bin/.local/bin/alias/fdr diff --git a/bin/.bin/alias/fe b/bin/.local/bin/alias/fe diff --git a/bin/.bin/alias/fgrep b/bin/.local/bin/alias/fgrep diff --git a/bin/.bin/alias/free b/bin/.local/bin/alias/free diff --git a/bin/.bin/alias/grep b/bin/.local/bin/alias/grep diff --git a/bin/.bin/alias/ipp b/bin/.local/bin/alias/ipp diff --git a/bin/.local/bin/alias/irssi b/bin/.local/bin/alias/irssi @@ -0,0 +1,12 @@ +#!/bin/sh + +irssi_pem="/tmp/.irssi.pem" + +storekey () { + touch "$irssi_pem" + chmod 600 "$irssi_pem" + pass irc/login-keys.pem > "$irssi_pem" +} + +[ ! -f "$irssi_pem" ] && storekey +proxychains4 -q irssi --home "$XDG_CONFIG_HOME/irssi" "$@" diff --git a/bin/.bin/alias/isopen b/bin/.local/bin/alias/isopen diff --git a/bin/.local/bin/alias/keys b/bin/.local/bin/alias/keys @@ -0,0 +1 @@ +../print-sxhkd+ \ No newline at end of file diff --git a/bin/.bin/alias/la b/bin/.local/bin/alias/la diff --git a/bin/.bin/alias/less b/bin/.local/bin/alias/less diff --git a/bin/.bin/alias/ll b/bin/.local/bin/alias/ll diff --git a/bin/.bin/alias/ls b/bin/.local/bin/alias/ls diff --git a/bin/.bin/alias/lynx b/bin/.local/bin/alias/lynx diff --git a/bin/.bin/alias/make b/bin/.local/bin/alias/make diff --git a/bin/.bin/alias/mkdir b/bin/.local/bin/alias/mkdir diff --git a/bin/.bin/alias/mpv-xv b/bin/.local/bin/alias/mpv-xv diff --git a/bin/.bin/alias/mutt b/bin/.local/bin/alias/mutt diff --git a/bin/.bin/alias/path b/bin/.local/bin/alias/path diff --git a/bin/.bin/alias/rm b/bin/.local/bin/alias/rm diff --git a/bin/.bin/alias/ssh b/bin/.local/bin/alias/ssh diff --git a/bin/.local/bin/alias/v b/bin/.local/bin/alias/v @@ -0,0 +1 @@ +vim+ \ No newline at end of file diff --git a/bin/.local/bin/alias/vi b/bin/.local/bin/alias/vi @@ -0,0 +1 @@ +vim+ \ No newline at end of file diff --git a/bin/.bin/alias/vifm b/bin/.local/bin/alias/vifm diff --git a/bin/.bin/alias/vim b/bin/.local/bin/alias/vim diff --git a/bin/.bin/alias/vimb-proxy b/bin/.local/bin/alias/vimb-proxy diff --git a/bin/.bin/alias/vimb-tabbed b/bin/.local/bin/alias/vimb-tabbed diff --git a/bin/.bin/alias/vimb-tor b/bin/.local/bin/alias/vimb-tor diff --git a/bin/.local/bin/alias/wget b/bin/.local/bin/alias/wget @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" -c "$@" diff --git a/bin/.bin/alias/wikid b/bin/.local/bin/alias/wikid diff --git a/bin/.bin/auto-open b/bin/.local/bin/auto-open diff --git a/bin/.bin/borg-stat b/bin/.local/bin/borg-stat diff --git a/bin/.local/bin/clipd b/bin/.local/bin/clipd @@ -0,0 +1,80 @@ +#!/bin/sh + +CD_MAX_CLIP=1000 +CD_MAX_CLIP_THRESH=$((CD_MAX_CLIP + 100)) + +last_id="" + +die() { + echo "$@" + exit 1 +} + +empty() { + case "$1" in + *[![:blank:]]*) return 1;; + *) return 0;; + esac +} + +partof() { + [ -z "$1" ] && return 1; + [ -z "$2" ] && return 1; + case "$1" in + *"$2") return 0;; + "$2"*) return 0;; + esac + case "$2" in + *"$1") return 0;; + "$1"*) return 0;; + esac + return 1; +} + +getid() { + echo "$(echo "$@" | md5sum | cut -d' ' -f1)" +} + +[ -z "$1" ] && die "selection is missing" +selection="$1" + +cachedir="/tmp/.clipd/$USER/" + +# check prerequisites +command -v clipnotify >/dev/null 2>&1 || die "'clipnotify' program is missing" +command -v timeout >/dev/null 2>&1 || die "'timeout' program is missing" +command -v xsel >/dev/null 2>&1 || die "'xsel' program is missing" + +case "$selection" in + primary|secondary|clipboard);; + *) die "'$selection' is not a valid selection"; +esac + +while clipnotify; do + data="$(timeout 1 xsel --logfile /dev/null -o --"$selection")" + + # check if empty + empty "$data" && continue + + # check if identical to last + [ "$data" = "$last_entry" ] && continue + + # check if last or current are parts of each other, and delete last if so. + if partof "$data" "$last_entry"; then + rm -- "/tmp/.clipd/$USER/$last_id" + fi + + last_id="$selection.$(getid "$data")" + last_entry="$data" + + mkdir -m0700 -p -- "/tmp/.clipd/$USER/" + echo "$data" > "/tmp/.clipd/$USER/$last_id" + chmod 600 -- "/tmp/.clipd/$USER/$last_id" + + # remove old entries if threshold is met + if [ ! -z "$CD_MAX_CLIP" ] && \ + [ "$(ls "/tmp/.clipd/$USER/" | wc -l)" -gt "$CD_MAX_CLIP_THRESH" ]; then + ls -dt "/tmp/.clipd/$USER/"* | sed -e "1,${CD_MAX_CLIP}d" \ + | xargs -d '\n' rm + fi +done diff --git a/bin/.local/bin/colors b/bin/.local/bin/colors @@ -0,0 +1,26 @@ +#!/bin/bash +# +# This file echoes a bunch of color codes to the +# terminal to demonstrate what's available. Each +# line is the color code of one forground color, +# out of 17 (default + 16 escapes), followed by a +# test use of that color on all nine background +# colors (default + 8 escapes). +# + +T='•••' + +echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m"; + +for FGs in ' 0m' ' 1;0m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ + '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ + ' 36m' '1;36m' ' 37m' '1;37m'; + do FG=${FGs// /} + echo -en " $FGs \033[$FG $T " + for BG in 40m 41m 42m 43m 44m 45m 46m 47m; + do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; + done + echo; +done +echo + diff --git a/bin/.local/bin/colors-256 b/bin/.local/bin/colors-256 @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# +# (c) 2016 Shudmanul Chowdhury +# +# A simple script to test and get escape sequences for 256 terminal colors. +# +NAME="${0##*/}" +UNDER="\e[4m" +RESET="\e[0m" +TCOLS=$(tput cols) +# prints foreground escape sequence +fgc() { +echo "\e[38;5;${1}m" +} +# prints background escape sequence +bgc() { +echo "\e[48;5;${1}m" +} +usage() { +while IFS= read -r line; do +echo -e "$line" +done << EOF +Usage: $NAME [-a] [-b num] [-f num] + -a display all colors + -b display the background color escape sequence for ${UNDER}num${RESET} + -f display the foreground color escape sequence for ${UNDER}num${RESET} + ${UNDER}num${RESET} should be a value from 0 to 255. +EOF +exit 1 +} +# displays all 256 colors +disp() { +local c # color code +# print basic colors +echo "Basic (0 to 15):" +for c in {0..15}; do +# set the background color to its respective color code +echo -en "$(bgc $c) $RESET" +done +printf "\n\n" +# print greyscale +echo "Greyscale (232 to 255):" +for c in {232..255}; do +# set the background color to its respective color code +echo -en "$(bgc $c) $RESET" +done +printf "\n\n" +# show a chart of six 6x6 color palettes +echo "6x6x6 Cubic Palette (16 to 231): " +local colc=0 # column counter +local sixs=$(($TCOLS / 30)) # number of 6x6 palettes across screen +local cols=$(($sixs * 6)) # number of color columns (5 characters wide) + c=16 # starting color code +while [[ $c -lt 232 ]]; do # 16 to 231 +# set the background color to its respective color code +printf "$(bgc $c) %03d $RESET" "$c" +# increment the color code and the +((c++)) +((colc++)) +# enter a new line if the terminal width has been reached +if [[ $colc -eq $cols ]]; then +# go back to the first set of 6x6 colors on this line if any left +if [[ $((($c - 16) % 36)) -ne 0 ]]; then + c=$(($c - ($sixs - 1) * 36)) +fi + colc=0 # go back to the first column +echo # new line +# go to the next set of 6x6 colors +elif [[ $(($colc % 6)) -eq 0 ]] && [[ $(($c + 30)) -lt 232 ]]; then +((c+=30)) +fi +done +echo -e $RESET +} +# process only one option +if getopts ab:f: OPT; then +case "$OPT" in + a) # display all colors + disp + ;; + b|f)# display escape sequence + if [[ $OPTARG =~ ^[0-9]+$ && $OPTARG -ge 0 ]]; then + [[ $OPT == "b" ]] && bgc $OPTARG + [[ $OPT == "f" ]] && fgc $OPTARG + exit 0 + else + usage + fi + ;; + esac +else + usage +fi diff --git a/bin/.local/bin/compile b/bin/.local/bin/compile @@ -0,0 +1,61 @@ +#!/bin/sh + +_FILE=$(readlink -f "$1") +_DIR=$(dirname "$_FILE") +_BASE="${_FILE%.*}" +_PRFX="---COMPILE:" +_ARGS="$(grep -oP -- "$_PRFX.*$" "$_FILE" | sed -s "s|$_PRFX||")" + +cd "$_DIR" || return + +case "$_FILE" in +*\.ps.ms) preconv "$_FILE" \ + | refer \ + | tapas \ + | grap \ + | pic -Tps \ + | tbl -Tps \ + | eqn -Tps \ + | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -Tps \ + | ps2pdf - \ + | gs \ + -q \ + -dNOPAUSE \ + -dBATCH \ + -dPDFSETTINGS=/prepress \ + -sDEVICE=pdfwrite \ + -dPrinted=false \ + -sOutputFile="$_BASE.compiled.pdf" - + ;; +*\.ms) preconv "$_FILE" \ + | refer \ + | tapas \ + | grap \ + | pic -Tpdf \ + | tbl -Tpdf \ + | eqn -Tpdf \ + | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -P-e -Tpdf \ + | gs \ + -q \ + -dNOPAUSE \ + -dBATCH \ + -dPDFSETTINGS=/prepress \ + -sDEVICE=pdfwrite \ + -dPrinted=false \ + -sOutputFile="$_BASE.compiled.pdf" - + ;; +*\.md) lowdown -s -Tms "$_FILE" \ + | sed -e 's/\.nr PS 10/\.nr PS 12\n\.nr VS 18/g' \ + | preconv \ + | tbl -Tpdf \ + | groff -k -ms $_ARGS -dpaper=a4 -P-pa4 -P-e -Tpdf \ + | gs \ + -q \ + -dNOPAUSE \ + -dBATCH \ + -dPDFSETTINGS=/prepress \ + -sDEVICE=pdfwrite \ + -dPrinted=false \ + -sOutputFile="$_BASE.compiled.pdf" - + ;; +esac diff --git a/bin/.bin/contacts b/bin/.local/bin/contacts diff --git a/bin/.bin/dmenu_bookmarks b/bin/.local/bin/dmenu_bookmarks diff --git a/bin/.bin/dmenu_confirm b/bin/.local/bin/dmenu_confirm diff --git a/bin/.bin/dmenu_layouts b/bin/.local/bin/dmenu_layouts diff --git a/bin/.local/bin/dmenu_main b/bin/.local/bin/dmenu_main @@ -0,0 +1,53 @@ +#!/bin/sh + +args=" -p main: -l 20" +options=" + bookmarks + radio + man + operations + pass + power + soundcloud + todo + youtube +" + +get_fm_key () { + local key_location="/tmp/.di.fm.key" + local key_pass="di.fm/listen-key" + + [ ! -f "$key_location" ] \ + && touch "$key_location" \ + && chmod 600 "$key_location" \ + && pass "$key_pass" > "$key_location" + + echo $(cat "$key_location") +} + +while :; do + case "$(printf "$options" \ + | sed -e '/^$/d' -e 's/^[ \t]*//' \ + | sort \ + | dmenu_vtc${args})" in + bookmarks) + dmenu_bookmarks "$XDG_DATA_HOME/bookmarks" ${args} -i -p bookmark:;; + radio) + dmenu_radio "$(get_fm_key)" ${args} -i -p provider:;; + man) + dmenu_man${args} -i -p man:;; + operations) + operations dmenu${args} -i -p operations:;; + pass) + dmenu_passmenu ${args} -i -p pass:;; + power) + dmenu_power${args} -i;; + soundcloud) + dmenu_sscw${args} -i;; + todo) + dmenu_todo "$XDG_DATA_HOME/todo" ${args} -i -p todo:;; + youtube) + dmenu_yt_search${args} -i;; + *) break;; + esac +done diff --git a/bin/.bin/dmenu_man b/bin/.local/bin/dmenu_man diff --git a/bin/.bin/dmenu_mount b/bin/.local/bin/dmenu_mount diff --git a/bin/.bin/dmenu_passmenu b/bin/.local/bin/dmenu_passmenu diff --git a/bin/.bin/dmenu_path b/bin/.local/bin/dmenu_path diff --git a/bin/.bin/dmenu_power b/bin/.local/bin/dmenu_power diff --git a/bin/.bin/dmenu_radio b/bin/.local/bin/dmenu_radio diff --git a/bin/.bin/dmenu_run b/bin/.local/bin/dmenu_run diff --git a/bin/.bin/dmenu_sscw b/bin/.local/bin/dmenu_sscw diff --git a/bin/.bin/dmenu_themes b/bin/.local/bin/dmenu_themes diff --git a/bin/.bin/dmenu_todo b/bin/.local/bin/dmenu_todo diff --git a/bin/.bin/dmenu_umount b/bin/.local/bin/dmenu_umount diff --git a/bin/.bin/dmenu_url_extract b/bin/.local/bin/dmenu_url_extract diff --git a/bin/.bin/dmenu_url_open b/bin/.local/bin/dmenu_url_open diff --git a/bin/.bin/dmenu_vtc b/bin/.local/bin/dmenu_vtc diff --git a/bin/.bin/dmenu_yt_search b/bin/.local/bin/dmenu_yt_search diff --git a/bin/.local/bin/dwm-run b/bin/.local/bin/dwm-run @@ -0,0 +1,4 @@ +#!/bin/sh +while true; do + /usr/local/bin/dwm 2>"$HOME/.cache/dwm/dwm.log" +done diff --git a/bin/.bin/fetch-icals b/bin/.local/bin/fetch-icals diff --git a/bin/.bin/fix-home-permissions b/bin/.local/bin/fix-home-permissions diff --git a/bin/.bin/fzf-history.tmux b/bin/.local/bin/fzf-history.tmux diff --git a/bin/.bin/fzf-move-to.tmux b/bin/.local/bin/fzf-move-to.tmux diff --git a/bin/.bin/fzf-url.tmux b/bin/.local/bin/fzf-url.tmux diff --git a/bin/.bin/gen-adblock b/bin/.local/bin/gen-adblock diff --git a/bin/.bin/generate-mutt-alias b/bin/.local/bin/generate-mutt-alias diff --git a/bin/.bin/gpg-edit b/bin/.local/bin/gpg-edit diff --git a/bin/.bin/lbry2rss b/bin/.local/bin/lbry2rss diff --git a/bin/.bin/listen-ac-change b/bin/.local/bin/listen-ac-change diff --git a/bin/.bin/listen-new-mail b/bin/.local/bin/listen-new-mail diff --git a/bin/.bin/listen-new-pkg b/bin/.local/bin/listen-new-pkg diff --git a/bin/.bin/mbsync-stdin b/bin/.local/bin/mbsync-stdin diff --git a/bin/.bin/mkthemes b/bin/.local/bin/mkthemes diff --git a/bin/.bin/mnt b/bin/.local/bin/mnt diff --git a/bin/.bin/monitor b/bin/.local/bin/monitor diff --git a/bin/.bin/msmtp-tpl b/bin/.local/bin/msmtp-tpl diff --git a/bin/.bin/nrowgrid.tmux b/bin/.local/bin/nrowgrid.tmux diff --git a/bin/.local/bin/operations b/bin/.local/bin/operations @@ -0,0 +1,57 @@ +#!/bin/sh + +args="${@}" +args="${args#$1}" +args="${args#dmenu}" +option="$([ "$1" = "-" ] && cat - || echo "$1")" + +case "$option" in +list) + echo notify + echo sync-mail + echo ztatus +;; +notify) + text="$( + [ "$2" = "" ] \ + && echo "$(echo -n | dmenu_vtc${args} -l 0 -p text:)" \ + || echo "$2" + )" + if [ "$text" != "" ]; then + ztatusc notify "$text" + else + operations dmenu ${args} + fi +;; +ztatus) + case "$2" in + list) + echo show-time + ;; + show-time) + ztatusc toggle datetime + ;; + dmenu|"") + option="$(operations ztatus list | dmenu_vtc${args} -p ztatus:)" + if [ "$option" != "" ]; then + operations ztatus "$option" + else + operations dmenu "${args}" + fi + ;; + esac +;; +sync-mail) + ~/.local/bin/mbsync-stdin < ~/.config/mbsync/template -a -V + for f in ~/mail/webmail-*/INBOX/new/*; do touch "$f" 2>/dev/null; done +;; +dmenu|"") + option="$(operations list | dmenu_vtc${@#dmenu})" + if [ "$option" != "" ]; then + operations "$option" "${@#dmenu}" + fi +;; +*) + printf 'the operation "%s" is not implamented.\n' "$option" +;; +esac diff --git a/bin/.bin/pedit b/bin/.local/bin/pedit diff --git a/bin/.bin/print-sxhkd b/bin/.local/bin/print-sxhkd diff --git a/bin/.bin/proxify b/bin/.local/bin/proxify diff --git a/bin/.bin/repo-graph b/bin/.local/bin/repo-graph diff --git a/bin/.bin/screenrec b/bin/.local/bin/screenrec diff --git a/bin/.bin/screenshot b/bin/.local/bin/screenshot diff --git a/bin/.bin/set-wallpaper b/bin/.local/bin/set-wallpaper diff --git a/bin/.bin/ssh-add-pass b/bin/.local/bin/ssh-add-pass diff --git a/bin/.local/bin/ssh-agent-init b/bin/.local/bin/ssh-agent-init @@ -0,0 +1,14 @@ +#!/bin/sh + +ssh-add -D +set -- $(ls "$XDG_DATA_HOME/pass/ssh"); for key +do + pass ssh/$key/passphrase | ssh-add-pass "$HOME/.ssh/keys/.$key.key" \ + 2>&1 >/dev/null && printf '[%s+%s] identity added: %s%s%s\n' \ + "$(tput setaf 10)" \ + "$(tput sgr0)" \ + "$(tput setaf 15)" \ + "$key" \ + "$(tput sgr0)" +done +touch "$HOME/.tmp/.ssh-agent-init-done" diff --git a/bin/.local/bin/status.tmux b/bin/.local/bin/status.tmux @@ -0,0 +1,26 @@ +#!/bin/sh + +case "$1" in +cpu) + echo "$(cut -f1 /tmp/.tmstat)%" + ;; +mem) + echo "$(cut -f2 /tmp/.tmstat)%" + ;; +battery) + _PATH="/sys/class/power_supply/BAT0" + _STATUS="$(cat "$_PATH/status")" + _FULL="$(cat "$_PATH/energy_full")" + _NOW="$(cat "$_PATH/energy_now")" + + [ "$_STATUS" = "Discharging" ] && _STATUS="-" || _STATUS="+" + echo "$_STATUS$((100 * _NOW / _FULL))%" + ;; +temp) + _TEMP="$(sensors | awk '/Core\ 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}')" + + echo "$_TEMP°c" + ;; +pkg) + echo "$([ -f /tmp/.xbps.queue ] && cat /tmp/.xbps.queue || echo 0)•" +esac diff --git a/bin/.bin/timer b/bin/.local/bin/timer diff --git a/bin/.local/bin/tmstat b/bin/.local/bin/tmstat @@ -0,0 +1,16 @@ +#!/bin/sh + +stat="/bin/vmstat" + +[ "$(pidof -o $$ -x "$(basename $0)")" != "" ] && return + +while :; do + cpu="$($stat 1 5 -w \ + | stdbuf -o0 cut -c1- \ + | tail -1 \ + | awk '{print 100-$15}')" + mem="$($stat -s \ + | { read a b ; read c d ; echo $((100 * $c / $a)); })" + echo "$cpu\t$mem" > /tmp/.tmstat +done + diff --git a/bin/.local/bin/tmux-term b/bin/.local/bin/tmux-term @@ -0,0 +1,3 @@ +#!/bin/sh + +cd $HOME && $TERMINAL -e /bin/tmux -f "$XDG_CONFIG_HOME/tmux/tmux.conf" "$@" diff --git a/bin/.local/bin/vifmimg b/bin/.local/bin/vifmimg @@ -0,0 +1,84 @@ +#!/bin/sh +readonly ID_PREVIEW="preview" +readonly TMP="/tmp$PWD" +readonly _X="$2" +readonly _Y="$3" +readonly _W="$4" +readonly _H="$5" + +#PLAY_GIF="yes" +#AUTO_REMOVE="yes" + +# exit if required FIFO doesn't exist +[ ! -e "$FIFO_UEBERZUG" ] && exit + +_draw () { + echo "{ \ + \"action\" : \"add\", \ + \"identifier\" : \"$ID_PREVIEW\", \ + \"x\" : $_X, \ + \"y\" : $((_Y + 1)), \ + \"width\" : $_W, \ + \"height\" : $_H, \ + \"path\" : \"$1\" \ + }" > "$FIFO_UEBERZUG" +} + +case "$1" in +draw) + _draw "$PWD/$6" + ;; +drawmagick) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && convert -resize 200x200 -density 1200 "$PWD/$6" "$TMP/$6.png" + _draw "$TMP/$6.png" + ;; +drawff) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + if [ ! -f "$TMP/$6.png" ]; then + case "$6" in + *.ff.bz) bzip2 -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff.gz) gzip -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff.xz) xz -d -c "$PWD/$6" | ff2png > "$TMP/$6.png" ;; + *.ff) ff2png < "$PWD/$6" > "$TMP/$6.png" ;; + *) exit ;; + esac + convert -resize 512x512\> "$TMP/$6.png" "$TMP/$6.png" + fi + _draw "$TMP/$6.png" + ;; +videopreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && ffmpegthumbnailer -i "$PWD/$6" -o "$TMP/$6.png" -s 0 -q 10 + _draw "$TMP/$6.png" + ;; +gifpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" && convert -coalesce "$PWD/$6" "$TMP/$6/$6.png" + if [ -n "$PLAY_GIF" ]; then + for frame in $(find "$TMP/$6" -name "*.png" | sort -V); do + _draw "$frame" + sleep .07 + done + else + _draw "$TMP/$6/$6-0.png" + fi + ;; +epubpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && epub-thumbnailer "$6" "$TMP/$6.png" 512 + _draw "$TMP/$6.png" + ;; +pdfpreview) + [ ! -d "$TMP/$6/" ] && mkdir -p "$TMP/$6/" + [ ! -f "$TMP/$6.png" ] && pdftoppm -png -singlefile "$6" "$TMP/$6" + _draw "$TMP/$6.png" + ;; +clear) + echo "{ \ + \"action\" : \"remove\", \ + \"identifier\" : \"$ID_PREVIEW\" \ + }" > "$FIFO_UEBERZUG" + [ -n "$AUTO_REMOVE" ] && [ -f "$TMP/$6.png" ] && rm -f "$TMP/$6.png" + [ -n "$AUTO_REMOVE" ] && [ -d "$TMP/$6/" ] && rm -rf "$TMP/$6/" + ;; +esac diff --git a/bin/.bin/vifmrun b/bin/.local/bin/vifmrun diff --git a/bin/.local/bin/web-report b/bin/.local/bin/web-report @@ -0,0 +1,30 @@ +#!/bin/sh + +site="$(fzf < $XDG_DATA_HOME/web-report/sites)" +action="cat /var/log/quark.%s/*.u /var/log/quark.%s/current 2>/dev/null \ + | grep '^[^ ]* [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' 2>/dev/null \ + | goaccess 2>/dev/null \ + --exclude-ip 10.0.0.0-10.255.255.255 \ + --log-format='%%^ %%dT%%tZ\t%%h\t%%s\t%%v\t%%U' \ + --date-format='%%Y-%%m-%%d' \ + --time-format='%%H:%%M:%%S' \ + --html-prefs='{ \ + \"theme\" : \"darkBlue\", \ + \"perPage\" : 10, \ + \"layout\" : \"horizontal\", \ + \"showTables\" : true, \ + \"visitors\" : { \ + \"plot\" : { \ + \"chartType\" : \"area-spline\" \ + } \ + } \ + }' \ + --ignore-panel='OS' \ + --ignore-panel='BROWSERS' \ + --ignore-panel='VIRTUAL_HOSTS' \ + --ignore-panel='REFERRERS' \ + --ignore-panel='REFERRING_SITES' \ + --ignore-panel='KEYPHRASES' \ + -o html -" + +ssh anthra -t "$(printf "$action" "$site" "$site")" | vimb -c /dev/null - diff --git a/cdm/.config/cdm/cdmrc b/cdm/.config/cdm/cdmrc @@ -14,13 +14,14 @@ # '/usr/bin/fbterm' # or start a frame buffer console, # '/usr/bin/cdm ~/.submenu.cdmrc' # or go to a submenu :) # ) +# TODO :: rewrite for /bin/sh binlist=( - '/usr/bin/startx /home/z0noxz/.xinitrc dwm' - 'echo /bin/tmux | /usr/bin/ksh -l' - '/usr/bin/ksh -l' - 'sudo runit-init 6' - 'sudo runit-init 0' + "/usr/bin/startx $XDG_CONFIG_HOME/X11/xinitrc dwm" + "echo /bin/tmux | /usr/bin/ksh -l" + "/usr/bin/ksh -l" + "sudo runit-init 6" + "sudo runit-init 0" ) # List all program display names, one-by-one matched with $binlist. diff --git a/freecad/.config/FreeCAD/user.cfg b/freecad/.config/FreeCAD/user.cfg @@ -115,4 +115,5 @@ + </FCParameters> diff --git a/input/.config/readline/inputrc b/input/.config/readline/inputrc @@ -0,0 +1,4 @@ +$include /etc/inputrc + +set keyseq-timeout 50 +set editing-mode vi diff --git a/input/.inputrc b/input/.inputrc @@ -1,7 +0,0 @@ -$include /etc/inputrc - -set keyseq-timeout 50 -set editing-mode vi -##set show-mode-in-prompt on -##set vi-ins-mode-string "\1\e[32;1m\2[INS]\1\e[0m\2 " -##set vi-cmd-mode-string "\1\e[31;1m\2[CMD]\1\e[0m\2 " diff --git a/irssi/.config/irssi/config b/irssi/.config/irssi/config @@ -54,7 +54,7 @@ servers = ( chatnet = "Freenode"; port = "6697"; use_tls = "yes"; - tls_cert = "~/.secret/irssi-login-keys/z0noxz.pem"; + tls_cert = "/tmp/.irssi.pem"; tls_verify = "yes"; autoconnect = "no"; }, @@ -63,7 +63,7 @@ servers = ( chatnet = "FreenodeTor"; port = "6697"; use_tls = "yes"; - tls_cert = "~/.secret/irssi-login-keys/z0noxz.pem"; + tls_cert = "/tmp/.irssi.pem"; tls_verify = "no"; autoconnect = "no"; }, @@ -72,7 +72,7 @@ servers = ( chatnet = "OFTC"; port = "6697"; use_tls = "yes"; - tls_cert = "~/.secret/irssi-login-keys/z0noxz.pem"; + tls_cert = "/tmp/.irssi.pem"; tls_verify = "yes"; autoconnect = "no"; } diff --git a/ksh/.config/ksh/kshrc b/ksh/.config/ksh/kshrc @@ -0,0 +1,9 @@ +#!/bin/ksh + +# if not running interactively, don't do anything +[ "${-#*i}" = "${-}" ] && return + +for sh in "$XDG_CONFIG_HOME/ksh/kshrc.d/"*.sh +do + . $sh +done diff --git a/ksh/.kshrc.d/00-options.sh b/ksh/.config/ksh/kshrc.d/00-options.sh diff --git a/ksh/.config/ksh/kshrc.d/10-enviornment.sh b/ksh/.config/ksh/kshrc.d/10-enviornment.sh @@ -0,0 +1,124 @@ +#!/bin/ksh + +export VISUAL="vim" +export EDITOR="$VISUAL" +export BROWSER="/usr/local/bin/surf" +export IMG_VIEWER="/usr/local/bin/sxiv" +export PDF_VIEWER="/bin/zathura" +export HISTFILE="$HOME/.cache/ksh/history" +export REFER="$HOME/documents/data/refer.bib" +export GROFF_FONT_PATH="$HOME/.fonts/groff" +export RTV_BROWSER="$BROWSER -y surf_rtv" +export FZF_DEFAULT_OPTS="--bind='K:up,J:down,H:preview-up,L:preview-down'" +export GREP_COLORS="\ +ms=01;31:\ +mc=01;31:\ +sl=:\ +cx=:\ +fn=01;37:\ +ln=32:\ +bn=32:\ +se=36" +export LS_COLORS="\ +no=00:\ +fi=00:\ +di=01;34:\ +ln=01;36:\ +pi=40;33:\ +so=01;36:\ +do=01;36:\ +bd=40;33;01:\ +cd=40;33;01:\ +or=40;31;01:\ +mi=01;05;37;41:\ +su=37;41:\ +sg=30;43:\ +ca=30;41:\ +tw=30;42:\ +ow=34;42:\ +st=37;44:\ +ex=01;32:\ +\ +*.tar=01;31:\ +*.tgz=01;31:\ +*.svgz=01;31:\ +*.arj=01;31:\ +*.taz=01;31:\ +*.lzh=01;31:\ +*.lzma=01;31:\ +*.zip=01;31:\ +*.z=01;31:\ +*.Z=01;31:\ +*.dz=01;31:\ +*.gz=01;31:\ +*.bz2=01;31:\ +*.tbz2=01;31:\ +*.bz=01;31:\ +*.tz=01;31:\ +*.deb=01;31:\ +*.rpm=01;31:\ +*.jar=01;31:\ +*.rar=01;31:\ +*.ace=01;31:\ +*.zoo=01;31:\ +*.cpio=01;31:\ +*.7z=01;31:\ +*.rz=01;31:\ +\ +*.jpg=01;36:\ +*.jpeg=01;36:\ +*.gif=01;36:\ +*.bmp=01;36:\ +*.pbm=01;36:\ +*.pgm=01;36:\ +*.ppm=01;36:\ +*.tga=01;36:\ +*.xbm=01;36:\ +*.xpm=01;36:\ +*.tif=01;36:\ +*.tiff=01;36:\ +*.ff.bz=01;36:\ +*.ff.gz=01;36:\ +*.ff.xz=01;36:\ +*.png=01;36:\ +*.mng=01;36:\ +*.pcx=01;36:\ +*.mov=01;36:\ +*.mpg=01;36:\ +*.mpeg=01;36:\ +*.m2v=01;36:\ +*.mkv=01;36:\ +*.ogm=01;36:\ +*.mp4=01;36:\ +*.m4v=01;36:\ +*.mp4v=01;36:\ +*.vob=01;36:\ +*.qt=01;36:\ +*.nuv=01;36:\ +*.wmv=01;36:\ +*.asf=01;36:\ +*.rm=01;36:\ +*.rmvb=01;36:\ +*.flc=01;36:\ +*.avi=01;36:\ +*.fli=01;36:\ +*.gl=01;36:\ +*.dl=01;36:\ +*.xcf=01;36:\ +*.xwd=01;36:\ +*.yuv=01;36:\ +*.svg=01;36:\ +*.pdf=01;36:\ +\ +*.aac=00;36:\ +*.au=00;36:\ +*.flac=00;36:\ +*.mid=00;36:\ +*.midi=00;36:\ +*.mka=00;36:\ +*.mp3=00;36:\ +*.mpc=00;36:\ +*.ogg=00;36:\ +*.ra=00;36:\ +*.wav=00;36:\ +" diff --git a/ksh/.config/ksh/kshrc.d/11-less.sh b/ksh/.config/ksh/kshrc.d/11-less.sh @@ -0,0 +1,24 @@ +#!/bin/ksh + +export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" +export LESS=" -R " + +# termcap terminfo +# ks smkx make the keypad send commands +# ke rmkx make the keypad send digits +# vb flash emit visual bell +# mb blink start blink +# md bold start bold +# me sgr0 turn off bold, blink and underline +# so smso start standout (reverse video) +# se rmso stop standout +# us smul start underline +# ue rmul stop underline + +export LESS_TERMCAP_mb=$(tput setaf 7; tput bold) +export LESS_TERMCAP_md=$(tput setaf 7; tput bold) +export LESS_TERMCAP_me=$(tput sgr0) +export LESS_TERMCAP_so=$(tput setaf 6; tput rev) +export LESS_TERMCAP_se=$(tput sgr0) +export LESS_TERMCAP_us=$(tput setaf 1; tput smul) +export LESS_TERMCAP_ue=$(tput sgr0) diff --git a/ksh/.config/ksh/kshrc.d/20-completion.sh b/ksh/.config/ksh/kshrc.d/20-completion.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +readonly _tmp_ksh_completion="/tmp/ksh_completion" +readonly _tmp_sv_list="$_tmp_ksh_completion/sv_list" +readonly _tmp_mpvc_cmds="$_tmp_ksh_completion/mpvc_cmds" +readonly _tmp_host_list="$_tmp_ksh_completion/host_list" +readonly _tmp_pkg_cmds="$_tmp_ksh_completion/pkg_cmds" +readonly _tmp_pass_list="$_tmp_ksh_completion/pass_list" +readonly _tmp_man_list="$_tmp_ksh_completion/man_list" +readonly _tmp_op_list="$_tmp_ksh_completion/op_list" + +ksh_completion_load () { + [ ! -d "$_tmp_ksh_completion" ] && mkdir -p "$_tmp_ksh_completion" + [ ! -f "$_tmp_sv_list" ] && \ + ls -1 /var/service > "$_tmp_sv_list" + [ ! -f "$_tmp_mpvc_cmds" ] && \ + mpvc | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_mpvc_cmds" + [ ! -f "$_tmp_host_list" ] && \ + awk '{split($1,a,","); gsub("].*", "", a[1]); gsub("\\[", "", a[1]); print a[1] " root@" a[1]}' "$HOME/.ssh/known_hosts" | sort | uniq > "$_tmp_host_list" + [ ! -f "$_tmp_pkg_cmds" ] && \ + pkg | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_pkg_cmds" + [ ! -f "$_tmp_pass_list" ] && \ + find "$XDG_DATA_HOME/pass/" -type f | grep "gpg$" | sed 's/^.*\pass\///' | sed 's/\.gpg$//' > "$_tmp_pass_list" + [ ! -f "$_tmp_man_list" ] && \ + man -k Nm~. | cut -d\( -f1 | tr -d , > "$_tmp_man_list" + [ ! -f "$_tmp_op_list" ] && \ + operations list > "$_tmp_op_list" + + typeset _sv_list="$(cat "$_tmp_sv_list")" + typeset _mpvc_cmds="$(cat "$_tmp_mpvc_cmds")" + typeset _host_list="$(cat "$_tmp_host_list")" + typeset _pkg_cmds="$(cat "$_tmp_pkg_cmds")" + typeset _pass_list="$(cat "$_tmp_pass_list")" + typeset _man_list="$(cat "$_tmp_man_list")" + typeset _op_list="$(cat "$_tmp_op_list")" + + set -A complete_sv_1 -- reload restart start status stop + set -A complete_sv_2 -- ${_sv_list} + set -A complete_mpvc_1 -- ${_mpvc_cmds} + set -A complete_ssh -- ${_host_list} + set -A complete_pkg_1 -- ${_pkg_cmds} + set -A complete_pass -- ${_pass_list} ls find show grep insert edit generate rm mv cp git help version + set -A complete_operations_1 -- ${_op_list} + set -A complete_make_1 -- clean install publish + set -A complete_git_1 -- clone checkout commit pull push status + + case "$1" in + # slow completion commands here + full) + set -A complete_man_1 -- ${_man_list} + ;; + esac +} + +ksh_completion_reload () { + rm -f "$_tmp_sv_list" + rm -f "$_tmp_mpvc_cmds" + rm -f "$_tmp_host_list" + rm -f "$_tmp_pkg_cmds" + rm -f "$_tmp_pass_list" + rm -f "$_tmp_man_list" + rm -f "$_tmp_op_list" + + ksh_completion_load +} + +ksh_completion_load + +# https://deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html diff --git a/ksh/.config/ksh/kshrc.d/30-alias.sh b/ksh/.config/ksh/kshrc.d/30-alias.sh @@ -0,0 +1,21 @@ +#=====================================# +# Personnal aliases # +#=====================================# +## TODO :: https://www.bigeekfan.com/post/20190315_refining_ksh_and_fzf/ + +# quickies +alias ..='cd ..' +alias :r='. ~/.kshrc' +alias :q='exit' + +# source aliases into functions +for a in ~/.local/bin/alias/*; do + unalias "${a##*/}" + eval "${a##*/}() { + . $a + }" +done + +# extra +alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla" +alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""' diff --git a/ksh/.kshrc.d/51-ssh-agent.sh b/ksh/.config/ksh/kshrc.d/51-ssh-agent.sh diff --git a/ksh/.kshrc.d/90-prompt.sh b/ksh/.config/ksh/kshrc.d/90-prompt.sh diff --git a/ksh/.kshrc b/ksh/.kshrc @@ -1,9 +0,0 @@ -#!/bin/ksh - -# if not running interactively, don't do anything -[ "${-#*i}" = "${-}" ] && return - -for sh in $HOME/.kshrc.d/*.sh -do - . $sh -done diff --git a/ksh/.kshrc.d/10-enviornment.sh b/ksh/.kshrc.d/10-enviornment.sh @@ -1,125 +0,0 @@ -#!/bin/ksh - -export VISUAL="vim" -export EDITOR="$VISUAL" -export BROWSER="/usr/local/bin/surf" -export IMG_VIEWER="/usr/local/bin/sxiv" -export PDF_VIEWER="/bin/zathura" -export HISTFILE="$HOME/.cache/ksh/history" -export REFER="$HOME/documents/data/refer.bib" -export GROFF_FONT_PATH="$HOME/.fonts/groff" -export RTV_BROWSER="$BROWSER -y surf_rtv" -export LESSHISTFILE="$HOME/.cache/less/history" -export FZF_DEFAULT_OPTS="--bind='K:up,J:down,H:preview-up,L:preview-down'" -export GREP_COLORS="\ -ms=01;31:\ -mc=01;31:\ -sl=:\ -cx=:\ -fn=01;37:\ -ln=32:\ -bn=32:\ -se=36" -export LS_COLORS="\ -no=00:\ -fi=00:\ -di=01;34:\ -ln=01;36:\ -pi=40;33:\ -so=01;36:\ -do=01;36:\ -bd=40;33;01:\ -cd=40;33;01:\ -or=40;31;01:\ -mi=01;05;37;41:\ -su=37;41:\ -sg=30;43:\ -ca=30;41:\ -tw=30;42:\ -ow=34;42:\ -st=37;44:\ -ex=01;32:\ -\ -*.tar=01;31:\ -*.tgz=01;31:\ -*.svgz=01;31:\ -*.arj=01;31:\ -*.taz=01;31:\ -*.lzh=01;31:\ -*.lzma=01;31:\ -*.zip=01;31:\ -*.z=01;31:\ -*.Z=01;31:\ -*.dz=01;31:\ -*.gz=01;31:\ -*.bz2=01;31:\ -*.tbz2=01;31:\ -*.bz=01;31:\ -*.tz=01;31:\ -*.deb=01;31:\ -*.rpm=01;31:\ -*.jar=01;31:\ -*.rar=01;31:\ -*.ace=01;31:\ -*.zoo=01;31:\ -*.cpio=01;31:\ -*.7z=01;31:\ -*.rz=01;31:\ -\ -*.jpg=01;36:\ -*.jpeg=01;36:\ -*.gif=01;36:\ -*.bmp=01;36:\ -*.pbm=01;36:\ -*.pgm=01;36:\ -*.ppm=01;36:\ -*.tga=01;36:\ -*.xbm=01;36:\ -*.xpm=01;36:\ -*.tif=01;36:\ -*.tiff=01;36:\ -*.ff.bz=01;36:\ -*.ff.gz=01;36:\ -*.ff.xz=01;36:\ -*.png=01;36:\ -*.mng=01;36:\ -*.pcx=01;36:\ -*.mov=01;36:\ -*.mpg=01;36:\ -*.mpeg=01;36:\ -*.m2v=01;36:\ -*.mkv=01;36:\ -*.ogm=01;36:\ -*.mp4=01;36:\ -*.m4v=01;36:\ -*.mp4v=01;36:\ -*.vob=01;36:\ -*.qt=01;36:\ -*.nuv=01;36:\ -*.wmv=01;36:\ -*.asf=01;36:\ -*.rm=01;36:\ -*.rmvb=01;36:\ -*.flc=01;36:\ -*.avi=01;36:\ -*.fli=01;36:\ -*.gl=01;36:\ -*.dl=01;36:\ -*.xcf=01;36:\ -*.xwd=01;36:\ -*.yuv=01;36:\ -*.svg=01;36:\ -*.pdf=01;36:\ -\ -*.aac=00;36:\ -*.au=00;36:\ -*.flac=00;36:\ -*.mid=00;36:\ -*.midi=00;36:\ -*.mka=00;36:\ -*.mp3=00;36:\ -*.mpc=00;36:\ -*.ogg=00;36:\ -*.ra=00;36:\ -*.wav=00;36:\ -" diff --git a/ksh/.kshrc.d/20-completion.sh b/ksh/.kshrc.d/20-completion.sh @@ -1,69 +0,0 @@ -#!/bin/sh - -readonly _tmp_ksh_completion="/tmp/ksh_completion" -readonly _tmp_sv_list="$_tmp_ksh_completion/sv_list" -readonly _tmp_mpvc_cmds="$_tmp_ksh_completion/mpvc_cmds" -readonly _tmp_host_list="$_tmp_ksh_completion/host_list" -readonly _tmp_pkg_cmds="$_tmp_ksh_completion/pkg_cmds" -readonly _tmp_pass_list="$_tmp_ksh_completion/pass_list" -readonly _tmp_man_list="$_tmp_ksh_completion/man_list" -readonly _tmp_op_list="$_tmp_ksh_completion/op_list" - -ksh_completion_load () { - [ ! -d "$_tmp_ksh_completion" ] && mkdir -p "$_tmp_ksh_completion" - [ ! -f "$_tmp_sv_list" ] && \ - ls -1 /var/service > "$_tmp_sv_list" - [ ! -f "$_tmp_mpvc_cmds" ] && \ - mpvc | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_mpvc_cmds" - [ ! -f "$_tmp_host_list" ] && \ - awk '{split($1,a,","); gsub("].*", "", a[1]); gsub("\\[", "", a[1]); print a[1] " root@" a[1]}' "$HOME/.ssh/known_hosts" | sort | uniq > "$_tmp_host_list" - [ ! -f "$_tmp_pkg_cmds" ] && \ - pkg | grep -e '^ [a-z]*' | grep -v -e '^[[:space:]]*$' | awk '{print $1;}' > "$_tmp_pkg_cmds" - [ ! -f "$_tmp_pass_list" ] && \ - find "$HOME/.password-store/" -type f | grep "gpg$" | sed 's/^.*\.password-store\///' | sed 's/\.gpg$//' > "$_tmp_pass_list" - [ ! -f "$_tmp_man_list" ] && \ - man -k Nm~. | cut -d\( -f1 | tr -d , > "$_tmp_man_list" - [ ! -f "$_tmp_op_list" ] && \ - operations list > "$_tmp_op_list" - - typeset _sv_list="$(cat "$_tmp_sv_list")" - typeset _mpvc_cmds="$(cat "$_tmp_mpvc_cmds")" - typeset _host_list="$(cat "$_tmp_host_list")" - typeset _pkg_cmds="$(cat "$_tmp_pkg_cmds")" - typeset _pass_list="$(cat "$_tmp_pass_list")" - typeset _man_list="$(cat "$_tmp_man_list")" - typeset _op_list="$(cat "$_tmp_op_list")" - - set -A complete_sv_1 -- reload restart start status stop - set -A complete_sv_2 -- ${_sv_list} - set -A complete_mpvc_1 -- ${_mpvc_cmds} - set -A complete_ssh -- ${_host_list} - set -A complete_pkg_1 -- ${_pkg_cmds} - set -A complete_pass -- ${_pass_list} ls find show grep insert edit generate rm mv cp git help version - set -A complete_operations_1 -- ${_op_list} - set -A complete_make_1 -- clean install publish - set -A complete_git_1 -- clone checkout commit pull push status - - case "$1" in - # slow completion commands here - full) - set -A complete_man_1 -- ${_man_list} - ;; - esac -} - -ksh_completion_reload () { - rm "$_tmp_sv_list" - rm "$_tmp_mpvc_cmds" - rm "$_tmp_host_list" - rm "$_tmp_pkg_cmds" - rm "$_tmp_pass_list" - rm "$_tmp_man_list" - rm "$_tmp_op_list" - - ksh_completion_load -} - -ksh_completion_load - -# https://deftly.net/posts/2017-05-01-openbsd-ksh-tab-complete.html diff --git a/ksh/.kshrc.d/30-alias.sh b/ksh/.kshrc.d/30-alias.sh @@ -1,21 +0,0 @@ -#=====================================# -# Personnal aliases # -#=====================================# -## TODO :: https://www.bigeekfan.com/post/20190315_refining_ksh_and_fzf/ - -# quickies -alias ..='cd ..' -alias :r='. ~/.kshrc' -alias :q='exit' - -# source aliases into functions -for a in ~/.bin/alias/*; do - unalias "${a##*/}" - eval "${a##*/}() { - . $a - }" -done - -# extra -alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla" -alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""' diff --git a/ksh/.profile b/ksh/.profile @@ -1,36 +1,51 @@ -# set .kshrc as ENV if it exists -[ -f "$HOME/.kshrc" ] && export ENV="$HOME/.kshrc" - -# setup XDG +# setup XDG environment variables test -z "$XDG_DATA_HOME" && export XDG_DATA_HOME="$HOME/.local/share" test -z "$XDG_CONFIG_HOME" && export XDG_CONFIG_HOME="$HOME/.config" test -z "$XDG_DATA_DIRS" && export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" test -z "$XDG_CONFIG_DIRS" && export XDG_CONFIG_DIRS="/etc/xdg" test -z "$XDG_CACHE_HOME" && export XDG_CACHE_HOME="$HOME/.cache" -test -z "$XDG_RUNTIME_DIR" && export XDG_RUNTIME_DIR="/tmp/${UID}-runtime-dir" +test -z "$XDG_RUNTIME_DIR" && export XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir" # create XDG_RUNTIME_DIR if non-existent if ! test -d "${XDG_RUNTIME_DIR}"; then - mkdir "${XDG_RUNTIME_DIR}" - chmod 0700 "${XDG_RUNTIME_DIR}" + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" fi +# set kshrc as ENV if it exists +[ -f "$XDG_CONFIG_HOME/ksh/kshrc" ] && export ENV="$XDG_CONFIG_HOME/ksh/kshrc" + # add local paths -export PATH="$PATH:$HOME/.bin:/xtra/bin" +export PATH="$PATH:$HOME/.local/bin:/xtra/bin" -# setup vimrc with XDG support +# setup pseudo XDG support +export DVDCSS_CACHE="$XDG_DATA_HOME/dvdcss" +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc" +export LESSHISTFILE=- +export LESSKEY="$XDG_CONFIG_HOME/less/lesskey" +export MYSQL_HISTFILE="$XDG_DATA_HOME/mysql_history" +export OCTAVE_HISTFILE="$XDG_CACHE_HOME/octave-hsts" +export OCTAVE_SITE_INITFILE="$XDG_CONFIG_HOME/octave/octaverc" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +export TERMINFO="$XDG_DATA_HOME/terminfo" +export TERMINFO_DIRS="$XDG_DATA_HOME/terminfo:/usr/share/terminfo" +export TMUX_TMPDIR="$XDG_RUNTIME_DIR" export VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +export XSERVERRC="$XDG_CONFIG_HOME/X11/xserverrc" -export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +# setup miscellaneous environment variables export TERMINAL="/usr/local/bin/st" export WM="dwm" # To avoid potential situation where cdm(1) crashes on every TTY, here we # default to execute cdm(1) on tty1 only, and leave other TTYs untouched. -if [ "$(tty)" = '/dev/tty1' ] -then - [ -n "$CDM_SPAWN" ] && return - # Avoid executing cdm(1) when X11 has already been started. - [ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ] && exec cdm +if [ "$(tty)" = '/dev/tty1' ]; then + [ -n "$CDM_SPAWN" ] && return + # Avoid executing cdm(1) when X11 has already been started. + [ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ] && exec cdm fi - diff --git a/link b/link @@ -23,7 +23,7 @@ apply_action() { case "$_name" in # special folders - .config|.ssh) + .config|.ssh|.local) [ "$into" = "" ] && apply_action "$subdir" "$_name" "$action" ;; *) diff --git a/newsboat/.config/newsboat/config b/newsboat/.config/newsboat/config @@ -1,6 +1,6 @@ # https://github.com/newsboat/newsboat/blob/master/src/configcontainer.cpp browser "dmenu_url_open" -cache-file ".data/newsboat/cache.db" +cache-file ".cache/newsboat/cache.db" history-limit 0 datetime-format "%Y-%m-%d %H:%M" articlelist-format " %4i %D %?T? %-20T ? %t" diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc @@ -64,7 +64,7 @@ super + control + shift + {1-9} echo toggle tag {0-8} > /tmp/dwm.fifo # :spawn terminal (with tmux) super + Return - echo spawn $HOME/.bin/tmux-term > /tmp/dwm.fifo + echo spawn $HOME/.local/bin/tmux-term > /tmp/dwm.fifo # :spawn terminal super + shift + Return echo spawn $TERMINAL > /tmp/dwm.fifo @@ -72,7 +72,7 @@ super + shift + Return # --- browsers ---------------------------------------------------------------- # :vimb tabbed super + shift + w - ~/.bin/alias/vimb-tabbed + ~/.local/bin/alias/vimb-tabbed # --- dmenus ------------------------------------------------------------------ # :run menu @@ -95,7 +95,9 @@ super + shift + t dmenu_themes # :kill menu super + q - dmenu_kill + dmenu_confirm "Are you sure you want to close this client?" \ + -w $(xdo id) \ + && xdo kill # :YouTube search menu super + y dmenu_yt_search diff --git a/sxiv/.config/sxiv/exec/key-handler b/sxiv/.config/sxiv/exec/key-handler @@ -7,13 +7,13 @@ while read file; do # set as wallpaper 'w') if [ "${path#*.ff.gz}" != "$path" ]; then - cp "$path" "$HOME/.wallpaper.ff.gz" + cp "$path" "$XDG_CONFIG_HOME/wallpaper.ff.gz" else tmpfile="$(mktemp /tmp/sxiv-wallpaper.XXXXXX)" convert "$path" png:- | png2ff | gzip -c > "$tmpfile" && \ - mv "$tmpfile" "$HOME/.wallpaper.ff.gz" + mv "$tmpfile" "$XDG_CONFIG_HOME/wallpaper.ff.gz" fi - swall "$HOME/.wallpaper.ff.gz" + swall "$XDG_CONFIG_HOME/wallpaper.ff.gz" ;; # rotate 90 degrees clockwise diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf @@ -29,7 +29,6 @@ set -g status-keys vi # misc. settings set -s escape-time 0 set -g renumber-windows on -set -g status-interval 10 # set window titles set -g set-titles on @@ -171,16 +170,20 @@ set -g pane-border-style 'bg=colour0,fg=colour5' set -g pane-active-border-style 'bg=colour0,fg=colour11' # statusbar +set -g status-interval 5 set -g status-position top set -g status-justify left -set -g status-right-length 64 +set -g status-right-length 72 set -g status-style 'bg=colour0,fg=colour15' set -g status-right-style 'bg=colour0,fg=colour15' set -g status-right '#(/bin/hostname) #[ \ fg=colour5,bg=colour0]#[ \ fg=colour6,bg=colour5 \ ] #(status.tmux battery) #[ \ - ] #(status.tmux temp) #[ \ + ] #(status.tmux temp) #[ \ + ] #(status.tmux cpu) #[ \ + ] #(status.tmux mem) #[ \ + ] #(status.tmux pkg) #[ \ fg=colour5,bg=colour6,reverse]#[ \ fg=colour0,bg=colour6,noreverse \ ] %Y-%m-%d  %R #[ \ diff --git a/vifm/.config/vifm/vifmrc b/vifm/.config/vifm/vifmrc @@ -86,6 +86,10 @@ fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm \ vifmimg draw %px %py %pw %ph %c \ %pc \ vifmimg clear +fileviewer *.svg,*.ico + \ vifmimg drawmagick %px %py %pw %ph %c + \ %pc + \ vifmimg clear fileviewer *.ff,*.ff.xz,*.ff.gz,*.ff.bz \ vifmimg drawff %px %py %pw %ph %c \ %pc diff --git a/vim/.config/vim/plugins/vim-ctab/vim-ctab.vim b/vim/.config/vim/plugins/vim-ctab/vim-ctab.vim @@ -0,0 +1,349 @@ +" Intelligent Indent +" Author: Michael Geddes < vimmer at frog dot wheelycreek dot net > +" Version: 2.6 +" Last Modified: December 2010 +" +" Histroy: +" 1.0: - Added RetabIndent command - similar to :retab, but doesn't cause +" internal tabs to be modified. +" 1.1: - Added support for backspacing over spaced tabs 'smarttab' style +" - Clean up the look of it by blanking the :call +" - No longer a 'filetype' plugin by default. +" 1.2: - Interactions with 'smarttab' were causing problems. Now fall back to +" vim's 'smarttab' setting when inserting 'indent' tabs. +" - Fixed compat with digraphs (which were getting swallowed) +" - Made <BS> mapping work with the 'filetype' plugin mode. +" - Make CTabAlignTo() public. +" 1.3: - Fix removing trailing spaces with RetabIndent! which was causing +" initial indents to disappear. +" 1.4: - Fixed Backspace tab being off by 1 +" 2.0: - Add support for alignment whitespace for mismatched brackets to be spaces. +" 2.1: - Fix = operator +" 2.3: - Fix (Gene Smith) for error with non C files +" - Add option for filetype maps +" - Allow for lisp indentation +" 2.4: - Fix bug in Retab +" 2.5: - Fix issue with <CR> not aligning +" 2.6: - Fix issue with alignment not disappearing. + +" This is designed as a filetype plugin (originally a 'Buffoptions.vim' script). +" +" The aim of this script is to be able to handle the mode of tab usage which +" distinguishes 'indent' from 'alignment'. The idea is to use <tab> +" characters only at the beginning of lines. +" +" This means that an individual can use their own 'tabstop' settings for the +" indent level, while not affecting alignment. +" +" The one caveat with this method of tabs is that you need to follow the rule +" that you never 'align' elements that have different 'indent' levels. +" +" :RetabIndent[!] [tabstop] +" This is similar to the :retab command, with the exception that it +" affects all and only whitespace at the start of the line, changing it to +" suit your current (or new) tabstop and expandtab setting. +" With the bang (!) at the end, the command also strips trailing +" whitespace. +" +" CTabAlignTo(n) +" 'Tab' to the n'th column from the start of the indent. + +" g:ctab_filetype_maps +" set this to true if script used as a filetype plugin +" g:ctab_disable_checkalign +" set this to true to disable re-check of alignment +" g:ctab_enable_default_filetype_maps +" disable the filetype specific maps +" g:ctab_disable_tab_maps +" disable the (original) tab mappings + +if exists('g:ctab_filetype_maps') && g:ctab_filetype_maps + let s:buff_map=' <buffer> ' +else + let s:buff_map='' +endif + +if exists('g:ctab_enable_default_filetype_maps') && ctab_enable_default_filetype_maps + if s:buff_map != '' + if (&filetype =~ '^\(cpp\|idl\)$' ) + imap <silent> <buffer> <expr> <m-;> CTabAlignTo(20).'//' + imap <silent> <buffer> <expr> <m-s-;> CTabAlignTo(30).'//' + imap <silent> <buffer> <m-s-;> + elseif &filetype == 'c' + imap <expr> <silent> <buffer> <m-;> CTabAlignTo(10).'/* */<left><left><left>' + endif + else + au FileType cpp,idl imap <expr> <silent> <buffer> <m-;> CTabAlignTo(20).'//' + au FileType cpp,idl imap <expr> <silent> <buffer> <m-:> CTabAlignTo(30).'//' + au FileType c imap <expr> <silent> <buffer> <m-;> CTabAlignTo(10).'/* */<left><left>' + endif +endif + +if !exists('g:ctab_disable_tab_maps') || ! g:ctab_disable_tab_maps + exe 'imap '.s:buff_map.'<silent> <expr> <tab> <SID>InsertSmartTab()' + exe 'inoremap '.s:buff_map.'<silent> <expr> <BS> <SID>DoSmartDelete()."\<BS>"' +endif + +"exe 'imap '.s:buff_map.'<silent> <expr> <BS> <SID>KeepDelLine()."\<BS>" + +" MRG: TODO +"exe 'imap '.s:buff_map.'<silent> <expr> <c-d> :call <SID>SmartDeleteTab()<CR>' +"exe 'imap '.s:buff_map.'<silent> <c-t> <SID>SmartInsertTab()' +" fun! s:SmartDeleteTab() +" let curcol=col('.')-&sw +" let origtxt=getline('.') +" let repl=matchstr(origtxt,'^\s\{-}\%'.(&sw+2)."v') +" if repl == '' then +" return "\<c-o>".':s/ *\zs /'.repeat(' ',(&ts-&sw)).'/'."\<CR>\<c-o>".curcol.'|' +" else +" return "\<c-o>".':s/^\s\{-}\%'.(&sw+1)."v//\<CR>\<c-o>".curcol."|" +" end +" +" endfun + +" Insert a smart tab. +fun! s:InsertSmartTab() + " Clear the status + echo '' + if strpart(getline('.'),0,col('.')-1) =~'^\s*$' + if exists('b:ctab_hook') && b:ctab_hook != '' + exe 'return '.b:ctab_hook + elseif exists('g:ctab_hook') && g:ctab_hook != '' + exe 'return '.g:ctab_hook + endif + return "\<Tab>" + endif + + let sts=exists("b:insidetabs")?(b:insidetabs):((&sts==0)?&sw:&sts) + let sp=(virtcol('.') % sts) + if sp==0 | let sp=sts | endif + return strpart(" ",0,1+sts-sp) +endfun + +fun! s:CheckLeaveLine(line) + if ('cpo' !~ 'I') && exists('b:ctab_lastalign') && (a:line == b:ctab_lastalign) + s/^\s*$//e + endif +endfun + +" Check on blanks +aug Ctab +au! InsertLeave * call <SID>CheckLeaveLine(line('.')) +aug END + + +" Do a smart delete. +" The <BS> is included at the end so that deleting back over line ends +" works as expected. +fun! s:DoSmartDelete() + " Clear the status + "echo '' + let uptohere=strpart(getline('.'),0,col('.')-1) + " If at the first part of the line, fall back on defaults... or if the + " preceding character is a <TAB>, then similarly fall back on defaults. + " + let lastchar=matchstr(uptohere,'.$') + if lastchar == "\<tab>" || uptohere =~ '^\s*$' | return '' | endif " Simple cases + if lastchar != ' ' | return ((&digraph)?("\<BS>".lastchar): '') | endif " Delete non space at end / Maintain digraphs + + " Work out how many tabs to use + let sts=(exists("b:insidetabs")?(b:insidetabs):((&sts==0)?(&sw):(&sts))) + + let ovc=virtcol('.') " Find where we are + let sp=(ovc % sts) " How many virtual characters to delete + if sp==0 | let sp=sts | endif " At least delete a whole tabstop + let vc=ovc-sp " Work out the new virtual column + " Find how many characters we need to delete (using \%v to do virtual column + " matching, and making sure we don't pass an invalid value to vc) + let uthlen=strlen(uptohere) + let bs= uthlen-((vc<1)?0:( match(uptohere,'\%'.(vc-1).'v'))) + let uthlen=uthlen-bs + " echo 'ovc = '.ovc.' sp = '.sp.' vc = '.vc.' bs = '.bs.' uthlen='.uthlen + if bs <= 0 | return '' | endif + + " Delete the specifed number of whitespace characters up to the first non-whitespace + let ret='' + let bs=bs-1 + if uptohere[uthlen+bs] !~ '\s'| return '' | endif + while bs>=-1 + let bs=bs-1 + if uptohere[uthlen+bs] !~ '\s' | break | endif + let ret=ret."\<BS>" + endwhile + return ret +endfun + +fun! s:Column(line) + let c=0 + let i=0 + let len=strlen(a:line) + while i< len + if a:line[i]=="\<tab>" + let c=(c+&tabstop) + let c=c-(c%&tabstop) + else + let c=c+1 + endif + let i=i+1 + endwhile + return c +endfun +fun! s:StartColumn(lineNo) + return s:Column(matchstr(getline(a:lineNo),'^\s*')) +endfun + +fun! CTabAlignTo(n) + let co=virtcol('.') + let ico=s:StartColumn('.')+a:n + if co>ico + let ico=co + endif + let spaces=ico-co + let spc='' + while spaces > 0 + let spc=spc." " + let spaces=spaces-1 + endwhile + return spc +endfun + +if ! exists('g:ctab_disable_checkalign') || g:ctab_disable_checkalign==0 + " Check the alignment of line. + " Used in the case where some alignment whitespace is required .. like for unmatched brackets. + fun! s:CheckAlign(line) + if &expandtab || !(&autoindent || &indentexpr || &cindent) + return '' + endif + + let tskeep=&ts + let swkeep=&sw + try + if a:line == line('.') + let b:ctab_lastalign=a:line + else + unlet b:ctab_lastalign + endif + set ts=50 + set sw=50 + if &indentexpr != '' + let v:lnum=a:line + sandbox exe 'let inda='.&indentexpr + if inda == -1 + let inda=indent(a:line-1) + endif + elseif &cindent + let inda=cindent(a:line) + elseif &lisp + let inda=lispindent(a:line) + elseif &autoindent + let inda=indent(a:line) + elseif &smarttab + return '' + else + let inda=0 + endif + finally + let &ts=tskeep + let &sw=swkeep + endtry + let indatabs=inda / 50 + let indaspace=inda % 50 + let indb=indent(a:line) + if indatabs*&tabstop + indaspace == indb + let txtindent=repeat("\<Tab>",indatabs).repeat(' ',indaspace) + call setline(a:line, substitute(getline(a:line),'^\s*',txtindent,'')) + endif + return '' + endfun + fun! s:SID() + return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$') + endfun + " Get the spaces at the end of the indent correct. + " This is trickier than it should be, but this seems to work. + fun! s:CheckCR() + " echo 'SID:'.s:SID() + if getline('.') =~ '^\s*$' + if ('cpo' !~ 'I') && exists('b:ctab_lastalign') && (line('.') == b:ctab_lastalign) + return "^\<c-d>\<CR>" + endif + return "\<CR>" + else + return "\<CR>\<c-r>=<SNR>".s:SID().'_CheckAlign(line(''.''))'."\<CR>\<END>" + endif + endfun + + "exe 'inoremap '.s:buff_map.'<silent> <CR> <CR><c-r>=<SID>CheckAlign(line(''.''))."\<lt>END>"<CR>' + exe 'inoremap '.s:buff_map.'<silent> <expr> <CR> <SID>CheckCR()' + exe 'nnoremap '.s:buff_map.'<silent> o o<c-r>=<SID>CheckAlign(line(''.''))."\<lt>END>"<CR>' + exe 'nnoremap '.s:buff_map.'<silent> O O<c-r>=<SID>CheckAlign(line(''.''))."\<lt>END>"<CR>' + + " Ok.. now re-evaluate the = re-indented section + + " The only way I can think to do this is to remap the = + " so that it calls the original, then checks all the indents. + exe 'map '.s:buff_map.'<silent> <expr> = <SID>SetupEqual()' + fun! s:SetupEqual() + set operatorfunc=CtabRedoIndent + " Call the operator func so we get the range + return 'g@' + endfun + + fun! CtabRedoIndent(type,...) + set operatorfunc= + let ln=line("'[") + let lnto=line("']") + " Do the original equals + norm! '[='] + + if ! &et + " Then check the alignment. + while ln <= lnto + silent call s:CheckAlign(ln) + let ln+=1 + endwhile + endif + endfun +endif + +" Retab the indent of a file - ie only the first nonspace +fun! s:RetabIndent( bang, firstl, lastl, tab ) + let checkspace=((!&expandtab)? "^\<tab>* ": "^ *\<tab>") + let l = a:firstl + let force= a:tab != '' && a:tab != 0 && (a:tab != &tabstop) + let checkalign = ( &expandtab || !(&autoindent || &indentexpr || &cindent)) && (!exists('g:ctab_disable_checkalign') || g:ctab_disable_checkalign==0) + let newtabstop = (force?(a:tab):(&tabstop)) + while l <= a:lastl + let txt=getline(l) + let store=0 + if a:bang == '!' && txt =~ '\s\+$' + let txt=substitute(txt,'\s\+$','','') + let store=1 + endif + if force || txt =~ checkspace + let i=indent(l) + let tabs= (&expandtab ? (0) : (i / newtabstop)) + let spaces=(&expandtab ? (i) : (i % newtabstop)) + let txtindent=repeat("\<tab>",tabs).repeat(' ',spaces) + let store = 1 + let txt=substitute(txt,'^\s*',txtindent,'') + endif + if store + call setline(l, txt ) + if checkalign + call s:CheckAlign(l) + endif + endif + + let l=l+1 + endwhile + if newtabstop != &tabstop | let &tabstop = newtabstop | endif +endfun + + +" Retab the indent of a file - ie only the first nonspace. +" Optional argument specified the value of the new tabstops +" Bang (!) causes trailing whitespace to be gobbled. +com! -nargs=? -range=% -bang -bar RetabIndent call <SID>RetabIndent(<q-bang>,<line1>, <line2>, <q-args> ) + + +" vim: sts=2 sw=2 et diff --git a/vim/.config/vim/vimrc b/vim/.config/vim/vimrc @@ -1,6 +1,27 @@ " TODO :: " * some sort of macro for 'make', 'groff' etc...? +" generic settings {{{ +syntax enable " enable syntax highlighting +let mapleader = "\<Space>" " lead with space +set nocompatible " use more features +set path+=** " search down into subfolders +set wildmenu " display all matches when tab complete +set t_Co=256 " use 256 colors +set number " line numbers +set relativenumber " relative line numbers +set cursorline " colored cursor line +set colorcolumn=80 " color column at 80 characters +set textwidth=79 " set text width to 79 characters +set showcmd " show incomplete commands +set fileformat=unix " use <NL> only like a normal person +set backspace=indent,eol,start " backspace through everything in insert mode +set list lcs=tab:»·,trail:· " highligt tabs and trailing spaces +set formatoptions+=tcrowanl " word and comment wrapping +set encoding=utf-8 " use utf-8 encoding +set title " use 'titlestring' as window title +" }}} + "XDG {{{ if empty("$XDG_CACHE_HOME") let $XDG_CACHE_HOME="$HOME/.cache" @@ -17,8 +38,8 @@ endif set directory=$XDG_CACHE_HOME/vim/swap,~/,/tmp set backupdir=$XDG_CACHE_HOME/vim/backup,~/,/tmp set undodir=$XDG_CACHE_HOME/vim/undo,~/,/tmp -set viminfo+=n$XDG_CACHE_HOME/vim/viminfo -set runtimepath+=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME +set viminfo='1000,n$XDG_CACHE_HOME/vim/viminfo +set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after "}}} " load plugins {{{ @@ -27,28 +48,6 @@ runtime plugins/vim-tabline/vim-tabline.vim runtime plugins/vim-dfm/vim-dfm.vim " }}} -" generic settings {{{ -syntax enable " enable syntax highlighting -let mapleader = "\<Space>" " lead with space -set nocompatible " use more features -set path+=** " search down into subfolders -set wildmenu " display all matches when tab complete -set t_Co=256 " use 256 colors -set number " line numbers -set relativenumber " relative line numbers -set cursorline " colored cursor line -set colorcolumn=80 " color column at 80 characters -set textwidth=79 " set text width to 79 characters -set showcmd " show incomplete commands -set fileformat=unix " use <NL> only like a normal person -set backspace=indent,eol,start " backspace through everything in insert mode -set list lcs=tab:»·,trail:· " highligt tabs and trailing spaces -set formatoptions+=tcrowanl " word and comment wrapping -set encoding=utf-8 " use utf-8 encoding -set title " use 'titlestring' as window title -set viminfo+=n~/.data/viminfo " change location of .viminfo -" }}} - " colors {{{ hi Cursor ctermbg=none ctermfg=none cterm=reverse hi CursorLine ctermbg=5 ctermfg=none cterm=none @@ -71,7 +70,7 @@ hi SpellBad ctermbg=1 ctermfg=15 cterm=italic hi SpellCap ctermbg=14 ctermfg=15 cterm=italic hi SpellLocal ctermbg=11 ctermfg=15 cterm=italic hi SpellRare ctermbg=10 ctermfg=5 cterm=italic -hi SpecialKey ctermbg=5 ctermfg=15 cterm=italic +hi SpecialKey ctermbg=0 ctermfg=2 cterm=italic hi Search ctermbg=5 ctermfg=6 cterm=bold hi Pmenu ctermbg=5 ctermfg=6 cterm=none hi PmenuSel ctermbg=6 ctermfg=5 cterm=none @@ -137,7 +136,7 @@ map <leader>c :w! \| silent !compile <c-r>%<CR><Esc>:redraw!<CR> set tabstop=4 " tab equals 4 spaces set softtabstop=4 " soft tab equals 4 spaces set shiftwidth=4 " use 4 spaces for indentations -set expandtab " use spaces instead of tabs +"set expandtab " use spaces instead of tabs set autoindent " copy indent from current line to next set shiftround " round indent of multiple of 'shiftwidth' " }}} @@ -187,11 +186,6 @@ nnoremap <silent> <leader>p \ :call setreg(@",system("xclip -o -selection clipboard"))<cr>p " }}} -" backup and swap files {{{ -set backupdir=~/.data/vimtmp,. -set dir=~/.data/vimtmp//,. -" }}} - " filetype specific settings {{{ filetype detect if (&ft == 'c' || &ft == 'cpp') diff --git a/x/.config/X11/xinitrc b/x/.config/X11/xinitrc @@ -0,0 +1,65 @@ +#!/bin/sh + +# only support for dwm implemented +[ "$1" != "dwm" ] && exit + +userresources="$XDG_CONFIG_HOME"/X11/xresources +usermodmap="$XDG_CONFIG_HOME"/X11/xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps +[ -f "$sysresources" ] && xrdb -merge "$sysresources" +[ -f "$sysmodmap" ] && xmodmap "$sysmodmap" +[ -f "$userresources" ] && xrdb -merge "$userresources" +[ -f "$usermodmap" ] && xmodmap "$usermodmap" + +# Disable terminal console beep +xset b off + +# Remap caps lock to escape and use US international keyboard +setxkbmap \ + -layout us \ + -variant altgr-intl \ + -option caps:escape + +# Enable and set alsa options +amixer sset "Capture" "70%" +amixer sset "Digital" "60%" +amixer sset "Dock Mic Boost" "50%" +amixer sset "Internal Mic Boost" "50%" + +# Disable screen saving +xset s off -dpms + +# Start unclutter (hide cursor after 5 seconds of idle time) +unclutter -idle 5 & + +# dwm specific executions (yeah, kinda redundant but future proof) +case "$1" in +dwm) + # setup monitor + "$HOME"/.local/bin/monitor setup + + # set wallpaper + [ -f "$XDG_CONFIG_HOME/wallpaper.ff.gz" ] \ + && cp "$XDG_CONFIG_HOME/wallpaper.ff.gz" /tmp/wallpaper.ff.gz \ + && swall /tmp/wallpaper.ff.gz + + # start daemons + [ ! $(pidof -x monitor-daemon) ] && "$HOME"/.local/bin/monitor daemon & + [ ! $(pidof -x mpvd) ] && /usr/local/bin/mpvd & + + # start prerequisites + [ ! $(pidof -x listen-new-mail) ] && "$HOME/.local/bin/listen-new-mail" & + [ ! $(pidof -x listen-new-pkg) ] && "$HOME/.local/bin/listen-new-pkg" & + [ ! $(pidof -x listen-ac-change) ] && "$HOME/.local/bin/listen-ac-change" & + [ ! $(pidof -x ztatus) ] && sh -c 'sleep .5; /usr/local/bin/ztatus -d' & + + # start sxhkd (Simple X hotkey daemon) + sxhkd & + + # ...and finally, start dwm + "$HOME"/.local/bin/dwm-run + ;; +esac diff --git a/x/.config/X11/xresources b/x/.config/X11/xresources @@ -0,0 +1 @@ +Sxiv.background : #000000 diff --git a/x/.xinitrc b/x/.xinitrc @@ -1,65 +0,0 @@ -#!/bin/sh - -# only support for dwm implemented -[ "$1" != "dwm" ] && exit - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap - -# merge in defaults and keymaps -[ -f "$sysresources" ] && xrdb -merge "$sysresources" -[ -f "$sysmodmap" ] && xmodmap "$sysmodmap" -[ -f "$userresources" ] && xrdb -merge "$userresources" -[ -f "$usermodmap" ] && xmodmap "$usermodmap" - -# Disable terminal console beep -xset b off - -# Remap caps lock to escape and use US international keyboard -setxkbmap \ - -layout us \ - -variant altgr-intl \ - -option caps:escape - -# Enable and set alsa options -amixer sset "Capture" "70%" -amixer sset "Digital" "60%" -amixer sset "Dock Mic Boost" "50%" -amixer sset "Internal Mic Boost" "50%" - -# Disable screen saving -xset s off -dpms - -# Start unclutter (hide cursor after 5 seconds of idle time) -unclutter -idle 5 & - -# dwm specific executions (yeah, kinda redundant but future proof) -case "$1" in -dwm) - # setup monitor - "$HOME"/.bin/monitor setup - - # set wallpaper - [ -f "$HOME"/.wallpaper.ff.gz ] \ - && cp "$HOME"/.wallpaper.ff.gz /tmp/wallpaper.ff.gz \ - && swall /tmp/wallpaper.ff.gz - - # start daemons - [ ! $(pidof -x monitor-daemon) ] && "$HOME"/.bin/monitor daemon & - [ ! $(pidof -x mpvd) ] && /usr/local/bin/mpvd & - - # start prerequisites - [ ! $(pidof -x listen-new-mail) ] && "$HOME/.bin/listen-new-mail" & - [ ! $(pidof -x listen-new-pkg) ] && "$HOME/.bin/listen-new-pkg" & - [ ! $(pidof -x listen-ac-change) ] && "$HOME/.bin/listen-ac-change" & - [ ! $(pidof -x ztatus) ] && sh -c 'sleep .5; /usr/local/bin/ztatus -d' & - - # start sxhkd (Simple X hotkey daemon) - sxhkd & - - # ...and finally, start dwm - "$HOME"/.bin/dwm-run - ;; -esac