From 9676f43ffad81ac477ae3989e6b2b1e129f85d98 Mon Sep 17 00:00:00 2001 From: katherine Date: Tue, 7 Mar 2017 13:41:52 -0700 Subject: preliminary support for light backgrounds haven't managed to make one that felt ok yet, but still nice to have the option --- .config/herbstluftwm/autostart | 6 ++-- .config/herbstluftwm/calc.sh | 15 +++++----- .config/herbstluftwm/panel.sh | 4 +-- .config/herbstluftwm/switcher.sh | 2 +- .config/init/funcs/make-gif | 8 ++--- .config/init/gen/urxvt-theme.sh | 2 ++ .config/init/vars | 63 ++++++++++++++++++++++++++++++++++++++-- .config/ranger/rc.conf | 2 +- .vimrc | 2 ++ .zshrc | 25 ++++++++++++++++ 10 files changed, 107 insertions(+), 22 deletions(-) diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index a2ad57d..458a2b3 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -163,7 +163,7 @@ hc keybind Mod4-Shift-w spawn urxvt -name "weechat" -e weechat # dmenu hc keybind Mod4-0 spawn dmenu_run -fn "${bfont}:size=${bfont_size}" \ -p "Run:" -h "$bheight" \ - -nb "$bg_normal" -nf "$fg_normal" \ + -nb "$bar_bg" -nf "$bar_fg" \ -sb "$bg_focus" -sf "$fg_focus" hc keybind Mod4-9 spawn ~/.config/herbstluftwm/switcher.sh hc keybind Mod4-8 spawn ~/.config/herbstluftwm/calc.sh @@ -211,8 +211,8 @@ done # run dunst with theme colours pkill dunst -dunst -lb $bg_normal -nb $bg_normal -cb $bg_focus \ - -lf $fg_normal -nf $fg_normal -cf $fg_focus \ +dunst -lb $bar_bg -nb $bar_bg -cb $bg_focus \ + -lf $bar_fg -nf $bar_fg -cf $fg_focus \ -frame_color $bg_focus -geom "0x3-4+$(($bheight + 4))" \ -fn "$mfont $mfont_size,$jfont $jfont_size,$cfont $cfont_size,$efont $efont_size,$bkfont $bkfont_size" \ -max_icon_size 0 diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh index e10cfa6..7a1b9b9 100755 --- a/.config/herbstluftwm/calc.sh +++ b/.config/herbstluftwm/calc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/zsh source ~/.config/init/vars @@ -26,10 +26,10 @@ command_check() { esac } -while [ "$in" != "" ]; do +while [[ "$in" != "" ]]; do in=$(dmenu -noinput -fn "${bfont}:size=${bfont_size}" -q -h "$bheight" \ - -nb "$bg_normal" -nf "$fg_normal" \ - -sb "$bg_focus" -sf "$fg_focus" -p "$prompt" | \ + -nb "$bar_bg" -nf "$fg_normal" \ + -sb "$bar_fg" -sf "$fg_focus" -p "$prompt" | \ sed -e "s/ans/$acc/g") if [[ $(command_check "$in" "$acc") -eq 1 ]]; then break @@ -37,11 +37,11 @@ while [ "$in" != "" ]; do out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1) - if [ "${?#0}" != "" ]; then + if [[ "${?#0}" != "" ]]; then out=$(echo "$out" | tr -d "\n") - if [ "$out" = "Missing operator" ]; then + if [[ "$out" = "Missing operator" ]]; then out=$(echo "pi=$pi; e=$e; $in" | calc -p 2>&1) - if [ "${?#0}" != "" ]; then + if [[ "${?#0}" != "" ]]; then out=$(echo "$out" | tr -d "\n") prompt="calc: ($acc) err: $out" else @@ -57,4 +57,3 @@ while [ "$in" != "" ]; do prompt="calc: ($acc)" fi done - diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh index d5d5301..eb48a35 100755 --- a/.config/herbstluftwm/panel.sh +++ b/.config/herbstluftwm/panel.sh @@ -39,8 +39,8 @@ light_magenta=$(echo -n '#ff'; echo "$light_magenta" | tr -d '#') light_cyan=$(echo -n '#ff'; echo "$light_cyan" | tr -d '#') light_white=$(echo -n '#ff'; echo "$light_white" | tr -d '#') -bg_normal=$(echo -n $alpha; echo "$bg_normal" | tr -d '#') -fg_normal=$(echo -n '#ff'; echo "$fg_normal" | tr -d '#') +bg_normal=$(echo -n $alpha; echo "$bar_bg" | tr -d '#') +fg_normal=$(echo -n '#ff'; echo "$bar_fg" | tr -d '#') bg_focus=$(echo -n $alpha; echo "$bg_focus" | tr -d '#') fg_focus=$(echo -n '#ff'; echo "$fg_focus" | tr -d '#') bg_urgent=$(echo -n $alpha; echo "$bg_urgent" | tr -d '#') diff --git a/.config/herbstluftwm/switcher.sh b/.config/herbstluftwm/switcher.sh index 5430a80..e076eb3 100755 --- a/.config/herbstluftwm/switcher.sh +++ b/.config/herbstluftwm/switcher.sh @@ -15,7 +15,7 @@ while read -rA line; do done < <(wmctrl -l) echo -e "$lines" | nl -w 2 -s ") " | dmenu -fn "${bfont}:size=${bfont_size}" -i -h "$bheight" \ - -nb "$bg_normal" -nf "$fg_normal" -sb "$bg_focus" -sf "$fg_focus" \ + -nb "$bar_bg" -nf "$bar_fg" -sb "$bg_focus" -sf "$fg_focus" \ -p "Select:" -l 40 | cut -d ')' -f 1 | {read choice} herbstclient jumpto "${nums[$choice]}" diff --git a/.config/init/funcs/make-gif b/.config/init/funcs/make-gif index e100650..1864e63 100755 --- a/.config/init/funcs/make-gif +++ b/.config/init/funcs/make-gif @@ -38,7 +38,7 @@ local t="" # really annoying, but no other good way to do this if [[ $hasgsic ]]; then - while getopts s:t:f:w:bhn:g opt; do + while getopts :s:t:f:w:bhn:g opt; do case "$opt" in s) [[ ! $(echo $OPTARG | grep -oE "$timepat") ]] \ @@ -69,11 +69,11 @@ if [[ $hasgsic ]]; then ;; g) gsic=true ;; h) usage ;; - [?]) usage ;; + [?]) usage "unrecognised option" ;; esac done else - while getopts s:t:f:w:bhn: opt; do + while getopts :s:t:f:w:bhn: opt; do case "$opt" in s) [[ ! $(echo $OPTARG | grep -oE "$timepat") ]] \ @@ -103,7 +103,7 @@ else strack=$OPTARG ;; h) usage ;; - [?]) usage ;; + [?]) usage "unrecognised option" ;; esac done fi diff --git a/.config/init/gen/urxvt-theme.sh b/.config/init/gen/urxvt-theme.sh index 97f7951..ec31644 100644 --- a/.config/init/gen/urxvt-theme.sh +++ b/.config/init/gen/urxvt-theme.sh @@ -48,5 +48,7 @@ echo -n "xft:${cfont}:size=${cfont_size}, " echo -n "xft:${efont}:size=${efont_size}, " echo "xft:${bkfont}:size=${bkfont_size}" +[[ -n $urxvt_bg ]] && echo "URxvt*backgroundPixmap: $HOME/backdrops/urxvt/$urxvt_bg" + } > /tmp/urxvt-theme diff --git a/.config/init/vars b/.config/init/vars index 23b2153..b49454d 100644 --- a/.config/init/vars +++ b/.config/init/vars @@ -34,6 +34,8 @@ # bg_urgent="$std_red" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" # # Undercover @@ -66,6 +68,8 @@ # bg_urgent="$std_red" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" # # Fly @@ -98,6 +102,9 @@ # bg_urgent="$std_red" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" + # # Smooch # @@ -129,6 +136,9 @@ # bg_urgent="$light_red" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" + # # Hello, Friend # @@ -160,6 +170,9 @@ # bg_urgent="$light_black" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" + # # No Matter Where # @@ -191,6 +204,9 @@ # bg_urgent="$std_red" # fg_urgent="$light_white" +# bar_bg="$bg_normal" +# bar_fg="$fg_normal" + # # 花嫁 # @@ -222,6 +238,47 @@ fg_focus="$light_white" bg_urgent="$std_red" fg_urgent="$light_white" +bar_bg="$bg_normal" +bar_fg="$fg_normal" + +# +# わがまま +# + +# wallpaper='わがまま.png' +# +# std_black='#331a24' +# std_red='#692c2d' +# std_green='#326e45' +# std_yellow='#995d37' +# std_blue='#444c80' +# std_magenta='#9f3e81' +# std_cyan='#2b586b' +# std_white='#eae4d7' +# +# light_black='#4d2836' +# light_red='#8f5253' +# light_green='#4e9464' +# light_yellow='#d69973' +# light_blue='#5d67a6' +# light_magenta='#c983b4' +# light_cyan='#38687d' +# light_white='#eae4d7' +# +# bg_normal="$std_white" +# fg_normal="$std_black" +# bg_focus="$std_red" +# fg_focus="$light_white" +# bg_urgent="$std_blue" +# fg_urgent="$light_white" +# +# bar_bg="$std_black" +# bar_fg="$std_white" +# +# light_colours=true +# +# urxvt_bg='わがまま.png;style=tiled' + ############### # misc vars # @@ -267,9 +324,9 @@ dmenu_args=( -fn "${bfont}:size=${bfont_size}" -h "$bheight" -sf "$fg_focus" ) -############### -# functions # -############### +########################## +# convenience function # +########################## hc() { herbstclient "$@" } diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 9101f1e..044be96 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -180,7 +180,7 @@ set sort natural set sort_reverse false set sort_case_insensitive true set sort_directories_first true -set sort_unicode true +set sort_unicode false # Enable this if key combinations with the Alt Key don't work for you. # (Especially on xterm) diff --git a/.vimrc b/.vimrc index 68108f1..02cad08 100644 --- a/.vimrc +++ b/.vimrc @@ -268,7 +268,9 @@ function! Settings_c() setlocal tabstop=4 setlocal softtabstop=4 "mappings + "note: these mappings are in weird reverse order to avoid opening folds nnoremap -- O*/hhi/* + inoremap { }i{O endfunction function! Settings_coffee() diff --git a/.zshrc b/.zshrc index 41a9c2a..2a0964c 100644 --- a/.zshrc +++ b/.zshrc @@ -20,6 +20,15 @@ bindkey -e setopt notify unsetopt beep +if [[ "$TERM" == "rxvt-unicode-256color" ]]; then + if [[ -f "$HOME/.config/init/vars" ]]; then + source "$HOME/.config/init/vars" + else + [[ -f "/home/shmibs/.config/init/vars" ]] && + source "/home/shmibs/.config/init/vars" + fi +fi + ##################### MISC #################### # dynamic title @@ -36,6 +45,21 @@ if [[ "$TERM" == "rxvt-unicode-256color" ]]; then fi #################### PROMPT ################### +if [[ -n $light_colours ]]; then +PROMPT="%{$fg[black]%}┌[" +# if non-zero, previous return val +PROMPT+="%(0?..$fg[red]%?$fg[black]:)" +# if any, number of jobs +PROMPT+="%(1j.$fg[green]%j$fg[black]:.)" +# name and host (red for root) +PROMPT+="%{%(!.$fg[red].$fg[magenta])%}%n@%M%E " +# current location, with one level of parent context +PROMPT+="%{$fg[blue]%}%2c" +# newline +PROMPT+="%{$fg[black]%}]%{%b$reset_color%} +" +PROMPT+="%{$fg[black]%}└: %{%b$reset_color%}" +else PROMPT="%{%B$fg[white]%}┌[" # if non-zero, previous return val PROMPT+="%(0?..$fg[red]%?$fg[white]:)" @@ -49,6 +73,7 @@ PROMPT+="%{$fg[blue]%}%2c" PROMPT+="%{$fg[white]%}]%{%b$reset_color%} " PROMPT+="%{%B$fg[white]%}└: %{%b$reset_color%}" +fi ################# HIGHLIGHTING ################ -- cgit v1.2.3