djcev.com

//

Git Repos / dotfiles / commit f04c623

Commit: f04c62321c03c978b159c6e024834b9406ceb97d
Parent: b70afd7cd6c25ff65ebd8190832cbf26d6208f27
Author: Cameron Vanderzanden, 2021-12-13 10:18
Committer: Cameron Vanderzanden, 2021-12-13 10:18

Commit Message

Expanded redshift background.sh, misc. changes

Fleshed out the config/redshift/hooks/background.sh script. Implemented
a couple of options to bring it in line with my other scripts,
de-hardcoded some of its paths, and implemented a top-level set
selection (labeled as "game" in the script).

Miscellaneous other changes including the addition of a README.

Change List

Diff .gitignore

diff --git a/.gitignore b/.gitignore
index 26e298d..1a195b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+*.swp
+*__pycache__*
tmux.conf
config/herbstluftwm/autostart
config/qterminal.org/color-schemes/autogen.colorscheme

Return to the top of this page or return to the overview of this repo.

Diff README.md

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..46d7f2e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,69 @@
+## Dotfiles
+
+My local scripts & configuration files. Installation and management
+is done through the makefile FreeBSD.mk. Files that end with the
+(unfortunately ambiguous) ".fix" suffix contain strings like "xDK0h"
+that are defined in colordef\*.sh and are replaced/processed using
+sed by way of fixcolor.sh.
+
+My Quake 3 config is also included here, though there's probably
+something wrong with it.
+
+All files (unless explicitly stated otherwise) are made available under
+the 2-clause simplified BSD license; see LICENSE for the full text.
+
+### Environment & Software Choices
+
+My system is, generally speaking, a modern amd64 PC running X windows
+on FreeBSD. 1080p (1920x1080) resolution, true color support (even in
+the terminal), et cetera. A pretty normal set of hardware in 2021 but
+worth calling out. These config files are written for that setup.
+
+I use the X windows programs alacritty, conky, dunst, herbstluftwm,
+jgmenu, mpv, picom, redshift, and tint2. Terminal emulator, system monitor,
+notification daemon, window manager, menu, video player, compositor,
+automated color temperature changer, and panel/taskbar respectively.
+
+On the console I use cmus, irssi, mutt, newsboat, and vim. Music player,
+IRC client, mail user agent, RSS reader, and editor respectively.
+
+Nothing too unusual in those lists.
+
+### Shell Scripts
+
+Most of the shell scripts in this repository are generalized frontends
+to various utilities, some with a bit of extra logic in them.
+
+bin/aliases.sh are my shell aliases, nothing fancy. bin/run_tv.sh and
+bin/youtube.sh are very basic, not much more than aliases.
+
+bin/back.sh is an X windows background (root image) setter, a frontend for
+hsetroot (https://github.com/himdel/hsetroot) capable of selecting random
+images from a list or directory.
+
+bin/words.sh is a little tool that randomly selects n words from a file,
+default 3 words from /usr/share/bin/words.
+
+bin/xvt.sh runs a new terminal emulator in the current working directory
+of the shell running in the currently selected window. It's a bit weird,
+doesn't always work.
+
+bin/lc.sh is an ls-like that lists files in a directory and colorizes
+the output based on filetype, filesize, and other criteria determined in
+a great big case statement. Only tested on FreeBSD. Please don't alias or
+otherwise call it as ls, it's a very bad idea.
+
+config/redshift/hooks/background.sh is an automated background selector &
+setter launched by redshift (http://jonls.dk/redshift/) when the redshift
+period (day, transition, night) changes. I use sets of background art from
+visual novels that depict scenes at different times of day. The conky
+config at config/conky/conky.conf also hooks into this to draw a character
+image with appropriate (day, transition, night) tinting and an expression
+based on system load average.
+
+### Missing Dependencies
+
+Some of these config files, notably config/cmus/rc, require or reference
+scripts I've written that aren't in this repository. I intend to publish
+those missing scripts soon either in their own repo or in this one.
+

Return to the top of this page or return to the overview of this repo.

Diff bin/back.sh

diff --git a/bin/back.sh b/bin/back.sh
index b2a4f82..a1f20a4 100755
--- a/bin/back.sh
+++ b/bin/back.sh
@@ -5,7 +5,7 @@
# the root dir of this repository for more information.
#
#- back.sh 2015/01/13 cev, last updated 2021/12/07
-## Usage: back.sh [-acfhtV] [-d directory] [-m method] wallpaper...
+## Usage: back.sh [-acfhtvV] [-d directory] [-m method] wallpaper...
##
## Set wallpaper (xorg 'root window' image). If no wallpaper is specified,
## select one at random from [-d directory]. If more than one file is
@@ -21,13 +21,14 @@
## -h Show help.
## -m Background setter method. Valid methods: hsetroot, pcmanfm.
## -t Set tiled wallpaper.
+## -v Be verbose.
## -V Print version info.
##
# Useful notes:
# http://www.linuxforums.org/forum/programming-scripting/ \
# 121380-random-file-folder-sub-folders.html

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
action='aspect'
@@ -105,7 +106,11 @@ setbg() {
*) die_invalid_method "$method" ;;
esac

- $setter $(eval echo \$${action}) "$@" # >/dev/null 2>&1
+ if [ "$verbose" ]; then
+ $setter $(eval echo \$${action}) "$@"
+ else
+ $setter $(eval echo \$${action}) "$@" 1>/dev/null 2>&1
+ fi
}

[ -z "$DISPLAY" ] && die_no_x
@@ -119,6 +124,7 @@ while getopts "acd:fhm:tV?" option; do
h) print_help && exit ;;
m) method="$OPTARG" ;;
t) action='tile' ;;
+ v) verbose='true' ;;
V) print_version && exit ;;
"?") print_help && exit ;;
esac

