Fix lid wake blanking, passcode lag, idle drain, zero-log privacy default, and replace Conky with native dwm clock
This commit is contained in:
1 parent
11ec778c2f
commit
1d71bc81d8
42 files changed
+732
-267
No files matched your search
@@ -4,4 +4,5 @@ Description=lightweight notification daemon for x11 compositors
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1s
|
||||
ExecStart=/usr/bin/dunst -config /tmp/dunstrc
|
||||
@@ -76,9 +76,12 @@ case "$WMCLASS" in
|
||||
$icon_zzz Auto-suspend $(
|
||||
[ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
|
||||
) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)
|
||||
$icon_inf Extended Logging $(
|
||||
[ -e /tmp/bananarchy_ext_logging ] && printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
|
||||
) ^ 1 ^ bananarchy-engmenu-ctl logging toggle
|
||||
$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
|
||||
$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_debug_suspend.sh
|
||||
$icon_inf Log ^ 0 ^ sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
|
||||
$icon_inf Log ^ 0 ^ sxmo_terminal.sh tail -n 100 -f /tmp/sxmo.log
|
||||
$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
|
||||
"
|
||||
WINNAME=Config
|
||||
|
||||
@@ -15,7 +15,6 @@ cur_state=""
|
||||
[ "$cur_state" = "unlock" ] && exit 0
|
||||
|
||||
printf '1\n' > /tmp/bananarchy_screen_locked
|
||||
pkill -STOP -x conky 2>/dev/null || true
|
||||
|
||||
if ! sxmo_jobs.sh running proximity_lock -q; then
|
||||
if [ -f /tmp/sxmo_call_ringing ] || [ -f /tmp/sxmo_active_call ] || [ -n "$(ls -A "$XDG_RUNTIME_DIR/sxmo_calls" 2>/dev/null)" ]; then
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
|
||||
# This script is called with both toggle wm and when loging out (i.e., restarting)
|
||||
# current window manager.
|
||||
pkill -x conky >/dev/null 2>&1 || true
|
||||
rm -f /tmp/sxmo_conky_time_state
|
||||
exit 0
|
||||
@@ -12,10 +12,9 @@
|
||||
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
|
||||
cur_state=""
|
||||
[ -r "$STATE_FILE" ] && { read -r cur_state < "$STATE_FILE" 2>/dev/null || true; }
|
||||
[ "$cur_state" = "unlock" ] && exit 0
|
||||
[ "$cur_state" != "screenoff" ] && exit 0
|
||||
|
||||
printf '1\n' > /tmp/bananarchy_screen_locked
|
||||
pkill -STOP -x conky 2>/dev/null || true
|
||||
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_led.sh blink red blue &
|
||||
@@ -30,7 +29,7 @@ case "$SXMO_WM" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$cur_state" != "unlock" ]; then
|
||||
if [ "$cur_state" = "screenoff" ]; then
|
||||
sxmo_wm.sh display off
|
||||
fi
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
|
||||
|
||||
@@ -20,7 +20,22 @@ fi
|
||||
if ! superctl status > /dev/null 2>&1; then
|
||||
pkill -9 -x superd > /dev/null 2>&1 || true
|
||||
rm -f "$XDG_RUNTIME_DIR/superd.lock" "$XDG_RUNTIME_DIR/superd.sock"
|
||||
sxmo_jobs.sh start daemon_manager superd
|
||||
mkdir -p /tmp/superd_state/superd/logs "$HOME/.local/state/superd/logs" 2>/dev/null || true
|
||||
if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
rm -f /tmp/superd.log /tmp/superd_state/superd.log /tmp/superd_state/superd/logs/*.log 2>/dev/null || true
|
||||
sxmo_jobs.sh start daemon_manager env XDG_STATE_HOME=/tmp/superd_state superd -l /tmp/superd.log
|
||||
else
|
||||
rm -f "$HOME/.local/state/superd.log" "$HOME/.local/state/superd.log.old" \
|
||||
"$HOME/.local/state/superd/logs"/*.log "$HOME/.local/state/superd/logs"/*.log.old \
|
||||
/tmp/superd.log /tmp/superd_state/superd/logs/*.log 2>/dev/null || true
|
||||
ln -sf /dev/null /tmp/superd_state/superd.log 2>/dev/null || true
|
||||
for svc in /usr/share/superd/services/*.service "$HOME/.config/superd/services"/*.service; do
|
||||
[ -f "$svc" ] || continue
|
||||
svc_name="$(basename "$svc" .service)"
|
||||
ln -sf /dev/null "/tmp/superd_state/superd/logs/${svc_name}.log" 2>/dev/null || true
|
||||
done
|
||||
sxmo_jobs.sh start daemon_manager env XDG_STATE_HOME=/tmp/superd_state superd -l /dev/null
|
||||
fi
|
||||
while ! superctl status > /dev/null 2>&1; do
|
||||
sleep 0.05
|
||||
done
|
||||
@@ -107,12 +122,6 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
|
||||
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
|
||||
fi
|
||||
|
||||
# Start the desktop widget (e.g. clock)
|
||||
pidof -s conky >/dev/null 2>&1 || DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
|
||||
if [ -f /tmp/bananarchy_screen_locked ]; then
|
||||
pkill -STOP -x conky 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# It watch network changes and update the status bar icon by example
|
||||
superctl start sxmo_networkmonitor
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
# we disable shellcheck SC2154 (unreferenced variable used)
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
if [ "${1:-}" = "periodics" ]; then
|
||||
[ -f /tmp/bananarchy_screen_locked ] && exit 0
|
||||
if [ -r /sys/class/backlight/backlight/brightness ]; then
|
||||
read -r _br < /sys/class/backlight/backlight/brightness 2>/dev/null || _br=1
|
||||
case "$_br" in ''|0|-*) exit 0 ;; esac
|
||||
fi
|
||||
fi
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
. sxmo_hook_icons.sh
|
||||
@@ -17,53 +25,8 @@
|
||||
# right). Our preference is to have "static" icons on the
|
||||
# right and "variable" icons (that come and go) on the left.
|
||||
|
||||
restart_conky() {
|
||||
lockdir="/tmp/sxmo_conky_restart.lock"
|
||||
if ! mkdir "$lockdir" 2>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
superctl stop sxmo_conky >/dev/null 2>&1 || true
|
||||
pkill -x conky >/dev/null 2>&1 || true
|
||||
sleep 0.05
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
DISPLAY="${DISPLAY:-:0}" CONKY_DPY="${DISPLAY:-:0}" \
|
||||
conky -c "${XDG_CONFIG_HOME:-/home/user/.config}/sxmo/conky.conf" -d >/dev/null 2>&1 </dev/null || true
|
||||
rmdir "$lockdir" 2>/dev/null || true
|
||||
}
|
||||
|
||||
set_time() {
|
||||
sxmobar -a time 99 " $(date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}")"
|
||||
force_conky="${1:-0}"
|
||||
state_file="/tmp/sxmo_conky_time_state"
|
||||
cur_btime="$(awk '/^btime / {print $2}' /proc/stat 2>/dev/null || echo 0)"
|
||||
cur_tz="$(readlink /etc/localtime 2>/dev/null || cat /etc/timezone 2>/dev/null || echo "")|$(date '+%Z%z')"
|
||||
do_restart="$force_conky"
|
||||
if ! pidof -s conky >/dev/null 2>&1; then
|
||||
do_restart=1
|
||||
elif [ -r "$state_file" ]; then
|
||||
old_btime=""
|
||||
old_tz=""
|
||||
{
|
||||
IFS= read -r old_btime || true
|
||||
IFS= read -r old_tz || true
|
||||
} < "$state_file"
|
||||
if [ "$cur_tz" != "$old_tz" ]; then
|
||||
do_restart=1
|
||||
else
|
||||
case "$cur_btime:$old_btime" in
|
||||
*[!0-9:]*) do_restart=1 ;;
|
||||
*)
|
||||
diff=$((cur_btime - old_btime))
|
||||
[ "$diff" -lt 0 ] && diff=$((-diff))
|
||||
[ "$diff" -ge 2 ] && do_restart=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
printf "%s\n%s\n" "$cur_btime" "$cur_tz" > "$state_file" 2>/dev/null || true
|
||||
if [ "$do_restart" = "1" ]; then
|
||||
restart_conky
|
||||
fi
|
||||
}
|
||||
|
||||
set_state() {
|
||||
|
||||
@@ -14,7 +14,6 @@ if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
fi
|
||||
|
||||
sxmo_wm.sh display on
|
||||
pkill -CONT -x conky 2>/dev/null || true
|
||||
( sxmo_hook_statusbar.sh state_change >/dev/null 2>&1 & )
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
|
||||
sxmo_wm.sh inputevent touchscreen on
|
||||
|
||||
Reference in new issue
Block a user