Not a bug, but a feature so annoyingly missing, that I consider it a bug:
borderwidth
is one for all:
- windows
- maximized window
- menus
For me, maximized windows should have borderwidth 0. Not only functionally pointless and eating screen space, border prevents from using top menus and right-hand-side scrollbars with mouse cursor sliding along screen edge - aiming on 1 axis, not 2 axes. Negative productivity boost.
I did even wrote a script to try and alleviate problem - bind a hotkey and use xdotool to control maximization and borderwidth. But cwm can't reload - it needs to restart, and while restarting windows flicker, and when there are many windows, restart is long. Poor UX.
cat /opt/libexec/cwm_borderwidth_toggle
#! /bin/sh
# cwm lacks "no border for maximized window" feature
# this script lets you bind a key to quickly toggle the border
#
# example usage in ~/.cwmrc:
# bind-key 4-b "cwm_borderwidth_toggle current_borderwidth 3"
#
# the script works by replacing all occurrences of "borderwidth #" in ~/.cwmrc
# which is also a bug
#
# e.g. we have in ~/.cwmrc:
# borderwidth 3
# bind-key 4-b "cwm_borderwidth_toggle current_borderwidth 3"
#
# having pressed super+b:
# borderwidth 0
# bind-key 4-b "cwm_borderwidth_toggle current_borderwidth 0"
#
# having pressed super+b again:
# borderwidth 3
# bind-key 4-b "cwm_borderwidth_toggle current_borderwidth 3"
#
# one could also use xdotool to combine maximization and border toggling to a single keypress
# borderwidth 3
# bind-key 4-m window-maximize
# bind-key 4-b "cwm_borderwidth_toggle current_borderwidth 3"
# bind-key 4-n "xdotool key super+m key super+b"
#
#############################################################
set -o errexit
CURRENT_BORDERWIDTH_DUMMY="${1:?1st argument should be "current_borderwidth"}"; unset CURRENT_BORDERWIDTH_DUMMY
CURRENT_BORDERWIDTH_VALUE="${2:?2nd argument should contain border width value}"
DEFAULT_BORDERWIDTH_VALUE=3
case ${CURRENT_BORDERWIDTH_VALUE}
in 0) SED_COMMAND="s/(^[ \t]*|current_)borderwidth 0(\"?)$/\1borderwidth ${DEFAULT_BORDERWIDTH_VALUE}\2/"
;; *) SED_COMMAND="s/(^[ \t]*|current_)borderwidth ${CURRENT_BORDERWIDTH_VALUE}(\"?)$/\1borderwidth 0\2/"
;; esac
# edit ~/.cwmrc inplace
sed -i.previous -E "${SED_COMMAND}" ~/.cwmrc
# the way to reload config is to restart cwm
kill -SIGHUP "$(pgrep -x cwm)"