Return to the top of this page or return to the overview of this repo.

Diff bin/cev_print.sh

diff --git a/bin/cev_print.sh b/bin/cev_print.sh
new file mode 100755
index 0000000..9b82627
--- /dev/null
+++ b/bin/cev_print.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# Copyright (c) 2017-2021, Cameron Vanderzanden. Available under the
+# terms of the 2-clause BSD license. Please see the file "LICENSE" in
+# the root dir of this repository for more information.
+#
+#- cev_print.sh 2017/01/17 cev, last updated 2021/12/07. (was lib_print.sh)
+#
+# functions for pretty printing.
+
+print_help() { grep "^## " "$0" | cut -c 4-; }
+print_version() { grep "^#- " "$0" | cut -c 4-; }
+
+print_filenotfound() {
+ [ -z "$self" ] && self="$0"
+ printf "%b%s:%b " "$_self" "$self" "$_clear" >&2
+ printf "%bfile %b%s " "$_norm" "$_error" "$*" >&2
+ printf "%bnot found!%b\n" "$_norm" "$_clear" >&2
+}
+
+print_directorynotfound() {
+ print_self error
+ printf "%bdirectory %b%s " "$_norm" "$_error" "$*" >&2
+ printf "%bnot found!%b\n" "$_norm" "$_clear" >&2
+}
+
+print_noexe() {
+ print_self error
+ printf "%b%s%b is not executable!%b\n" "$_error" "$*" "$_norm" "$_clear" >&2
+}
+
+print_nofile() {
+ print_self error
+ printf "%bno file specified.%b\n" "$_norm" "$_clear" >&2
+}
+
+print_self() {
+ [ -z "$self" ] && self="$0"
+ if [ -z "$1" ]; then
+ printf "%b%s:%b " "$_self" "$self" "$_clear"
+ else
+ printf "%b%s:%b " "$_self" "$self" "$_clear" >&2
+ fi
+
+}
+
+print_unknownfiletype() {
+ print_self error
+ printf "%b%s%b is an unknown filetype!%b\n" \
+ "$_high" "$*" "$_norm" "$_clear" >&2
+}
+
+set_colors_true() {
+ _clear="\033[0m"
+ _self="\033[00;38;2;146;131;116m"
+ _error="\033[00;31m"
+ _error_high="\033[00;1;31m"
+ _norm="\033[00;38;2;213;196;161m"
+ _high="\033[00;37m"
+}
+
+set_colors_256() {
+ _clear="\033[0m"
+ _self="\033[00;38;5;245m"
+ _error="\033[00;31m"
+ _error_high="\033[00;1;31m"
+ _norm="\033[00;38;5;250m"
+ _high="\033[00;37m"
+}
+
+set_colors_16() {
+ _clear="\033[0m"
+ _self="\033[00;34m"
+ _error="\033[00;31m"
+ _error_high="\033[00;1;31m"
+ _norm="\033[00;37m"
+ _high="\033[00;1;37m"
+}
+
+set_colors_2() {
+ _clear=""
+ _self=""
+ _error=""
+ _error_high=""
+ _norm=""
+ _high=""
+}
+
+case $TERM in
+ rxvt-unicode-256color) set_colors_256 ;;
+ rxvt-256color) set_colors_256 ;;
+ rxvt-unicode) set_colors_16 ;;
+ rxvt-mono) set_colors_2 ;;
+ rxvt*) set_colors_2 ;;
+ xterm-256color) set_colors_true ;;
+ xterm-color) set_colors_16 ;;
+ xterm*) set_colors_2 ;;
+ screen-256color) set_colors_256 ;;
+ screen*) set_colors_2 ;;
+ *) set_colors_2 ;;
+esac

Return to the top of this page or return to the overview of this repo.

Diff bin/hc_notify.sh

diff --git a/bin/hc_notify.sh b/bin/hc_notify.sh
index 03b12ae..c0dc6e6 100755
--- a/bin/hc_notify.sh
+++ b/bin/hc_notify.sh
@@ -22,7 +22,7 @@
#
# This could use some updating.

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
timeout=1000

Return to the top of this page or return to the overview of this repo.

Diff bin/hc_swap.sh

diff --git a/bin/hc_swap.sh b/bin/hc_swap.sh
index fd04af5..590d41f 100755
--- a/bin/hc_swap.sh
+++ b/bin/hc_swap.sh
@@ -16,7 +16,7 @@
# Script logic is fundamentally unchanged from everett1992's version.
# All I've done is throw a bunch of junk in.

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
dir=""

Return to the top of this page or return to the overview of this repo.

