Initial low vision features added. xzoom needs to be installed for magnification. This first implementation is probably terrible, feedback welcome for improvement. Screen lock can now happen when I38 starts. As a reminder, it's not as secure as one of the system lockers, but it is screen reader accessible and should keep casual snoopers thwarted.

This commit is contained in:
Storm Dragon committed 2026-05-20 03:25:28 -04:00
1 parent 7ef49290ea
commit 1a2252d8de
5 files changed
+158 -22

No files matched your search

+76 -15
View File
@@ -324,6 +324,7 @@ kbd="${kbd[*]}"
# Volume settings
volumeJump="$volumeJump"
i3FontSize="${i3FontSize:-12}"
# Application paths
screenReader="$screenReader"
@@ -344,6 +345,7 @@ sounds="$sounds"
# Screen lock
screenlockPinHash="$screenlockPinHash"
screenlockAutolockSeconds="${screenlockAutolockSeconds:-0}"
screenlockOnStartup="${screenlockOnStartup:-1}"
# Personal mode
personalModeEnabled="${personalModeEnabled:-0}"
@@ -514,6 +516,15 @@ write_desktop_shortcuts_template() {
EOF
}
write_i38_xresources() {
local xresourcesFile="${i3Path}/I38.Xresources"
cat << 'EOF' > "$xresourcesFile"
! Visual settings generated by I38
Xcursor.size: 48
EOF
}
write_waytray_config() {
# Only create config if waytray binaries are detected
if ! command -v waytray-daemon &> /dev/null || ! command -v waytray &> /dev/null ; then
@@ -641,20 +652,32 @@ fi
if [[ -z "$volumeJump" ]]; then
volumeJump=$(rangebox "How much should pressing the volume keys change the volume?" 1 15 5)
fi
if [[ -z "$i3FontSize" ]] || [[ ! "$i3FontSize" =~ ^[0-9]+$ ]]; then
configChanged=1
i3FontSize=$(rangebox "How large should I38 window title text be?" 8 24 12)
if [[ ! "$i3FontSize" =~ ^[0-9]+$ ]]; then
i3FontSize=12
fi
fi
# Screen Reader
if [[ -z "$screenReader" ]] || ! command -v "$screenReader" &> /dev/null; then
if [[ -z "$screenReader" ]] || { [[ "$screenReader" != "none" ]] && ! command -v "$screenReader" &> /dev/null; }; then
programList=()
for i in cthulhu orca ; do
if command -v "${i/#-/}" &> /dev/null ; then
programList+=("$i")
fi
done
programList+=("None")
if [[ ${#programList[@]} -gt 1 ]]; then
screenReader="$(menulist ":Screen Reader" "${programList[@]}")"
else
screenReader="${programList[0]#-}"
fi
screenReader="$(command -v "$screenReader")"
if [[ "$screenReader" == "None" ]]; then
screenReader="none"
else
screenReader="$(command -v "$screenReader")"
fi
export screenReader
else
# Validate and export existing preference
@@ -803,7 +826,7 @@ if [[ -z "$dex" ]]; then
fi
fi
fi
if [[ $dex -eq 0 ]]; then
if [[ $dex -eq 0 ]] && [[ "$screenReader" != "none" ]] && [[ -n "$screenReader" ]]; then
dex -t "${XDG_CONFIG_HOME:-${HOME}/.config}/autostart" -c "$(command -v "$screenReader")"
fi
if [[ -z "$batteryAlert" ]]; then
@@ -815,7 +838,9 @@ if [[ -z "$batteryAlert" ]]; then
fi
fi
fi
if [[ -z "$brlapi" ]]; then
if [[ "$screenReader" == "none" ]] || [[ -z "$screenReader" ]]; then
brlapi=1
elif [[ -z "$brlapi" ]]; then
if yesno "Do you want to use a braille display with ${screenReader##*/}?"; then
brlapi=0
else
@@ -867,6 +892,14 @@ if [[ -z "$screenlockPinHash" ]]; then
fi
fi
if [[ -n "$screenlockPinHash" ]]; then
if [[ -z "${screenlockOnStartup+x}" ]]; then
configChanged=1
if yesno "Lock the screen automatically when I38 starts? This is useful for privacy, but if your screen reader or display setup fails you may need to enter the PIN without feedback."; then
screenlockOnStartup=0
else
screenlockOnStartup=1
fi
fi
if command -v xprintidle &> /dev/null; then
if [[ -z "${screenlockAutolockSeconds+x}" ]] || [[ ! "$screenlockAutolockSeconds" =~ ^[0-9]+$ ]]; then
configChanged=1
@@ -877,6 +910,7 @@ if [[ -n "$screenlockPinHash" ]]; then
fi
else
screenlockAutolockSeconds=0
screenlockOnStartup=1
fi
# Personal mode
personalModeExists=1
@@ -915,6 +949,7 @@ write_waytray_config
mkdir -p "${i3Path}"
write_i38_version
write_desktop_shortcuts_template
write_i38_xresources
# Move scripts into place
cp -rv scripts/ "${i3Path}/" | dialog --backtitle "I38" --progressbox "Moving scripts into place and writing config..." -1 -1
apply_screenlock_pin
@@ -943,9 +978,8 @@ workspace_layout tabbed
# this fixes some issues in some games that require focus and pause when focus is moved via mouse accidentally
focus_follows_mouse no
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# Font for window titles and tab labels.
font pango:monospace ${i3FontSize}
# Window rules
# Fix Wine window issues - improves stability and prevents lockups
@@ -963,6 +997,15 @@ bindsym \$mod+Control+b exec ${i3Path}/scripts/bookmarks.sh
# Clipboard manager
bindsym \$mod+Control+c exec ${i3Path}/scripts/i38-clipboard.py --show
# Move the mouse pointer to the center of the focused window
bindsym \$mod+Control+m exec --no-startup-id ${i3Path}/scripts/find_mouse.sh
$(if command -v xzoom &> /dev/null; then
echo "# Magnify part of the screen with xzoom"
echo "bindsym \$mod+Control+z exec --no-startup-id xzoom"
echo
fi)
# gtk bar
bindsym \$mod+Control+Delete exec --no-startup-id sgtk-bar
@@ -1242,12 +1285,18 @@ bindsym a exec ${i3Path}/scripts/ai.py, mode "default"
bindsym Mod1+Shift+r exec --no-startup-id ${i3Path}/scripts/slideshow_record_toggle.sh, mode "default"
# Get a list of windows in the current workspace
bindsym apostrophe exec --no-startup-id ${i3Path}/scripts/window_list.sh, mode "default"
# Restart Cthulhu
bindsym Shift+c exec $(command -v cthulhu) --replace, mode "default"
# Restart Orca
bindsym Shift+o exec $(command -v orca) --replace, mode "default"
# Toggle screen reader
bindsym Shift+t exec ${i3Path}/scripts/toggle_screenreader.sh, mode "default"
$(if command -v cthulhu &> /dev/null; then
echo "# Restart Cthulhu"
echo "bindsym Shift+c exec $(command -v cthulhu) --replace, mode \"default\""
fi)
$(if command -v orca &> /dev/null; then
echo "# Restart Orca"
echo "bindsym Shift+o exec $(command -v orca) --replace, mode \"default\""
fi)
$(if [[ "$screenReader" != "none" ]] && [[ -n "$screenReader" ]]; then
echo "# Toggle screen reader"
echo "bindsym Shift+t exec ${i3Path}/scripts/toggle_screenreader.sh, mode \"default\""
fi)
# reload the configuration file
bindsym Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default"
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
@@ -1272,6 +1321,9 @@ cat << EOF >> "${i3Path}/config"
$(if [[ $sounds -eq 0 ]]; then
echo "exec_always --no-startup-id ${i3Path}/scripts/sound.py"
fi
if command -v xrdb &> /dev/null; then
echo "exec --no-startup-id xrdb -merge ${i3Path}/I38.Xresources"
fi
# Steam game focus handler - focuses games when they open behind Big Picture
if command -v steam &> /dev/null; then
echo "exec --no-startup-id ${i3Path}/scripts/steam_games.py"
@@ -1303,6 +1355,9 @@ fi
if [[ -n "$screenlockPinHash" ]] && [[ "${screenlockAutolockSeconds:-0}" -gt 0 ]] && command -v xprintidle &> /dev/null; then
echo "exec_always --no-startup-id ${i3Path}/scripts/screenlock_autolock.sh ${screenlockAutolockSeconds}"
fi
if [[ -n "$screenlockPinHash" ]] && [[ "${screenlockOnStartup:-1}" -eq 0 ]]; then
echo "exec --no-startup-id bash -c 'sleep 2; ${i3Path}/scripts/screenlock.sh'"
fi
# WayTray system tray daemon
if command -v waytray-daemon &> /dev/null ; then
echo 'exec_always --no-startup-id bash -c "pgrep -x waytray-daemon > /dev/null || waytray-daemon"'
@@ -1319,7 +1374,9 @@ else
if command -v x11bell &> /dev/null; then
echo 'exec --no-startup-id x11bell play -nqV0 synth .1 sq norm -12'
fi
echo "exec $screenReader"
if [[ "$screenReader" != "none" ]] && [[ -n "$screenReader" ]]; then
echo "exec $screenReader"
fi
fi)
# First run help documentation
@@ -1367,7 +1424,11 @@ textEditor="${textEditor##*/}"
fileBrowser="${fileBrowser##*/}"
ircClient="${ircClient##*/}"
webBrowserHelp="${webBrowser:-no web browser was configured}"
screenReaderHelp="${screenReader:-no screen reader was configured}"
if [[ "$screenReader" == "none" ]] || [[ -z "$screenReader" ]]; then
screenReaderHelp="no screen reader was configured"
else
screenReaderHelp="$screenReader"
fi
textEditorHelp="${textEditor:-no text editor was configured}"
if [[ -n "$fileBrowser" ]]; then
fileBrowserHelp="I38 uses ${fileBrowser} for file management. Launch it in Ratpoison mode with the \`f\` key."