7 Commits

Author SHA1 Message Date
b1c0695134 sxmo_autorotate: allow all four orientations 2023-06-27 08:28:52 +00:00
b0e7888c64 sxmo_hook_lock: allow configuration of auto-screenoff timeout
this naming mirrors SXMO_UNLOCK_IDLE_TIME introduced in 70be22c9.
slow devices under heavy load might take a few seconds to become
responsive, especially when exiting suspend, so it's nice to allow them
to configure a lengthier timeout.
2023-06-27 08:28:52 +00:00
88cc39cfce mpris suspend blocker: handle case where multiple players connected
`man playerctl` shows that `playerctl` by default operates on
"the first available player". if the user launches two mpris-capable
applications -- one stopped, one playing -- then `playerctl status`
is observed to return `Stopped` and sxmo incorrectly enters suspend.
the solution here is to explicitly query the status of all players.
2023-06-27 08:28:52 +00:00
086f5281dc sxmo_swayinitconf: fix xkb paths
the xkb files were moved in 6a529751 but not all references were updated
2023-06-27 08:28:52 +00:00
62865b26a3 sxmo_init: ensure XDG_STATE_HOME exists
`sxmo_log()` logs to `$XDG_STATE_HOME/sxmo.log` (`~/.local/state/sxmo.log`),
so sxmo needs to ensure that directory exists to have reliable logging.
2023-06-27 08:27:34 +00:00
b963894397 sxmo_init: behave well when user's primary group differs from their name
the default for NixOS is to place ordinary users into the "users" group,
and to not create a group per user.
2023-06-27 08:17:26 +00:00
7fa107e02b NOT FOR UPSTREAM: remove explicit busybox calls 2023-06-27 08:17:26 +00:00
6 changed files with 18 additions and 10 deletions

View File

@@ -68,7 +68,7 @@ playing_mpc() {
}
playing_mpris() {
command -v playerctl && [ "$(playerctl status)" = "Playing" ]
command -v playerctl && playerctl --all-players status | grep -q "Playing"
}
photos_processing() {

View File

@@ -37,7 +37,7 @@ sxmo_daemons.sh stop periodic_wakelock_check
# Go to screenoff after 8 seconds of inactivity
if ! [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ]; then
sxmo_daemons.sh start idle_locker sxmo_idle.sh -w \
timeout 8 "sxmo_hook_screenoff.sh"
timeout "${SXMO_LOCK_IDLE_TIME:-8}" "sxmo_hook_screenoff.sh"
fi
wait

View File

@@ -158,13 +158,19 @@ _sxmo_grab_session() {
}
_sxmo_prepare_dirs() {
uid=$(id -u)
gid=$(id -g)
mkdir -p "$XDG_RUNTIME_DIR"
chmod 700 "$XDG_RUNTIME_DIR"
chown "$USER:$USER" "$XDG_RUNTIME_DIR"
chown "$uid:$gid" "$XDG_RUNTIME_DIR"
mkdir -p "$XDG_CACHE_HOME/sxmo/"
chmod 700 "$XDG_CACHE_HOME"
chown "$USER:$USER" "$XDG_CACHE_HOME"
chown "$uid:$gid" "$XDG_CACHE_HOME"
mkdir -p "$XDG_STATE_HOME"
chmod 700 "$XDG_STATE_HOME"
chown "$uid:$gid" "$XDG_STATE_HOME"
}
_sxmo_grab_session

View File

@@ -18,6 +18,8 @@ while true; do
x_raw="$(cat "$FILE_X")"
if [ "$x_raw" -ge "$RIGHT_SIDE_UP" ] && sxmo_rotate.sh isrotated ; then
sxmo_rotate.sh rotnormal
elif [ "$x_raw" -le "$UPSIDE_DOWN" ] && [ "$(sxmo_rotate.sh isrotated)" != "invert" ]; then
sxmo_rotate.sh rotinvert
elif [ "$y_raw" -le "$UPSIDE_DOWN" ] && [ "$(sxmo_rotate.sh isrotated)" != "right" ]; then
sxmo_rotate.sh rotright
elif [ "$y_raw" -ge "$RIGHT_SIDE_UP" ] && [ "$(sxmo_rotate.sh isrotated)" != "left" ]; then

View File

@@ -60,13 +60,13 @@ focused_name="$(
swaymsg -- input type:touch map_to_output "$focused_name"
swaymsg -- input type:tablet_tool map_to_output "$focused_name"
swaymsg -- input "$pwr" xkb_file "$(xdg_data_path sxmo/sway/xkb_mobile_normal_buttons)"
swaymsg -- input "$pwr" xkb_file "$(xdg_data_path sxmo/xkb/xkb_mobile_normal_buttons)"
if ! [ "$vols" = "none" ]; then
for vol in $vols; do
swaymsg -- input "$vol" repeat_delay 200
swaymsg -- input "$vol" repeat_rate 15
swaymsg -- input "$vol" xkb_file "$(xdg_data_path sxmo/sway/xkb_mobile_normal_buttons)"
swaymsg -- input "$vol" xkb_file "$(xdg_data_path sxmo/xkb/xkb_mobile_normal_buttons)"
done
fi

View File

@@ -8,7 +8,7 @@ case "$1" in
exit
esac
case "$(busybox head -n1 "$1")" in
case "$(head -n1 "$1")" in
"#"*)
comment="#"
;;
@@ -23,7 +23,7 @@ case "$(busybox head -n1 "$1")" in
;;
esac
busybox md5sum "$1" | \
busybox cut -d" " -f1 | \
busybox xargs -I{} busybox sed -i "2i$comment configversion: {}" \
md5sum "$1" | \
cut -d" " -f1 | \
xargs -I{} sed -i "2i$comment configversion: {}" \
"$1"