Diff bin/lc.sh

diff --git a/bin/lc.sh b/bin/lc.sh
index 352b1c8..5e3b045 100755
--- a/bin/lc.sh
+++ b/bin/lc.sh
@@ -22,7 +22,7 @@
##
#

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"

Return to the top of this page or return to the overview of this repo.

Diff bin/lib_print.sh

diff --git a/bin/lib_print.sh b/bin/lib_print.sh
deleted file mode 100755
index ef52eed..0000000
--- a/bin/lib_print.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2017-2021, Cameron Vanderzanden. Available under the
-# terms of the 2-clause BSD license. Please see the file "LICENSE" in
-# the root dir of this repository for more information.
-#
-#- lib_print.sh 2017/01/17 cev, last updated 2021/12/07.
-#
-# functions for pretty printing.
-
-print_help() { grep "^## " "$0" | cut -c 4-; }
-print_version() { grep "^#- " "$0" | cut -c 4-; }
-
-print_filenotfound() {
- [ -z "$self" ] && self="$0"
- printf "%b%s:%b " "$_self" "$self" "$_clear" >&2
- printf "%bfile %b%s " "$_norm" "$_error" "$*" >&2
- printf "%bnot found!%b\n" "$_norm" "$_clear" >&2
-}
-
-print_directorynotfound() {
- print_self error
- printf "%bdirectory %b%s " "$_norm" "$_error" "$*" >&2
- printf "%bnot found!%b\n" "$_norm" "$_clear" >&2
-}
-
-print_noexe() {
- print_self error
- printf "%b%s%b is not executable!%b\n" "$_error" "$*" "$_norm" "$_clear" >&2
-}
-
-print_nofile() {
- print_self error
- printf "%bno file specified.%b\n" "$_norm" "$_clear" >&2
-}
-
-print_self() {
- [ -z "$self" ] && self="$0"
- if [ -z "$1" ]; then
- printf "%b%s:%b " "$_self" "$self" "$_clear"
- else
- printf "%b%s:%b " "$_self" "$self" "$_clear" >&2
- fi
-
-}
-
-print_unknownfiletype() {
- print_self error
- printf "%b%s%b is an unknown filetype!%b\n" \
- "$_high" "$*" "$_norm" "$_clear" >&2
-}
-
-set_colors_true() {
- _clear="\033[0m"
- _self="\033[00;38;2;146;131;116m"
- _error="\033[00;31m"
- _error_high="\033[00;1;31m"
- _norm="\033[00;38;2;213;196;161m"
- _high="\033[00;37m"
-}
-
-set_colors_256() {
- _clear="\033[0m"
- _self="\033[00;38;5;245m"
- _error="\033[00;31m"
- _error_high="\033[00;1;31m"
- _norm="\033[00;38;5;250m"
- _high="\033[00;37m"
-}
-
-set_colors_16() {
- _clear="\033[0m"
- _self="\033[00;34m"
- _error="\033[00;31m"
- _error_high="\033[00;1;31m"
- _norm="\033[00;37m"
- _high="\033[00;1;37m"
-}
-
-set_colors_2() {
- _clear=""
- _self=""
- _error=""
- _error_high=""
- _norm=""
- _high=""
-}
-
-case $TERM in
- rxvt-unicode-256color) set_colors_256 ;;
- rxvt-256color) set_colors_256 ;;
- rxvt-unicode) set_colors_16 ;;
- rxvt-mono) set_colors_2 ;;
- rxvt*) set_colors_2 ;;
- xterm-256color) set_colors_true ;;
- xterm-color) set_colors_16 ;;
- xterm*) set_colors_2 ;;
- screen-256color) set_colors_256 ;;
- screen*) set_colors_2 ;;
- *) set_colors_2 ;;
-esac

Return to the top of this page or return to the overview of this repo.

Diff bin/toggle.sh

diff --git a/bin/toggle.sh b/bin/toggle.sh
index 396b223..5dd49da 100755
--- a/bin/toggle.sh
+++ b/bin/toggle.sh
@@ -14,7 +14,7 @@
## -V Print version info.
##

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
exe=""

Return to the top of this page or return to the overview of this repo.

Diff bin/words.sh

diff --git a/bin/words.sh b/bin/words.sh
index 774788a..954c8b1 100755
--- a/bin/words.sh
+++ b/bin/words.sh
@@ -17,7 +17,7 @@
##
#

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"

Return to the top of this page or return to the overview of this repo.

Diff bin/xvt.sh

diff --git a/bin/xvt.sh b/bin/xvt.sh
index b1185bd..572c0da 100755
--- a/bin/xvt.sh
+++ b/bin/xvt.sh
@@ -20,7 +20,7 @@
# This'll break if you run a shell within a shell. It (should) only detect
# the outside shell. Might be fixed by altering the logic to check PPID.

-[ -x $HOME/bin/lib_print.sh ] && . $HOME/bin/lib_print.sh
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh

self="${0##*'/'}"
cwd=""

Return to the top of this page or return to the overview of this repo.

Diff config/alacritty/alacritty.yml.fix

