dots

git clone git://mattcarlson.org/repos/dots.git
Log | Files | Refs

commit eb7d81f6e786e6182bf911d629a997efc989930f
parent b17135ff0cdc8db4b1b77cdccbcbd7b5cf033689
Author: Matthew Carlson <matt@mcarlson.xyz>
Date:   Sun, 25 Jul 2021 01:25:20 -0400

wallpaper script is mostly done now

Diffstat:
M.config/mksh/mkshrc | 2+-
M.config/mutt/muttrc | 37++++++++++++++++---------------------
M.config/sh/profile | 59+++++++++++++++++++++++++++++++++++++++++++++--------------
M.config/x/xresources | 54+++++++++++++++++++++++++++---------------------------
A.config/zathura/zathurarc | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.local/bin/wp.sh | 68+++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
M.local/share/wp | 4++--
7 files changed, 222 insertions(+), 78 deletions(-)

diff --git a/.config/mksh/mkshrc b/.config/mksh/mkshrc @@ -28,7 +28,7 @@ NORMAL="$(tput sgr0)" # prompt # bashism required b/c mksh doesn't support param expansion for PS1 -PS1='${BOLD}${COL4}${PWD} $ ${NORMAL}${COL7}' +PS1='${BOLD}${COL2}${PWD} $ ${NORMAL}${COL7}' export PS1 # gpg tty diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc @@ -35,30 +35,25 @@ bind index,pager \Ck sidebar-prev bind index,pager \Co sidebar-open # color -color attachment bold color6 default -color body bold color14 default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" -color body bold color14 default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" +color attachment bold color2 default +color body bold color2 default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" +color body bold color2 default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" color error bold color1 default -color hdrdefault bold color4 default -color index_date color4 default -color index_number color4 default -color index_size color4 default -color indicator bold default color4 -color markers color4 default -color normal color6 default -color quoted color4 default -color quoted1 color37 default -color quoted2 color38 default -color quoted3 color39 default -color quoted4 color43 default -color quoted5 color44 default -color quoted6 color45 default -color quoted7 color49 default -color quoted8 color50 default -color quoted9 color51 default +color hdrdefault bold color2 default +color index_date color2 default +color index_number color2 default +color index_size color2 default +color indicator bold default color2 +color markers color2 default +color normal color7 default +color quoted color2 default +color quoted1 color3 default +color quoted2 color4 default +color quoted3 color5 default +color quoted4 color6 default color sidebar_divider color0 default color sidebar_highlight bold color3 default -color status bold default color4 +color status bold default color2 color tilde color0 default # sidebar diff --git a/.config/sh/profile b/.config/sh/profile @@ -47,27 +47,39 @@ export VIDEOS_DIR="${HOME}/vids/" export GNUPG="9CC4E75365C16465FFE752C94DDBF97211D4EA31" # colorful man pages -LESS_TERMCAP_mb="$(printf '\e[01;31m')" +LESS_TERMCAP_mb=$(tput bold; tput setaf 2) export LESS_TERMCAP_mb -LESS_TERMCAP_md="$(printf '\e[01;38;5;74m')" +LESS_TERMCAP_md=$(tput bold; tput setaf 2) export LESS_TERMCAP_md -LESS_TERMCAP_me="$(printf '\e[0m')" +LESS_TERMCAP_me=$(tput sgr0) export LESS_TERMCAP_me -LESS_TERMCAP_se="$(printf '\e[0m')" -export LESS_TERMCAP_se -LESS_TERMCAP_so="$(printf '\e[38;5;246m')" +LESS_TERMCAP_so=$(tput bold; tput setaf 7; tput setab 2) export LESS_TERMCAP_so -LESS_TERMCAP_ue="$(printf '\e[0m')" -export LESS_TERMCAP_ue -LESS_TERMCAP_us="$(printf '\e[04;38;5;146m')" +LESS_TERMCAP_se=$(tput rmso; tput sgr0) +export LESS_TERMCAP_se +LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 2) export LESS_TERMCAP_us +LESS_TERMCAP_ue=$(tput rmul; tput sgr0) +export LESS_TERMCAP_ue +LESS_TERMCAP_mr=$(tput rev) +export LESS_TERMCAP_mr +LESS_TERMCAP_mh=$(tput dim) +export LESS_TERMCAP_mh +LESS_TERMCAP_ZN=$(tput ssubm) +export LESS_TERMCAP_ZN +LESS_TERMCAP_ZV=$(tput rsubm) +export LESS_TERMCAP_ZV +LESS_TERMCAP_ZO=$(tput ssupm) +export LESS_TERMCAP_ZO +LESS_TERMCAP_ZW=$(tput rsupm) +export LESS_TERMCAP_ZW # file explorer -export FFF_COL1=4 -export FFF_COL2=4 +export FFF_COL1=2 +export FFF_COL2=2 export FFF_COL3=1 -export FFF_COL4=4 -export FFF_COL5=6 +export FFF_COL4=2 +export FFF_COL5=7 export FFF_HIDDEN=1 export FFF_LS_COLORS=1 export FFF_OPENER="xdg-open" @@ -84,7 +96,26 @@ export PASH_TIMEOUT=60 # pfetch export HOSTNAME='pc' export PF_INFO='ascii title os host kernel uptime pkgs memory shell editor wm palette' -export PF_COL1=4 +export PF_COL1=2 + +# fzf +export FZF_DEFAULT_OPTS=' + --color fg:7 + --color preview-fg:2 + --color preview-bg:2 + --color hl:2 + --color fg+:7 + --color bg+:2 + --color gutter:2 + --color hl+:7 + --color info:2 + --color border:2 + --color prompt:2 + --color pointer:2 + --color marker:2 + --color spinner:2 + --color header:2 +' # clean up export LESSHISTFILE=- diff --git a/.config/x/xresources b/.config/x/xresources @@ -1,29 +1,29 @@ ! colors -#define col0 #0f1317 -#define col1 #d99433 -#define col2 #3b3c82 -#define col3 #35538f -#define col4 #465298 -#define col5 #49649e -#define col6 #aabed4 -#define col7 #768594 -#define col8 #d99433 -#define col9 #d3b555 -#define col10 #3b3c82 -#define col11 #35538f -#define col12 #465298 -#define col13 #49649e -#define col14 #aabed4 -#define col15 #f8f8f2 +#define col0 #160f0c +#define col1 #3844a1 +#define col2 #6b5f92 +#define col3 #506e83 +#define col4 #867497 +#define col5 #8b7dc3 +#define col6 #6e878d +#define col7 #c6c0cb +#define col8 #8a868e +#define col9 #3844a1 +#define col10 #6b5f92 +#define col11 #506e83 +#define col12 #867497 +#define col13 #8b7dc3 +#define col14 #6e878d +#define col15 #c6c0cb ! dwm dwm.font : monospace:size=16 dwm.normbgcolor : col0 dwm.normbordercolor : col0 -dwm.normfgcolor : col6 -dwm.selbgcolor : col4 -dwm.selbordercolor : col4 -dwm.selfgcolor : col15 +dwm.normfgcolor : col7 +dwm.selbgcolor : col2 +dwm.selbordercolor : col2 +dwm.selfgcolor : col7 dwm.borderpx : 3 dwm.snap : 32 dwm.topbar : 0 @@ -46,10 +46,10 @@ dwm.ulineall : 0 ! dmenu dmenu.font : monospace:size=16 -dmenu.normfgcolor : col6 +dmenu.normfgcolor : col7 dmenu.normbgcolor : col0 -dmenu.selfgcolor : col15 -dmenu.selbgcolor : col4 +dmenu.selfgcolor : col7 +dmenu.selbgcolor : col2 dmenu.prompt : dmenu.min_width : 500 dmenu.colorprompt : 1 @@ -57,8 +57,8 @@ dmenu.border_width : 3 ! herbe herbe.background_color : col0 -herbe.border_color : col4 -herbe.font_color : col6 +herbe.border_color : col2 +herbe.font_color : col7 herbe.font_pattern : monospace:size=16 herbe.line_spacing : 5 herbe.padding : 5 @@ -73,10 +73,10 @@ herbe.duration : 5 slock.init : col0 slock.input : col4 slock.failed : col1 -slock.caps : col9 +slock.caps : col2 slock.failonclear : 1 slock.message : Type password to unlock -slock.text_color : col6 +slock.text_color : col7 slock.font_name : monospace:size=16 ! st diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc @@ -0,0 +1,75 @@ +### Settings from original zathurarc ### +set selection-clipboard clipboard + +### zathura-pywal ### +# Allow recolor +set recolor "true" + +# Don't allow original hue when recoloring +set recolor-keephue "false" + +# Don't keep original image colors while recoloring +set recolor-reverse-video "false" + +# Command line completion entries +set completion-fg "#c6c0cb" +set completion-bg "#160f0c" + +# Command line completion group elements +set completion-group-fg "#6B5F92" +set completion-group-bg "#160f0c" + +# Current command line completion element +set completion-highlight-fg "#160f0c" +set completion-highlight-bg "#c6c0cb" + +# Default foreground/background color +set default-bg rgba(22,15,12,1) + +# Input bar +set inputbar-fg "#c6c0cb" +set inputbar-bg "#160f0c" + +# Notification +set notification-fg "#c6c0cb" +set notification-bg "#160f0c" + +# Error notification +set notification-error-fg "#c6c0cb" +set notification-error-bg "#3844A1" + +# Warning notification +set notification-warning-fg "#c6c0cb" +set notification-warning-bg "#3844A1" + +# Tab - TODO +# set tabbar-fg +# set tabbar-bg + +# Focused tab - TODO +# set tabbar-focus-fg +# set tabbar-focus-bg + +# Status bar +set statusbar-fg "#c6c0cb" +set statusbar-bg "#160f0c" + +# Highlighting parts of the document (e.g. show search results) +set highlight-color "#6B5F92" +set highlight-active-color "#6B5F92" + +# Represent light/dark colors in recoloring mode +set recolor-lightcolor rgba(0,0,0,0) +set recolor-darkcolor "#c6c0cb" + +# "Loading..." text +set render-loading-fg "#c6c0cb" +set render-loading-bg "#160f0c" + +# Index mode +set index-fg "#c6c0cb" +set index-bg "#160f0c" + +# Selected element in index mode +set index-active-fg "#160f0c" +set index-active-bg "#c6c0cb" +\ No newline at end of file diff --git a/.local/bin/wp.sh b/.local/bin/wp.sh @@ -2,35 +2,45 @@ # # wp +# wp is sym link WP="${XDG_DATA_HOME:-${HOME}/.local/share}/wp" +# 16 colors generated by pywal COLORS="${XDG_CACHE_HOME:-${HOME}/.cache}/wal/colors.sh" -DEFAULTBG=259 +# term fg +DEFAULTFG=259 +# xresources handles suckless vars XRESOURCES="${XDG_CONFIG_HOME:-${HOME}/.config}/x/xresources" +# get random valid file in dir get_rand_file() { - flag=1 - + # get all files in dir files="$(for file in "${1}"/*; do [ -d "${file}" ] && continue printf '%s\n' "${file}" done)" + # loop until valid file found file='' while ! check_file "${file}"; do + # get random file and remove it from list file="$(printf '%s' "${files}" | shuf -n 1)" files="$(printf '%s' "${files}" | grep -vw "${file}")" + + # exit if no more files to check [ -z "${files}" ] && break done + # no files in dir are valid if ! check_file "${file}"; then file=''; fi - [ -z "${file}" ] && flag=1 || flag=0 - return ${flag} + [ -z "${file}" ] && return 1 || break } check_file () { + # get file extension file="${1}" ext="${file##*.}" + case "${ext}" in # formats supported by imlib2 used by feh, sxiv, etc. bmp \ @@ -52,24 +62,32 @@ check_file () { | tif \ | tiff \ | webp \ - | xpm) return 0 ;; + | xpm) break ;; *) return 1 ;; esac } wp () { + # create wp sym link ln -sf "${file}" "${WP}" + + # change bg feh --no-fehbg --bg-scale "${WP}" + + # theme iff pywal installed command -v wal >/dev/null && theme } theme() { - wal -c && wal -i "${WP}" + # remove cached themes and gen new one + wal -c && wal -ni "${WP}" + [ -f "${COLORS}" ] && . "${COLORS}" - set -- ${color0} ${color1} ${color3} ${color4} ${color5} ${color6} ${color7} ${color8} \ - ${color9} ${color10} ${color11} ${color12} ${color13} ${color14} ${color15} + set -- ${color0} ${color1} ${color2} ${color3} ${color4} ${color5} ${color6} ${color7} \ + ${color8} ${color9} ${color10} ${color11} ${color12} ${color13} ${color14} ${color15} + # replace colors in xresources i=0 for color in "${@}"; do color="$(printf '%s' "${color}" | tr '[:upper:]' '[:lower:]')" @@ -78,17 +96,41 @@ theme() { [ ${i} -eq 16 ] && break done - xrdb -merge "${XRESOURCES}" + # reload xresources + xrdb "${XRESOURCES}" + # reload all instances of st kill -s USR1 $(pidof st) + # hacky work-around to change terminal fg on the fly + # buggy with alpha for tty in $(ls /dev/pts/ | egrep -i '[1-9][0-9]*'); do - printf "\033]4;${DEFAULTBG};${color0}\007" > "/dev/pts/${tty}" 2>/dev/null + printf "\033]4;${DEFAULTFG};${color0}\007" > "/dev/pts/${tty}" 2>/dev/null done + # reload dwm dwmc reload + + zathura-pywal } -{ [ -d "${1}" ] && get_rand_file "${1}" && flag=${?} ; } || { [ -f "${1}" ] && check_file "${1}" && flag=${?} ; } +main() { + # convert relative to abs if not already + case "${1}" in + /*) path="${1}" ;; + *) path="${PWD}/${1}" ;; + esac + + # if dir get rand file + if [ -d "${path}" ]; then + get_rand_file "${path}" + # if file check it + elif [ -f "${path}" ]; then + check_file "${path}" + fi + + # change wp if file exists and is ok + { [ ${?} -eq 0 ] && [ -n "${file}" ] && wp "${file}" ; } || return 1 +} -[ ${flag} = "0" ] && [ -n "${file}" ] && wp "${file}" +main "${@}" diff --git a/.local/share/wp b/.local/share/wp @@ -1 +1 @@ -/home/mc/pix/wp/retro-city.jpg -\ No newline at end of file +/home/mc/pix/wp/olympus.jpg +\ No newline at end of file