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
@@ -1,5 +1,8 @@
|
||||
[logging]
|
||||
level=ERR
|
||||
level=OFF
|
||||
|
||||
[connection]
|
||||
wifi.powersave=3
|
||||
|
||||
[connectivity]
|
||||
enabled=false
|
||||
@@ -0,0 +1,2 @@
|
||||
[connectivity]
|
||||
enabled=false
|
||||
@@ -1,4 +1,4 @@
|
||||
# /etc/conf.d/modemmanager: config file for modemmanager
|
||||
|
||||
# Enable quick suspend/resume hooks with minimal logging to save power
|
||||
modemmanager_opts="--test-quick-suspend-resume --log-level=ERR"
|
||||
modemmanager_opts="--test-quick-suspend-resume --log-level=ERR --log-file=/dev/null"
|
||||
@@ -13,7 +13,7 @@ fi
|
||||
{ echo 6000 > /proc/sys/vm/dirty_writeback_centisecs; } 2>/dev/null || true
|
||||
{ echo 6000 > /proc/sys/vm/dirty_expire_centisecs; } 2>/dev/null || true
|
||||
{ echo 0 > /proc/sys/kernel/nmi_watchdog; } 2>/dev/null || true
|
||||
{ echo "1 4 1 4" > /proc/sys/kernel/printk; } 2>/dev/null || true
|
||||
{ echo "1 4 1 1" > /proc/sys/kernel/printk; } 2>/dev/null || true
|
||||
{ echo Y > /sys/module/workqueue/parameters/power_efficient; } 2>/dev/null || true
|
||||
{ echo Y > /sys/module/printk/parameters/console_suspend; } 2>/dev/null || true
|
||||
|
||||
|
||||
@@ -107,12 +107,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
|
||||
|
||||
|
||||
@@ -107,12 +107,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
|
||||
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
# - Qualcomm USB Diagnostics (05c6:9091 DIAG + AT + NCM) port toggle & RPMSG bridge
|
||||
set -u
|
||||
|
||||
if [ -e "/tmp/bananarchy_duress_mode" ] || [ -e "/tmp/bananarchy_screen_locked" ]; then
|
||||
if [ -e "/tmp/bananarchy_duress_mode" ]; then
|
||||
echo "Error: Engineering Menu is unavailable." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -e "/tmp/bananarchy_screen_locked" ] && [ "${1:-}" != "apply-boot" ]; then
|
||||
echo "Error: Engineering Menu is unavailable." >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -340,6 +344,44 @@ stop_diag_bridge() {
|
||||
pkill -f "bananarchy_diag_bridge_worker" 2>/dev/null || true
|
||||
}
|
||||
|
||||
apply_ext_logging() {
|
||||
lmode="${1:-off}"
|
||||
mkdir -p /home/user/.local/state/superd/logs /tmp/superd_state/superd/logs 2>/dev/null || true
|
||||
if [ "$lmode" = "on" ]; then
|
||||
echo "1" > "$CONF_DIR/ext_logging"
|
||||
echo "1" > /tmp/bananarchy_ext_logging
|
||||
chmod 0644 "$CONF_DIR/ext_logging" /tmp/bananarchy_ext_logging 2>/dev/null || true
|
||||
echo "4 4 1 7" > /proc/sys/kernel/printk 2>/dev/null || true
|
||||
nmcli general logging level WARN domains ALL >/dev/null 2>&1 || true
|
||||
mmcli -G INFO >/dev/null 2>&1 || true
|
||||
rm -f /tmp/superd.log /tmp/superd_state/superd.log /tmp/superd_state/superd/logs/*.log 2>/dev/null || true
|
||||
: > /tmp/sxmo.log 2>/dev/null || true
|
||||
chown 10000:10000 /tmp/sxmo.log 2>/dev/null || true
|
||||
chmod 0644 /tmp/sxmo.log 2>/dev/null || true
|
||||
chown -R 10000:10000 /tmp/superd_state 2>/dev/null || true
|
||||
else
|
||||
rm -f "$CONF_DIR/ext_logging" /tmp/bananarchy_ext_logging 2>/dev/null || true
|
||||
echo "1 4 1 1" > /proc/sys/kernel/printk 2>/dev/null || true
|
||||
rc-service syslog stop >/dev/null 2>&1 || true
|
||||
rc-service klogd stop >/dev/null 2>&1 || true
|
||||
nmcli general logging level OFF domains ALL >/dev/null 2>&1 || true
|
||||
mmcli -G ERR >/dev/null 2>&1 || true
|
||||
rm -f /home/user/.local/state/*.log /home/user/.local/state/*.log.old \
|
||||
/home/user/.local/state/superd/logs/*.log /home/user/.local/state/superd/logs/*.log.old \
|
||||
/tmp/superd_state/*.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/user/.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
|
||||
rm -f /tmp/superd.log /tmp/sxmo.log /tmp/dwm.log /tmp/fcitx5.log /tmp/sxmo_hook_start.log \
|
||||
/tmp/tinydm.log /tmp/tinydm.log.old /tmp/Xorg.0.log /tmp/Xorg.0.log.old 2>/dev/null || true
|
||||
rm -f /var/log/*.log /var/log/*.old /var/log/dmesg /var/log/messages 2>/dev/null || true
|
||||
chown -R 10000:10000 /tmp/superd_state /home/user/.local/state 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
start_diag_bridge() {
|
||||
stop_diag_bridge
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
@@ -534,6 +576,12 @@ case "$CMD" in
|
||||
vid="$(cat /sys/kernel/config/usb_gadget/g1/idVendor 2>/dev/null | sed 's/^0x//' || echo 18d1)"
|
||||
pid="$(cat /sys/kernel/config/usb_gadget/g1/idProduct 2>/dev/null | sed 's/^0x//' || echo d001)"
|
||||
|
||||
# 7. Extended logging status
|
||||
ext_logging="0"
|
||||
if [ -f "/tmp/bananarchy_ext_logging" ] || [ -f "$CONF_DIR/ext_logging" ]; then
|
||||
ext_logging="1"
|
||||
fi
|
||||
|
||||
echo "MODEL_NAME=$DEVICE_NAME"
|
||||
echo "CODENAME=$DEVICE_CODENAME"
|
||||
echo "NV_METHOD=$NV_METHOD"
|
||||
@@ -552,6 +600,7 @@ case "$CMD" in
|
||||
echo "CPU_MAX_MHZ=$cpu_max_mhz"
|
||||
echo "DIAG_ACTIVE=$diag_active"
|
||||
echo "USB_PID=${vid}:${pid}"
|
||||
echo "EXT_LOGGING=$ext_logging"
|
||||
;;
|
||||
|
||||
ttl)
|
||||
@@ -1040,7 +1089,39 @@ EOF
|
||||
fi
|
||||
;;
|
||||
|
||||
logging)
|
||||
mode="${2:-toggle}"
|
||||
if [ "$mode" = "status" ]; then
|
||||
if [ -f "/tmp/bananarchy_ext_logging" ] || [ -f "$CONF_DIR/ext_logging" ]; then
|
||||
echo "ON"
|
||||
else
|
||||
echo "OFF"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
if [ "$mode" = "toggle" ]; then
|
||||
if [ -f "/tmp/bananarchy_ext_logging" ] || [ -f "$CONF_DIR/ext_logging" ]; then
|
||||
mode="off"
|
||||
else
|
||||
mode="on"
|
||||
fi
|
||||
fi
|
||||
if [ "$mode" = "on" ] || [ "$mode" = "1" ]; then
|
||||
apply_ext_logging on
|
||||
echo "OK: Extended logging enabled (/tmp)"
|
||||
else
|
||||
apply_ext_logging off
|
||||
echo "OK: Extended logging disabled & purged"
|
||||
fi
|
||||
;;
|
||||
|
||||
apply-boot)
|
||||
# Apply saved extended logging setting (OFF by default)
|
||||
if [ -s "$CONF_DIR/ext_logging" ] && [ "$(cat "$CONF_DIR/ext_logging" 2>/dev/null || true)" = "1" ]; then
|
||||
apply_ext_logging on
|
||||
else
|
||||
apply_ext_logging off
|
||||
fi
|
||||
# Restore persistent IMEI override cache, Wi-Fi MAC, and Bluetooth MAC on boot
|
||||
if [ -s "$STATE_DIR/imei_override" ]; then
|
||||
cp -f "$STATE_DIR/imei_override" "/tmp/bananarchy_imei_override" 2>/dev/null || true
|
||||
@@ -1066,7 +1147,7 @@ EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {status|ttl|set-imei|set-wifi-mac|set-bt-mac|overclock|diag|apply-boot|reboot}" >&2
|
||||
echo "Usage: $0 {status|ttl|set-imei|set-wifi-mac|set-bt-mac|overclock|diag|logging|apply-boot|reboot}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -35,4 +35,8 @@ for p in $(pidof fcitx5 2>/dev/null || true); do
|
||||
fi
|
||||
done
|
||||
|
||||
exec /usr/bin/fcitx5 -D --disable=wayland >/tmp/fcitx5.log 2>&1
|
||||
if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
exec /usr/bin/fcitx5 -D --disable=wayland >/tmp/fcitx5.log 2>&1
|
||||
else
|
||||
exec /usr/bin/fcitx5 -D --disable=wayland --verbose="*=0" >/dev/null 2>&1
|
||||
fi
|
||||
@@ -2,6 +2,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# Synchronizes dunst notification colors and font with the active NeoUI .xth/.Xresources theme.
|
||||
|
||||
exec 9>/tmp/bananarchy_sync_dunst.lock
|
||||
flock -w 2 9 2>/dev/null || exit 0
|
||||
|
||||
XRES_FILE="/home/user/.Xresources"
|
||||
if [ -e /tmp/bananarchy_duress_mode ] && [ -r /tmp/duress_home/.Xresources ]; then
|
||||
XRES_FILE="/tmp/duress_home/.Xresources"
|
||||
@@ -121,9 +124,11 @@ fi
|
||||
if [ "${1:-}" != "--no-restart" ]; then
|
||||
if pidof -s dunst >/dev/null 2>&1; then
|
||||
pkill -x dunst >/dev/null 2>&1 || true
|
||||
sleep 0.08
|
||||
if ! pidof -s dunst >/dev/null 2>&1; then
|
||||
DISPLAY="${DISPLAY:-:0}" dunst -config /tmp/dunstrc >/dev/null 2>&1 </dev/null &
|
||||
if ! pidof -s superd >/dev/null 2>&1; then
|
||||
sleep 0.1
|
||||
if ! pidof -s dunst >/dev/null 2>&1; then
|
||||
DISPLAY="${DISPLAY:-:0}" dunst -config /tmp/dunstrc >/dev/null 2>&1 </dev/null &
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -53,6 +53,16 @@ unset WAYLAND_DISPLAY
|
||||
unset SWAYSOCK
|
||||
|
||||
mkdir -p "$XDG_RUNTIME_DIR" "$XDG_CACHE_HOME/sxmo" "$XDG_CONFIG_HOME/sxmo"
|
||||
if [ -s /etc/bananarchy/ext_logging ] && [ "$(cat /etc/bananarchy/ext_logging 2>/dev/null || true)" = "1" ]; then
|
||||
printf "1\n" > /tmp/bananarchy_ext_logging
|
||||
chmod 0644 /tmp/bananarchy_ext_logging 2>/dev/null || true
|
||||
else
|
||||
rm -f /tmp/bananarchy_ext_logging 2>/dev/null || true
|
||||
rm -f "$XDG_STATE_HOME"/*.log "$XDG_STATE_HOME"/*.log.old \
|
||||
"$XDG_STATE_HOME"/superd/logs/*.log "$XDG_STATE_HOME"/superd/logs/*.log.old \
|
||||
/tmp/sxmo.log /tmp/dwm.log /tmp/fcitx5.log /tmp/sxmo_hook_start.log \
|
||||
/tmp/tinydm.log /tmp/tinydm.log.old /tmp/Xorg.0.log /tmp/Xorg.0.log.old 2>/dev/null || true
|
||||
fi
|
||||
rm -f "$XDG_RUNTIME_DIR/sxmo.led.lock" "$XDG_RUNTIME_DIR"/sxmo_bat_state_* 2>/dev/null || true
|
||||
touch "$XDG_CACHE_HOME/sxmo/sxmo.noidle" "$XDG_CACHE_HOME/sxmo/sxmo.nosuspend"
|
||||
[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ] && printf "%s\n" "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR/dbus.bus"
|
||||
@@ -91,7 +101,11 @@ if pidof -s plymouthd >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
if ! pidof -s Xorg >/dev/null 2>&1; then
|
||||
"$XORG_BIN" :0 -s 0 -dpms -nolisten tcp -config "$XORG_CONFIG" -modulepath "$XORG_MODPATH" -logfile /tmp/Xorg.0.log >/dev/null 2>&1 </dev/null &
|
||||
if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
"$XORG_BIN" :0 -s 0 -dpms -nolisten tcp -config "$XORG_CONFIG" -modulepath "$XORG_MODPATH" -logfile /tmp/Xorg.0.log >/dev/null 2>&1 </dev/null &
|
||||
else
|
||||
"$XORG_BIN" :0 -s 0 -dpms -nolisten tcp -config "$XORG_CONFIG" -modulepath "$XORG_MODPATH" -logfile /dev/null -logverbose 0 >/dev/null 2>&1 </dev/null &
|
||||
fi
|
||||
i=0
|
||||
while [ "$i" -lt 40 ]; do
|
||||
if xset s off s noblank s 0 0 >/dev/null 2>&1; then
|
||||
@@ -114,13 +128,11 @@ done
|
||||
pkill -x dwm >/dev/null 2>&1 || true
|
||||
trap 'rm -f "$SESSION_PID_FILE"; pkill -P $$ >/dev/null 2>&1 || true; exit 0' INT TERM HUP QUIT
|
||||
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
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
|
||||
if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
( sxmo_hook_start.sh >/tmp/sxmo_hook_start.log 2>&1 </dev/null & )
|
||||
else
|
||||
( sxmo_hook_start.sh >/dev/null 2>&1 </dev/null & )
|
||||
fi
|
||||
( sxmo_hook_start.sh >/tmp/sxmo_hook_start.log 2>&1 </dev/null & )
|
||||
|
||||
first_iter=1
|
||||
while [ "$(cat "$SESSION_PID_FILE" 2>/dev/null)" = "$$" ]; do
|
||||
@@ -147,15 +159,14 @@ while [ "$(cat "$SESSION_PID_FILE" 2>/dev/null)" = "$$" ]; do
|
||||
fi
|
||||
( feh --no-fehbg "$WP_FLAG" "$WP_FILE" >/dev/null 2>&1 </dev/null & )
|
||||
if [ "$first_iter" = "0" ]; then
|
||||
pkill -x conky >/dev/null 2>&1 || true
|
||||
sleep 0.05
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
|
||||
pidof -s fcitx5 >/dev/null 2>&1 || superctl start fcitx5 >/dev/null 2>&1 || ( /usr/bin/bananarchy-fcitx5.sh </dev/null & )
|
||||
fi
|
||||
first_iter=0
|
||||
dwm >/tmp/dwm.log 2>&1 || true
|
||||
if [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
dwm >/tmp/dwm.log 2>&1 || true
|
||||
else
|
||||
dwm >/dev/null 2>&1 || true
|
||||
fi
|
||||
if [ "$(cat "$SESSION_PID_FILE" 2>/dev/null)" != "$$" ] || pidof -s dwm >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
Binary file not shown.
@@ -225,6 +225,8 @@ $icon_phl Modem Log^0^sxmo_modemlog.sh"
|
||||
bt_is_unblocked_fast && _bt_icon="$icon_ton"
|
||||
_susp_icon="$icon_ton"
|
||||
[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend" ] && _susp_icon="$icon_tof"
|
||||
_log_icon="$icon_tof"
|
||||
[ -e "/tmp/bananarchy_ext_logging" ] && _log_icon="$icon_ton"
|
||||
CHOICES="$icon_plk Passcode^0^xpasscode
|
||||
$icon_cfg Themes^0^xthemes
|
||||
$icon_aru Brightness^1^sxmo_brightness.sh up
|
||||
@@ -232,9 +234,10 @@ $icon_ard Brightness^1^sxmo_brightness.sh down
|
||||
$icon_bth Bluetooth $_bt_icon^1^doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth
|
||||
$icon_clk Change Timezone^1^sxmo_timezonechange.sh
|
||||
$icon_zzz Auto-suspend $_susp_icon^1^(rm ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend 2>/dev/null || touch ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend)
|
||||
$icon_inf Extended Logging $_log_icon^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"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -68,12 +68,14 @@ confirm_menu() {
|
||||
}
|
||||
|
||||
sxmo_log() {
|
||||
printf "%s %s: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" | tee -a "${XDG_STATE_HOME:-$HOME}"/sxmo.log 1>&2
|
||||
[ -f /tmp/bananarchy_ext_logging ] || return 0
|
||||
printf "%s %s: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" >> /tmp/sxmo.log 2>/dev/null || true
|
||||
}
|
||||
|
||||
sxmo_debug() {
|
||||
[ -f /tmp/bananarchy_ext_logging ] || return 0
|
||||
if [ -n "$SXMO_DEBUG" ]; then
|
||||
printf "%s %s DEBUG: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" | tee -a "${XDG_STATE_HOME:-$HOME}"/sxmo.log 1>&2
|
||||
printf "%s %s DEBUG: %s\n" "$(date +%H:%M:%S)" "${0##*/}" "$*" >> /tmp/sxmo.log 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,6 @@ checkforincomingcalls() {
|
||||
xcallscreen incoming "$VOICECALLID" "$INCOMINGNUMBER" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
sxmo_jobs.sh start proximity_lock sxmo_proximitylock.sh
|
||||
sxmo_hook_statusbar.sh state &
|
||||
|
||||
# If we already got an active call
|
||||
|
||||
@@ -87,7 +87,6 @@ dial_number() {
|
||||
elif command -v xcallscreen >/dev/null 2>&1; then
|
||||
xcallscreen outgoing "$CALLID" "$NUMBER" >/dev/null 2>&1 || true
|
||||
fi
|
||||
sxmo_jobs.sh start proximity_lock sxmo_proximitylock.sh
|
||||
sxmo_hook_statusbar.sh state &
|
||||
return 0
|
||||
fi
|
||||
@@ -148,7 +147,6 @@ dial_number() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
sxmo_jobs.sh start proximity_lock sxmo_proximitylock.sh
|
||||
sxmo_hook_statusbar.sh state &
|
||||
|
||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
||||
|
||||
@@ -157,8 +157,6 @@ case "$1" in
|
||||
;;
|
||||
logout)
|
||||
sxmo_hook_logout.sh || true
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
rm -rf /tmp/sxmo_conky_time_state /tmp/sxmo_conky_restart.lock
|
||||
case "${SXMO_WM:-dwm}" in
|
||||
"i3") i3-msg exit ;;
|
||||
"sway") swaymsg exit ;;
|
||||
|
||||
@@ -52,16 +52,12 @@ xorgdisplay() {
|
||||
if [ -w /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ]; then
|
||||
printf 'powersave\n' > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null || true
|
||||
fi
|
||||
pkill -STOP -x conky 2>/dev/null || true
|
||||
xset s off s noblank >/dev/null 2>&1 || true
|
||||
;;
|
||||
on)
|
||||
if [ -w /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ]; then
|
||||
printf 'schedutil\n' > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null || true
|
||||
fi
|
||||
if [ ! -f /tmp/bananarchy_screen_locked ]; then
|
||||
pkill -CONT -x conky 2>/dev/null || true
|
||||
fi
|
||||
xset s off s noblank >/dev/null 2>&1 || true
|
||||
if [ -w /sys/class/backlight/backlight/bl_power ]; then
|
||||
printf '0\n' > /sys/class/backlight/backlight/bl_power 2>/dev/null || true
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
setup_log() {
|
||||
logfile=${XDG_STATE_HOME:-~/.local/state}/tinydm.log
|
||||
mkdir -p "$(dirname "$logfile")"
|
||||
if [ -f "$logfile" ]; then
|
||||
# keep previous log file around
|
||||
mv "$logfile" "$logfile".old
|
||||
rm -f "${XDG_STATE_HOME:-$HOME/.local/state}/tinydm.log" \
|
||||
"${XDG_STATE_HOME:-$HOME/.local/state}/tinydm.log.old" 2>/dev/null || true
|
||||
if [ -f /etc/bananarchy/ext_logging ] || [ -f /tmp/bananarchy_ext_logging ]; then
|
||||
logfile=/tmp/tinydm.log
|
||||
if [ -f "$logfile" ]; then
|
||||
mv "$logfile" "$logfile".old 2>/dev/null || true
|
||||
fi
|
||||
exec >"$logfile" 2>&1
|
||||
else
|
||||
rm -f /tmp/tinydm.log /tmp/tinydm.log.old 2>/dev/null || true
|
||||
exec >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
exec >"$logfile" 2>&1
|
||||
}
|
||||
|
||||
source_profile() {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -59,17 +59,13 @@ setup_tz() {
|
||||
ln -s "$zonepath" "${ROOT}"etc/localtime
|
||||
printf "%s\n" "$zone" > "${ROOT}"etc/timezone 2>/dev/null || true
|
||||
if [ -z "$ROOT" ] || [ "$ROOT" = "/" ]; then
|
||||
rm -f /tmp/sxmo_conky_time_state
|
||||
if pidof -s Xorg >/dev/null 2>&1; then
|
||||
su -s /bin/sh user -c '
|
||||
export PATH="/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin"
|
||||
export DISPLAY=:0
|
||||
export XDG_RUNTIME_DIR="/run/user/10000"
|
||||
export XDG_CONFIG_HOME="/home/user/.config"
|
||||
sxmo_hook_statusbar.sh time >/dev/null 2>&1 || {
|
||||
pkill -9 -x conky >/dev/null 2>&1 || true
|
||||
DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
|
||||
}
|
||||
sxmo_hook_statusbar.sh time >/dev/null 2>&1 || true
|
||||
' >/dev/null 2>&1 || true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -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