diff --git a/config/alacritty/alacritty.yml.fix b/config/alacritty/alacritty.yml.fix
index ca97ee6..ac7d680 100644
--- a/config/alacritty/alacritty.yml.fix
+++ b/config/alacritty/alacritty.yml.fix
@@ -21,7 +21,7 @@ font:

draw_bold_text_with_bright_colors: true

-background_opacity: 0.73
+background_opacity: 0.8

schemes:
cev: &cev
@@ -64,3 +64,8 @@ schemes:

colors: *cev

+key_bindings:
+ - { key: V, mods: Control|Shift, action: ReceiveChar }
+ - { key: Home, mods: Shift, action: ReceiveChar }
+ - { key: End, mods: Shift, action: ReceiveChar }
+

Return to the top of this page or return to the overview of this repo.

Diff config/conky/conky.conf

diff --git a/config/conky/conky.conf b/config/conky/conky.conf
index 8e0d5ef..d4f37e7 100644
--- a/config/conky/conky.conf
+++ b/config/conky/conky.conf
@@ -15,6 +15,7 @@ conky.config = {
font = 'Inconsolata:size=50',
gap_x = 0,
gap_y = 0,
+ lua_load = "~/.config/conky/imagepath.lua",
minimum_height = 1080,
minimum_width = 1920,
net_avg_samples = 2,
@@ -39,11 +40,11 @@ conky.config = {

conky.text = [[
${if_match "${loadavg 1}" > "2.0"}\
-${image /tmp/back_character_dir/s3.png -p 996,0 -f 60}\
+${lua_parse imagepath s3}\
${else}${if_match "${loadavg 1}" > "1.0"}\
-${image /tmp/back_character_dir/s2.png -p 996,0 -f 60}\
+${lua_parse imagepath s2}\
${else}\
-${image /tmp/back_character_dir/s1.png -p 996,0 -f 60}\
+${lua_parse imagepath s1}\
${endif}
${endif}
]]

Return to the top of this page or return to the overview of this repo.

Diff config/conky/imagepath.lua

diff --git a/config/conky/imagepath.lua b/config/conky/imagepath.lua
new file mode 100644
index 0000000..a71fde4
--- /dev/null
+++ b/config/conky/imagepath.lua
@@ -0,0 +1,6 @@
+function conky_imagepath(snum)
+ local user = os.getenv("USER");
+ local image = "/tmp/back_"..user.."/"..snum..".png"
+ local r = "${image "..image.." -p 996,0 -f 60}";
+ return r;
+end

Return to the top of this page or return to the overview of this repo.

Diff config/dunst/dunstrc.fix

diff --git a/config/dunst/dunstrc.fix b/config/dunst/dunstrc.fix
index 592bd1a..adae1b9 100644
--- a/config/dunst/dunstrc.fix
+++ b/config/dunst/dunstrc.fix
@@ -1,51 +1,60 @@
[global]
-font=Inconsolata 24
-markup=yes
-format="%a: %s / %b"
-sort=yes
-indicate_hidden=yes
-alignment=left
-bounce_freq=0
-show_age_threshold=60
-word_wrap=no
-ignore_newline=no
-icon_path="/z/gfx/icons/Obsidian/Obsidian:/usr/local/share/icons/Faenza"
-# window geometry [{width}]x{height}][+/-{x}+/-{y}]
-# geometry="1920x32+0+600"
-geometry="512x70+1392+70"
-frame_width=8
-frame_color="xDK2"
-transparency=20
-idle_threshold=0
-monitor=0
-follow=mouse
-sticky_history=no
-line_height=0
-separator_height=0
-padding=0
-horizontal_padding=0
-separator_color="auto"
-startup_notification=true
-dmenu=/usr/local/bin/dmenu -p dunst:
-browser=/usr/local/bin/falkon
+ # window placement
+ # window geometry [{width}]x{height}][+/-{x}+/-{y}]
+ follow = mouse
+ geometry = "512x8+1392+70"
+ monitor = 0
+ # content placement & behavior
+ alignment = left
+ icon_position = left
+ icon_path = "/z/gfx/icons/Obsidian/Obsidian:/usr/local/share/icons/Faenza"
+ idle_threshold = 120
+ ignore_newline = no
+ indicate_hidden = yes
+ line_height = 0
+ max_icon_size = 32
+ min_icon_size = 32
+ show_age_threshold = 60
+ show_indicators = yes
+ sort = yes
+ stack_duplicates = true
+ sticky_history = no
+ vertical_alignment = center
+ word_wrap = no
+ # content colors & look
+ font = Inconsolata 24
+ format = "%a: %s / %b"
+ frame_width = 0
+ frame_color = "xDK2"
+ horizontal_padding = 8
+ markup = yes
+ padding = 8
+ separator_color = "auto"
+ separator_height = 0
+ transparency = 0
+ # extraz
+ browser = /usr/local/bin/xdg-open
+ # dmenu = /usr/local/bin/dmenu -p dunst:
+ startup_notification = true

[shortcuts]
-# close=mod4+n
-# close_all=mod4+shift+n
-# history=mod4+grave
-# context=mod4+shift+period
+ # close=mod4+n
+ # close_all=mod4+shift+n
+ # history=mod4+grave
+ # context=mod4+shift+period

[urgency_low]
-background="xDK0h"
-foreground="xDK4"
-timeout=5
+ background="xDK0h"
+ foreground="xDK4"
+ timeout=5

[urgency_normal]
-background="xDK0s"
-foreground="xLT3"
-timeout=5
+ background="xDK0s"
+ foreground="xLT3"
+ timeout=5

[urgency_critical]
-background="xLT4"
-foreground="xDK1"
-timeout=0
+ background="xLT4"
+ foreground="xDK1"
+ timeout=0
+# vim: ft=cfg

Return to the top of this page or return to the overview of this repo.

Diff config/herbstluftwm/autostart.fix

diff --git a/config/herbstluftwm/autostart.fix b/config/herbstluftwm/autostart.fix
index 6e44da6..b22e81d 100644
--- a/config/herbstluftwm/autostart.fix
+++ b/config/herbstluftwm/autostart.fix
@@ -179,7 +179,7 @@ hc attr theme.active.color 'xDK2'
hc attr theme.active.outer_color 'xDK1'
hc attr theme.active.title_color 'xLT4'
hc attr theme.urgent.background_color 'xORNf'
-hc attr theme.urgent.color 'xORNb'
+hc attr theme.urgent.color 'xORNn'
hc attr theme.urgent.outer_color 'xORNf'
hc attr theme.urgent.title_color 'xDK0'
hc attr settings.frame_bg_normal_color 'xDK0h'
@@ -190,25 +190,27 @@ hc attr settings.frame_border_active_color 'xDK2'
# rules
hc unrule -F
hc rule focus=off
-hc rule class=Alacritty focus=on
-hc rule class=Audacity focus=on tag="$(nameforidx 2 $tagnames)" index=0
-hc rule class=Chromium-browser focus=off tag="$(nameforidx 8 $tagnames)"
hc rule class=mpv focus=off pseudotile=off
-hc rule class=Falkon focus=off tag="$(nameforidx 8 $tagnames)"
+hc rule class=XConsole focus=off tag="$(nameforidx 7 $tagnames)" index=0
+hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
+# windows that should get focus. terminal emulators, image viewers, etc.
+hc rule class=Alacritty focus=on
hc rule class=lximage-qt focus=on
-hc rule class=Navigator focus=off tag="$(nameforidx 8 $tagnames)"
hc rule class=qterminal focus=on
-hc rule class=QupZilla focus=off tag="$(nameforidx 8 $tagnames)"
-hc rule class=Renoise focus=on tag="$(nameforidx 4 $tagnames)" index=0
hc rule class=SDL_App focus=on floating=on
hc rule class=Sxiv focus=on
hc rule class=Vncviewer focus=on tag="$(nameforidx 6 $tagnames)" index=0
-hc rule class=XConsole focus=off tag="$(nameforidx 7 $tagnames)" index=0
hc rule class=xterm-256color focus=on
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
-hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
-hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
+# windows that should float.
+hc rule class~'(.*[Ee][Xx][Ee])' floating=on
+hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
+# web browsers
+hc rule class=Chromium-browser focus=off tag="$(nameforidx 8 $tagnames)"
+hc rule class=Falkon focus=off tag="$(nameforidx 8 $tagnames)"
+hc rule class=Navigator focus=off tag="$(nameforidx 8 $tagnames)"
+hc rule class=QupZilla focus=off tag="$(nameforidx 8 $tagnames)"

# final setup
hc unlock

Return to the top of this page or return to the overview of this repo.

Diff config/jgmenu/jgmenurc.fix

diff --git a/config/jgmenu/jgmenurc.fix b/config/jgmenu/jgmenurc.fix
index 8daa663..e658548 100644
--- a/config/jgmenu/jgmenurc.fix
+++ b/config/jgmenu/jgmenurc.fix
@@ -54,14 +54,14 @@ icon_theme = Obsidian-Gray
# icon_theme_fallback = xtg
# arrow_string = ▸
# arrow_width = 15
-color_menu_bg = xBASE 89
-color_menu_bg_to = xBASE 89
-color_menu_border = xBASE 89
+color_menu_bg = xBASE 80
+color_menu_bg_to = xBASE 80
+color_menu_border = xBASE 80
color_norm_bg = xWIN 0
color_norm_fg = xTXTi 100
-color_sel_bg = xSBG 89
+color_sel_bg = xSBG 80
color_sel_fg = xSFG 100
-color_sel_border = xSBG 89
+color_sel_border = xSBG 80
color_sep_fg = xTXTi 20
color_scroll_ind = xTXTn 40
# color_title_fg = #eeeeee 50

Return to the top of this page or return to the overview of this repo.

Diff config/picom/picom.conf

diff --git a/config/picom/picom.conf b/config/picom/picom.conf
index af26659..76dce8c 100644
--- a/config/picom/picom.conf
+++ b/config/picom/picom.conf
@@ -38,6 +38,7 @@ focus-exclude = [
];
opacity-rule = [
"95:class_g = 'Audacity'",
+ "95:class_g = 'audacity.exe'",
"100:class_g = 'Chromium-browser'",
"100:class_g = 'Dvdisaster'",
"100:class_g = 'dzen'",

Return to the top of this page or return to the overview of this repo.

Diff config/redshift/hooks/background.sh

diff --git a/config/redshift/hooks/background.sh b/config/redshift/hooks/background.sh
index c48a4ff..14a8b77 100755
--- a/config/redshift/hooks/background.sh
+++ b/config/redshift/hooks/background.sh
@@ -4,14 +4,61 @@
# terms of the 2-clause BSD license. Please see the file "LICENSE" in
# the root dir of this repository for more information.
#
-# Part of an unnecessarily complicated automated background/wallpaper
-# changing system. To be documented soon(ish).
+#- lc.sh 2020/05/12 cev, last updated 2021/12/12
+## Usage: background.sh [-hvV] command argument1 argument2
+##
+## Redshift hook script for automated background setting based on
+## day/night period. Requires a directory of background files and
+## a directory of character files.
+##
+## -h Show help.
+## -v Verbose output (for debugging? purposes).
+## -V Print version info.
+##
+## Valid commands are currently:
+## clear Clear temporary files.
+## period-changed Set background to one corresponding with argument2.
+##
+## This script expects wallpaper filenames to have three fields separated
+## by an underscore: name, scene name, and period (day, interval, and
+## night). For example:
+## game1_scene1_day.jpg
+## game1_scene1_interval.jpg
+## game1_scene1_night.jpg
+## game1_scene2_day.jpg
+## ... and so on.
+##
+## Character filenames are similarly separated by underscore and have four
+## fields: name, character name, period, and s1 through s3 (where s1 is
+## displayed on low system load average and s3 on high). An example:
+## game1_character1_day_s1.jpg
+## game1_character1_day_s2.jpg
+## game1_character1_day_s3.jpg
+## game1_character1_interval_s1.jpg
+## ... and so on, filling out the necessary combinations.
+##
+## For more information read the script, it's not too complicated.
+##
+#
+
+[ -x $HOME/bin/cev_print.sh ] && . $HOME/bin/cev_print.sh
+
+self="${0##*'/'}"
+verbose=""

+# default directories
+tmpdir="/tmp/back_$(id -u -n)"
walldir="/z/gfx/wallpapers"
chardir="/z/gfx/rootchar"
-tmpcdir="/tmp/back_character_dir"

-character="yuko"
+# default tempfiles
+gamef="$tmpdir/game"
+charf="$tmpdir/character"
+scenef="$tmpdir/scene"
+
+# placeholders; used & defined below
+game=""
+char=""
scene=""

randlist() {
@@ -34,78 +81,112 @@ randlist() {
sed -n "${n}p" $1
}

+select_game() {
+ find "$walldir" -type f -iname "*jpg" -print | while read r; do
+ basename "$r" | cut -d '_' -f 1 >> ${gamef}s
+ done
+ # don't do a uniq pass here
+ randlist ${gamef}s > ${gamef}
+ rm ${gamef}s
+}
+
select_character() {
- find "$chardir" -regex '.*png' -print | while read r; do
- basename "$r" | cut -d '_' -f 2 >> /tmp/back_character1
+ find "$chardir" -type f -iname "${game}*" -print | while read r; do
+ basename "$r" | cut -d '_' -f 2 >> ${charf}1
done
- cat /tmp/back_character1 | uniq >> /tmp/back_characters
- randlist /tmp/back_characters > /tmp/back_character
- rm /tmp/back_character1 /tmp/back_characters
- [ ! -d "$tmpcdir" ] && mkdir "$tmpcdir"
+ cat ${charf}1 | uniq >> ${charf}s
+ randlist ${charf}s > ${charf}
+ rm ${charf}1 ${charf}s
}

select_scene() {
- find "$walldir" -regex ".*nochar.*jpg" -print | while read r; do
- basename "$r" | cut -d '_' -f 3 >> /tmp/back_scene1
+ find "$walldir" -type f -iname "${game}*" -print | while read r; do
+ basename "$r" | cut -d '_' -f 2 >> ${scenef}1
done
- cat /tmp/back_scene1 | uniq >> /tmp/back_scenes
- randlist /tmp/back_scenes | cut -d '.' -f 1 > /tmp/back_scene
- rm /tmp/back_scene1 /tmp/back_scenes
+ cat ${scenef}1 | uniq >> /${scenef}s
+ randlist ${scenef}s | cut -d '.' -f 1 > ${scenef}
+ rm ${scenef}1 ${scenef}s
}

select_set() {
+ select_game
+ game="$(cat ${gamef})"
+ [ "$verbose" ] && print_self && printf "select_set: game %s\n" "$game"
select_character
- character="$(cat /tmp/back_character)"
+ char="$(cat ${charf})"
+ [ "$verbose" ] && print_self && printf "select_set: character %s\n" "$char"
select_scene
- scene="$(cat /tmp/back_scene)"
+ scene="$(cat ${scenef})"
+ [ "$verbose" ] && print_self && printf "select_set: scene %s\n" "$scene"
}

-clear_character_dir() {
- if [ -d "$tmpcdir" ]; then
- rm "$tmpcdir"/*.???
+check_set() {
+ if [ ! -f ${gamef} -o ! -f ${charf} -o ! -f ${scenef} ]; then
+ select_set
+ else
+ last=$(stat -f %m ${charf})
+ curr=$(date +%s)
+ elapsed=$(($curr - $last))
+ elapsed=$(($elapsed / 3600))
+ if [ $elapsed -gt 22 ]; then
+ [ "$verbose" ] && print_self && \
+ printf "selection is over 22 hours old.\n"
+ select_set
+ else
+ game="$(cat ${gamef})"
+ char="$(cat ${charf})"
+ scene="$(cat ${scenef})"
+ fi
fi
}

-if [ ! -f /tmp/back_character -o ! -f /tmp/back_scene ]; then
- select_set
-else
- last=$(stat -f %m /tmp/back_character)
- curr=$(date +%s)
- elapsed=$(($curr - $last))
- elapsed=$(($elapsed / 3600))
- if [ $elapsed -gt 22 ]; then
- select_set
- else
- character="$(cat /tmp/back_character)"
- scene="$(cat /tmp/back_scene)"
+clear_character_dir() {
+ if [ -d "$tmpdir" ]; then
+ if [ "$verbose" ]; then
+ print_self
+ printf "clearing character dir %s\n" "$tmpdir"
+ fi
+ for i in 1 2 3; do
+ if [ -f "${tmpdir}/s$i.png" ]; then
+ rm ${verbose} ${tmpdir}/s$i.png
+ fi
+ done
fi
-fi
+}
+
+while getopts "hvV?" option; do
+ case $option in
+ h) print_help && exit ;;
+ v) verbose="-v" ;;
+ V) print_version && exit ;;
+ "?") print_help && exit ;;
+ esac
+ shift $((OPTIND - 1))
+done
+
+[ ! -d "$tmpdir" ] && mkdir -p "$tmpdir"

case $1 in
+ clear)
+ clear_character_dir
+ [ "$verbose" ] && print_self && printf "clearing temp files\n"
+ rm ${verbose} ${gamef} ${charf} ${scenef}
+ rmdir ${verbose} ${tmpdir}
+ ;;
period-changed)
+ check_set
case $3 in
- [Dd]aytime)
- clear_character_dir
- cp "$chardir"/day_"$character"_s1.png "$tmpcdir"/s1.png
- cp "$chardir"/day_"$character"_s2.png "$tmpcdir"/s2.png
- cp "$chardir"/day_"$character"_s3.png "$tmpcdir"/s3.png
- $HOME/bin/back.sh $walldir/day_nochar_${scene}.jpg
- ;;
- [Tt]ransition)
- clear_character_dir
- cp "$chardir"/transition_"$character"_s1.png "$tmpcdir"/s1.png
- cp "$chardir"/transition_"$character"_s2.png "$tmpcdir"/s2.png
- cp "$chardir"/transition_"$character"_s3.png "$tmpcdir"/s3.png
- $HOME/bin/back.sh $walldir/transition_nochar_${scene}.jpg
- ;;
- [Nn]ight)
- clear_character_dir
- cp "$chardir"/night_"$character"_s1.png "$tmpcdir"/s1.png
- cp "$chardir"/night_"$character"_s2.png "$tmpcdir"/s2.png
- cp "$chardir"/night_"$character"_s3.png "$tmpcdir"/s3.png
- $HOME/bin/back.sh $walldir/night_nochar_${scene}.jpg
- ;;
+ [Dd]aytime) period="day" ;;
+ [Nn]ight) period="night" ;;
+ [Tt]ransition) period="interval" ;;
esac
+ clear_character_dir
+ $HOME/bin/back.sh ${verbose} $walldir/${game}_${scene}_$period.???
+ [ "$verbose" ] && print_self && printf "copying character files\n"
+ for i in 1 2 3; do
+ cp ${verbose} "$chardir"/${game}_${char}_${period}_s$i.png \
+ "$tmpdir"/s$i.png
+ done
;;
esac

Return to the top of this page or return to the overview of this repo.

Diff config/tint2/tint2rc.fix

diff --git a/config/tint2/tint2rc.fix b/config/tint2/tint2rc.fix
index d90abdf..a7b1505 100644
--- a/config/tint2/tint2rc.fix
+++ b/config/tint2/tint2rc.fix
@@ -12,12 +12,12 @@ border_width = 0
border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
-background_color = xDK0h 73
-border_color = xDK0h 73
-background_color_hover = xDK0h 73
-border_color_hover = xDK0h 73
-background_color_pressed = xDK0h 73
-border_color_pressed = xDK0h 73
+background_color = xDK0h 80
+border_color = xDK0h 80
+background_color_hover = xDK0h 80
+border_color_hover = xDK0h 80
+background_color_pressed = xDK0h 80
+border_color_pressed = xDK0h 80

# Background 2: rounded Faenza-like button for normal taskbar name
rounded = 6
@@ -26,11 +26,11 @@ border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = xDK0s 100
-border_color = xDK0h 73
+border_color = xDK0h 80
background_color_hover = xDK0s 100
-border_color_hover = xDK0h 73
+border_color_hover = xDK0h 80
background_color_pressed = xDK0s 100
-border_color_pressed = xDK0h 73
+border_color_pressed = xDK0h 80

# Background 3: rounded Faenza-like button for active taskbar name
rounded = 6
@@ -39,11 +39,11 @@ border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = xLT4 100
-border_color = xDK0h 73
+border_color = xDK0h 80
background_color_hover = xLT4 100
-border_color_hover = xDK0h 73
+border_color_hover = xDK0h 80
background_color_pressed = xLT4 100
-border_color_pressed = xDK0h 73
+border_color_pressed = xDK0h 80
gradient_id = 1
gradient_id_hover = 1
gradient_id_pressed = 1
@@ -68,15 +68,41 @@ border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = xDK0s 100
-border_color = xDK0h 73
+border_color = xDK0h 80
background_color_hover = xDK0s 100
-border_color_hover = xDK0h 73
+border_color_hover = xDK0h 80
background_color_pressed = xDK0s 100
-border_color_pressed = xDK0h 73
+border_color_pressed = xDK0h 80
+
+# Background 6: urgent button for taskbar
+rounded = 0
+border_width = 0
+border_sides = TBLR
+border_content_tint_weight = 0
+background_content_tint_weight = 0
+background_color = xORNf 100
+border_color = xORNn 80
+background_color_hover = xORNn 100
+border_color_hover = xORNn 80
+background_color_pressed = xORNf 100
+border_color_pressed = xORNn 80
+
+# Background 7: iconified button for taskbar
+rounded = 0
+border_width = 0
+border_sides = TBLR
+border_content_tint_weight = 0
+background_content_tint_weight = 0
+background_color = xDK0s 100
+border_color = xDK0h 80
+background_color_hover = xDK0s 100
+border_color_hover = xDK0h 80
+background_color_pressed = xDK0s 100
+border_color_pressed = xDK0h 80

#--------------------------------------
# Panel
-panel_items = PPPPTFSPP
+panel_items = PPPTFSPP
panel_position = center left vertical
panel_size = 1080 64
panel_margin = 0 0
@@ -116,7 +142,7 @@ button_tooltip = FreeBSD
#--------------------------------------
# Button 2 (herbstluftwm button)
button = new
-button_icon = /z/gfx/icons/herbstluftwm96.png
+button_icon = /z/gfx/icons/herbstluftwm64.png
button_text =
button_background_id = 0
button_padding = 0 0 2
@@ -139,17 +165,6 @@ button_lclick_command = /home/cev/bin/xvt.sh
button_tooltip = ST Terminal Emulator

#--------------------------------------
-# Button 4 (File Manager)
-button = new
-button_icon = system-file-manager
-button_text =
-button_background_id = 0
-button_padding = 0 0 2
-button_max_icon_size = 64
-button_lclick_command = /usr/local/bin/pcmanfm-qt
-button_tooltip = PCManFM-QT
-
-#--------------------------------------
# Taskbar
taskbar_mode = single_desktop
taskbar_active_background_id = 0
@@ -160,7 +175,7 @@ taskbar_distribute_size = 0
taskbar_hide_different_monitor = 0
taskbar_hide_different_desktop = 0
taskbar_hide_if_empty = 1
-taskbar_hide_inactive_tasks = 1
+taskbar_hide_inactive_tasks = 0
taskbar_name = 1
taskbar_name_padding = 2 2
taskbar_name_active_background_id = 3
@@ -183,12 +198,16 @@ task_tooltip = 1
task_thumbnail = 0
task_thumbnail_size = 320
task_background_id = 5
+task_icon_asb = 100 0 -13
task_active_background_id = 5
-task_urgent_background_id = 5
-task_iconified_background_id = 5
+task_active_icon_asb = 100 0 0
+task_urgent_background_id = 6
+task_urgent_icon_asb = 100 0 0
+task_iconified_background_id = 7
+task_iconified_icon_asb = 100 -100 -25
mouse_left = toggle
mouse_middle = close
-mouse_right = toggle_iconify
+mouse_right = iconify
mouse_scroll_up = desktop_left
mouse_scroll_down = desktop_right

Return to the top of this page or return to the overview of this repo.

Diff tmux.conf.fix

diff --git a/tmux.conf.fix b/tmux.conf.fix
index 43fd963..88fa649 100644
--- a/tmux.conf.fix
+++ b/tmux.conf.fix
@@ -1,6 +1,4 @@
# Unknown creation date; last updated 2021/12/07.
-set-option -gq default-command /usr/local/bin/bash
-set-option -gq default-shell /usr/local/bin/bash
set-option -gq default-terminal 'xterm-256color'
set-option -gq set-titles on
# set-titles-string
@@ -18,6 +16,11 @@ bind-key -n C-F6 select-window -t :=6
bind-key -n C-F7 select-window -t :=7
bind-key -n C-F8 select-window -t :=8
bind-key -n F12 copy-mode
+# started having problems with home/end after setting term to xterm-256color
+# above. Found the fix below at:
+# stackoverflow.com/questions/18600188/home-end-keys-do-not-work-in-tmux
+bind-key -n Home send Escape "OH"
+bind-key -n End send Escape "OF"

set-option -g status-left '#[bg=xDK0s,fg=xDK4]%R '
set-option -g status-right '#[bg=xDK0s,fg=xDK4] #h:#S'

Return to the top of this page or return to the overview of this repo.