Switch off suspend when using the L5 as hotspot

I’m in Cuba and use my L5 with a local SIM and LTE datamobile as AP to Internet for my laptop. Works all fine. What I do miss is switch off the suspend mode (set to 2 minutes) when hotspot mode is on.

I’d know how to do this with gsettings from command line, the missing “link” is to run a shell script when hotspot is activated and vice versa. Any ideas?

4 Likes

Purism really needs to get on just making this a feature

4 Likes

I’d look into NetworkManager…

1 Like

Thanks for the hints, the NM has hook scripts and I have already sorted out how to do something on action up or down for the CONNECTION_ID HotSpot. Last problems are:

  • the gsettings commands like
$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout
900

$ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 120

$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout
120

do fine, when run from command line; when run from the hook script, not;

  • The values to be configured from the system dialog are stored somewhere else and not the same as from gsettings commands; this starts already with the fact that the system dialog has values in minutes while the gsettings allow seconds

  • the values set with gsettings seems to overule the values from the system dialog.

Any ideas?

2 Likes

Probably the hooks are run as root. To use gsetttings it must be run in the environment of the user running the g (in this case phoc/phosh).
You could do something like this: ~chrichri/librem5-bm818-watchmodem (main): script/librem5-recover-xhci-usb.sh - sourcehut git
To get what I needed I originally used this project: GitHub - Ventto/xpub: POSIX Shell script to get user's display environment variables of any TTY from anywhere. .

Maybe what you really want is to have the phone not suspend for a timeout after the last client disconnected.
Anyway, changing the configuration of the phone is in my opinion not the right way to go about it. I’d recommend something that doesn’t leave no traces after a reboot. For a script that could be something like gnome-session-inhibit.

1 Like

Seems fixed on: phosh 0.35.0

Untested.
Released January 2024

  • Fix suspend-inhibitor when hotspot is on

Purism Free Software & Community.

3 Likes

Yes, the rel notes in Phosh 0.35.0 · Phosh states this. And 0.35.0 was released in January 2024. On my (uptodate) L5 I have version 0.32.0-1pureos1~byz1. Why mine is so old?

My workaround is always after tethering, SSH into my L5. But sometimes I forget to do so.

3 Likes

I think crimson with unofficial backports should have it or in dawn, both you will need to wait. Right now it works for me with debian trixie.

For tethering over cable, I use the coffee mode with phosh dropdown since it is not automatic.

Update: I meant mobian trixie, but for phosh versions both debian and mobian is same.

mobian is just a few patched packages on top of mobian, the most important change is linux kernel patches - once they are mainlined, we should be able to boot debian directly.

2 Likes

I confused on what is debian trixie and what is mobian?

Edit:

Debian Trixie is Mobian? or Mobian is Debian Trixie?

Mobian or Debian develop Phosh or Plasma?

:face_with_spiral_eyes:

1 Like

Trixie is the current debian stable release.

Mobian is a distribution of debian that has been customized for mobile devices. A goal of mobian is to obsolete itself by contributing to upstream.

2 Likes

Well, if I see this correctly, Mobian currently carries 401(!) downstream patches that were put on top of the 6.6 kernel:

Not all of them seem quite required and some apply to the devkit etc. but still a lot. In an ideal world, all these patches would have been squashed into fewer patches and merged upstream so that the librem5 would be supported by future mainline kernels without the need for patches.

Also, this large number of patches makes it hard to move to newer kernels as presumably (I didn’t try) not all of them would apply on the current lts-kernel in Debian 13 (6.12 series).

2 Likes

I’m on Crimson and I have the impression that the my L5, on which suspend when on battery is enabled (sometimes or always?) suspends, even when the Wi-Fi hotspot is on. Do you see similar behavior? How can I check if suspend is inhibited?

Crimson has phosh 0.34.0.

I may look into backporting the fix when doing something with the phosh package the next time.

3 Likes
gnome-session-inhibit -l

We implemented support in 0.34 but that relied on a systemd feature that was only added way later so we switched to a gnome-session inhibitor in 0.35. Once Purism updates to at least 0.35 or backports that fix it will work in PureOS too.

1 Like

When I SSH into my L5 it says:

$ ssh purism@l5new
Linux pureos 6.6.0-1-librem5 #2 SMP PREEMPT 6.6.110pureos1~byz1 2025-10-17 15:43:49 UTC aarch64
Last login: Tue Feb  3 09:08:55 2026 from 192.168.178.24
inhibiting suspend ...
purism@pureos:~$ tail .bashrc
# https://wiki.mobian.org/doku.php?id=tweaks#prevent-sleep-in-an-ssh-session
#
if [[ -n $SSH_CONNECTION ]]; then
  echo inhibiting suspend ...
  sh -c "gnome-session-inhibit --inhibit suspend --reason \"SSH connection active\" --inhibit-only > /dev/null 2>&1 &"
fi
purism@pureos:~$

But I do not understand the output of gnome-session-inhibit -l

purism@pureos:~$ gnome-session-inhibit -l
unknown: SSH connection active (suspend)
1 Like

You have inhibitor preventing suspend that was set without an app-id (thus unknown).

It shows you exactly what you provided it with.

Or perhaps the question should be …

What specifically is confusing you? Can you elaborate on this?

I did not understand the word “unknown” but later a
gnome-session-inhibit -h
made it clear. Sorry for the noise.

3 Likes