aboutsummaryrefslogtreecommitdiff
path: root/src/usr/bin
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-07-13 09:56:51 -0400
committerB. Stack <bgstack15@gmail.com>2023-07-13 09:56:51 -0400
commit3fcd32aa6d295ac62fe0e526931fc556a4060343 (patch)
tree244c95a3ed1cf21c4cb2705276062d98cd7e10ae /src/usr/bin
downloadfix-alttab-3fcd32aa6d295ac62fe0e526931fc556a4060343.tar.gz
fix-alttab-3fcd32aa6d295ac62fe0e526931fc556a4060343.tar.bz2
fix-alttab-3fcd32aa6d295ac62fe0e526931fc556a4060343.zip
initial commit
Diffstat (limited to 'src/usr/bin')
-rwxr-xr-xsrc/usr/bin/fix-alttab-daemon43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/usr/bin/fix-alttab-daemon b/src/usr/bin/fix-alttab-daemon
new file mode 100755
index 0000000..f32084f
--- /dev/null
+++ b/src/usr/bin/fix-alttab-daemon
@@ -0,0 +1,43 @@
+#!/bin/sh
+# File: fix-alttab-daemon
+# Location: /usr/bin
+# Author: bgstack15
+# Startdate: 2023-07-10-2 08:55
+# SPDX-License-Identifier: GPL-3.0
+# Title: fix-alttab-daemon
+# Project: fix-alttab
+# Purpose: Detect changes to connected HDMI monitors
+# History:
+# Usage:
+# run in ~/.fluxbox/startup in the background
+# Reference:
+# Improve:
+# Dependencies:
+# dep-devuan: bgscripts-core
+# Documentation: README.md
+
+# load settings
+test -z "${DEFAULTSDIR}" && DEFAULTSDIR=/etc/sysconfig
+grep -qiE 'de(vu|bi)an|ubuntu|mint' /etc/os-release 1>/dev/null 2>&1 && DEFAULTSDIR=/etc/default
+test -f "${DEFAULTSDIR}/fix-alttab" && . "${DEFAULTSDIR}/fix-alttab"
+test -f "${XDG_CONFIG_HOME:-~/.config}/fix-alttab" && . "${XDG_CONFIG_HOME:-~/.config}/fix-alttab"
+test -z "${FIX_ALTTAB_BIN}" && FIX_ALTTAB_BIN=/usr/libexec/fix-alttab
+command -v plecho 1>/dev/null && _use_plecho=1
+unset _laststatus
+while ! test -f /tmp/stop-fix-alttab-daemon ;
+do
+ sleep "${ALTTAB_DAEMON_LOOP:-3}"
+ _status="$( APPLY= "${FIX_ALTTAB_BIN}" )"
+ test "${_status}" != "${_laststatus}" && {
+ APPLY=1 "${FIX_ALTTAB_BIN}" | \
+ {
+ if test "${_use_plecho}" = "1" ;
+ then
+ timeout 2 plecho
+ else
+ timeout 2 cat
+ fi
+ }
+ } | tee -a "${ALTTAB_DAEMON_LOGFILE:-fix-alttab-daemon.log}"
+ _laststatus="${_status}"
+done
bgstack15