Commit graph

93 commits

Author SHA1 Message Date
Stacy Harper
af856d5bfa
Add x-scheme-handler/tel handler with a dedicated menu
This menu allow the user to

- call
- text
- save

The tel number.
2021-09-18 12:05:11 +02:00
Maarten van Gompel
61451f6292
added a default audiostart hook to force output over main speaker and set a sane default volume
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-09-12 09:32:16 +02:00
Maarten van Gompel
c831d26773 fixed gesture names; a lot of gestures were erronously named corner rather than edge
This causes us to have both a 'bottomleftcorner' and 'leftbottomcorner',
the latter is now 'leftbottomedge' and is interpreted as 'a left swipe
along the bottom edge' while 'bottomleftcorner' is 'diagonal swipe from
the bottom left corner'.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-09-11 01:26:39 -04:00
Stacy Harper
3c3c5f5b45 Hide border on Sway when only one window is present
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-09-04 03:33:58 -04:00
Stacy Harper
4571330df4 Add and setup nclutter-xfixes
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-09-01 18:58:48 +02:00
baroque
5b705dc91b
reduce notification spam in volume/brightness
Added a second parameter to notifications (actually a first, "app-name"), so they can be *grouped* when there is more than one, reducing the clutter on the screen, using the mako config parameter " group-by=app-name "

with proper quotes (i hope), case and cute icon ;)

added "group-by = app-name" directive in mako config

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-08-31 20:45:42 +02:00
Stacy Harper
7f39de55f0
move sway input/output to a dedicated file 2021-08-31 16:42:37 +02:00
Maxim Karasev
85e18743bf
Clean up sway config and add BQ Aquaris X5 support
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-08-31 16:42:36 +02:00
Stacy Harper
f86cc46d03 Add a bemenu control mode to access bemenu control with buttons
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-08-30 22:22:43 +02:00
Maxim Karasev
2f6d84a857
Add sudo permissions needed for modemmanagertoggle
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-08-30 08:11:10 +02:00
Stacy Harper
f3511b149a Remove now unused screen detection for lisgd
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-08-25 12:56:11 +02:00
Stacy Harper
98c7d1f2d4 Add some missing sway keyboard inputs
This is maily for docked mode but those bind are required.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-08-24 22:12:51 +02:00
Sam Bowlby
b65956b136
fix detection of screen dimensions
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-08-23 13:53:28 +02:00
Stacy Harper
8a27933c47 SWMO - SXMO over Wayland
This is a huge patch for Swmo, Sxmo over Sway.

It is Dwm backward compatible so dwm users should not expect regressions.

If you install all dependencies, you then can toggle between Sway and Dwm using a new config entry. It will reboot the phone.

This commit also contains:
    * Make the modemmonitor bullet proof
    * various other smaller fixes

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-08-22 13:23:22 +02:00
Stacy Harper
b1403f983e Allow the inputhandler hook to override locked state inputs actions
The user may want to change completly the buttons actions in normal and
locked mode. This allow this !

Btw, we also provide default inputhandler actions (as example) to help
the user to build their own.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-08-22 13:22:38 +02:00
Stacy Harper
fe519a80b3 Make sxmo tinydm compatible
Install tinydm:

	sudo apk add tinydm tinydm-openrc

To configure SXMO as the used session use :

	sudo tinydm-set-session -f -s /usr/share/xsessions/sxmo.desktop

Also ensure your user id is used in /etc/conf.d/tinydm

	$ whoami | xargs getent passwd
	stacy10000:10000:Linux User,,,:/mnt/sd/home/stacy:/bin/bash

	/etc/conf.d/tinydm
	AUTOLOGIN_UID=10000

Then configure the services:

	sudo rc-update del xdm
	sudo rc-update add tinydm

Then reboot.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-08-15 15:53:45 -07:00
noneofyourbusiness
5ccfeacfac
Update conky and the status bar on wake ups.
Add USR2 signal to unlock hook, remove useless STOP and CONTINUE
Update the bar in the same time.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-08-04 18:36:31 +02:00
Miles Alan
69fe290dfa xinit_template: Don't set SXMO_LOCK_SCREEN_OFF=1 by default
This should be a better default as users of the previous C screenlock
may expect this funcionality to work ootb / this retains prior defaults.
2021-07-30 23:50:32 -04:00
Maarten van Gompel
b3bbf23e90 kill mpv playback in default presuspend hook
This is an attempt to fix prevent audio stuttering problems when
entering/leaving crust

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-07-29 21:58:50 +02:00
Maarten van Gompel
edc48a01d2
ModemMonitor: Periodically check whether the modem is still alive, reset it if not
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 17:28:54 +02:00
Maarten van Gompel
13b29f7139
Added a wifi toggle #290
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 17:03:58 +02:00
Maarten van Gompel
2a89aaa4db
make default discard and mute_ring hooks forward to missed_call using sxmo_hooks.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 16:55:18 +02:00
Maarten van Gompel
66174219bf
screenlock: Moved lock / unlock / screenoff hooks after the existing logic and set empty defaults
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 16:48:12 +02:00
Maarten van Gompel
19453bf4b1
Implement a maximum number of rings in the default hook
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 08:50:43 +02:00
Maarten van Gompel
e30aefc253
re-adding a postwake wrapper script so the hook can be simplified
Changes from v1: This triggers the hook (without the 5 second sleep!) also when the unsuspendreason is modem or rtc,
so the user can always override the behaviour and do what he/she wants.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-25 08:37:07 +02:00
Maarten van Gompel
8cf2d3d561
unlocksim fix
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-07-20 14:37:38 +02:00
Anjandev Momi
ccc6223c1b Revert "add a configurable daemon that warns on low battery"
This reverts commit c7e0e3b656.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-07-15 18:29:35 -04:00
Stacy Harper
99d226929b Prefix one finger gesture with "one"
This make input handling matching more consistent.

Take this example :

You want to bind one finger left gesture to something with all the
distance (short, medium and long) so you now can match *"oneleft" to
match "longoneleft", "mediumoneleft", "oneleft".
Without the "one" you would use *"left" which also match "twoleft" and
this override the "move to another workspace gesture.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-07-10 16:32:43 +02:00
noneofyourbusiness
26d946e225 allow shutting the phone off without password
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-07-10 15:25:04 +02:00
Stacy Harper
dbca3ddd80
Trigger postwake when leaving crust cause of USB-C power
Atm, only the button wake up reason was trigerring postwake. This make
the usb charger to uncrust the phone and leave it in lock or off mode.

Now postwake take an argument which is the wake up reason.

The modem reason should not manage so phone state so we make it explicit
in the default hook.

"usb power" and "button" now make the phone to blink 5 seconds and put
the phone back to crust.
2021-07-07 21:00:42 +02:00
Stacy Harper
44dcd8ced9
Remove close window actions as it causes issues 2021-07-07 20:57:07 +02:00
Stacy Harper
c63ca633b4
Remove unused arg 2021-07-07 20:31:54 +02:00
Stacy Harper
e6ea657634 Cleanup hooks
This add a script to use either the user hook or the default one.

Sometime we checked the user hook or a default code. We move this
default code in a defaut hook.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-29 22:43:16 +02:00
Stacy Harper
0ed27f8538 Handle cron tasks while in crust
mnc goal is to display when will occurs the next cron job.

We drop the "sxmo_screenlock.sh rtc" command and the
SXMO_RTCWAKEINTERVAL variable. We will now only use
"sxmo_screenlock.sh crust" which mean suspend until next cron job
(-2 seconds).

To replicate the old behavior of the blinking phone then returning to
suspension (if needed) we now use a new script.

By example:

*/15 * * * * DISPLAY=:0 sxmo_rtcwake.sh sleep 10

This will trigger a 10s sleep task every 15 minutes (the old default
rtcwake hook).

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-29 22:43:09 +02:00
noneofyourbusiness
c7e0e3b656 add a configurable daemon that warns on low battery
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 23:01:48 +02:00
Stacy Harper
e428d0c4a4 Simplify the termmode detection
As we now rely on sxmo_terminal.sh and the TERMCMD env variable, we then
can simplify things.

In the sxmo dwm context, TERMCMD="st -e" so sxmo_terminal.sh will run
the command in st.

In the ssh context, we dont have TERMCMD so sxmo_terminal.sh will just
run the command

In a tmux context, we can set TERMCMD="tmux split-window" with
set-environment -g TERMCMD "tmux split-window"
so sxmo_terminal.sh will run the command in a splited window.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-21 22:59:20 +02:00
Stacy Harper
469f7cbd13
Fixup inconsistent usage of default country on phone numbers 2021-06-18 10:32:32 +02:00
Stacy Harper
c5c5537873
Do not enforce -e TERMCMD args and fix TERMMODE
Enforcing -e break some possibilities to use TERMCMD that dont use it.

TERMCMD should be setup in xinit. This way, in ssh mode, the value still
is empty. This way, some custom bash or tmux config could use
it, configuring it.
2021-06-09 08:42:51 +02:00
Anjandev Momi
725d89d6d6
Rework the sxmo screenlock 2021-06-06 09:41:36 +02:00
Stacy Harper
13bdc0e415 Remove polkit rules as it is now in pmOs package
https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2197/diffs?commit_id=5886e238babe8fd19428b4e05f89a371ed1ef4f6
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-05-29 22:48:33 +02:00
Clayton Craft
92561f7d7e udev: use more specific rule for creating touchscreen symlink
On the librem 5, this rule caused a symlink from /dev/input/mouse0
(which had the TOUCHSCREEN attrib set in udev... ??) to
/dev/input/touchscreen, when it should have been from something like
/dev/event*. This change causes udev to ignore mouse*, mice* etc in
/dev/input.

Tested on the librem 5.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-23 19:16:37 +02:00
Stacy Harper
f4ee396394 Rework the incoming call pickup/discard behavior
* The sxmo_modemmonitor.sh will now run a new sxmo_modemcall.sh
dedicated menu to Pickup, Hangup or Mute the call. It will not write
notifications anymore.

* We now can mute the ring with the new pickup menu. With the default
hook, this will stop the ringtone like the missed_call would do.

* The sxmo_modemcall.sh now use a new sxmo_proximitylock.sh which
will lock the screen when putting the phone in front of the ear. This
script should be smart enough to work smoothly with a crust context.

To achieve this, the proximity_lock will only disable the initial
lock (the one who want to go back in crust after some seconds) if the
phone moved a little bit and is not in your pocket. So forgetting the
phone in a table or not earing the ring in your bag will not empty the
battery. You'll find the phone in crust with notifications.

* The sxmo_modemcall.sh do not monitor finished calls anymore. We leave
it with hangup or being killed by sxmo_modemmonitor.sh. This simplify
the call script and prevent double deleting mmcli calls. I had to use
pids and wait commands to fix and issue and make the script killeable
by the monitor.

Plus, only the monitor will now delete calls. The call script should be
precise on what happen using cached files.

* Discarded and hanged up calls are two different behavior with
different script (by default use the same linked ones)

* Fixed a bug where sometime ringing was started twice. I think this is
cause by the new checkforincomingcalls in the connected state change. We
now use a file to test if the call already has been managed.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-23 19:16:08 +02:00
Stacy Harper
91fe7fbeab Fix the unreliable modem numbers prefix issues
Sometime, the modem will give 0611924312 as incoming text or
call number instead of +33611924312 (example in france).

This cause two issues cause of format missmatch:

* Notifications sometime come from "Unknown" when we actually know
the contact
* Text/Dial menu entries are duplicated with "Unknown" persons

We try here to fix boths issues with a simple idea. We will fallback
to a default prefix when it is missing (on phone like numbers,
composed of 10 numbers).

This prefix is an environment variable that cause 0 impact if missing.

* sxmo_contacts.sh will fix the recent numbers prefixes with the default
* sxmo_modemmonitor.sh will also fix the prefix with the default one

This should solve missmatch issues as both will use country code format

I only recommend to always store contacts in the prefixed format in the
contacts.tsv file.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-10 13:20:19 +02:00
Stacy Harper
df73a9af1c Simplify and prevent killing existing mpv instances
Instead of the trigger file and killing mpv, we loop the ring
indefinitely until killed. Maybe we should still got a guardrail but I
still never needed it (modemmonitor would trigger missed_call late or
later ?)

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-04-09 23:25:27 +02:00
Maarten van Gompel
6951639886 automatically turn modemmanager on in xinit template 2021-03-31 11:37:49 +02:00
Maarten van Gompel
943199aef8 set SXMO_LOCK_SCREEN_OFF=1 in xinit template 2021-03-31 11:37:39 +02:00
Maarten van Gompel
4dfee1cc8c default hook updatE: vibrate the phone on ringing (once) 2021-03-30 22:55:55 +02:00
Maarten van Gompel
bec7106317 Implement default hooks for ringing and incoming texts, playing audio 2021-03-30 21:02:42 +02:00
Maarten van Gompel
95683bdc0c make notifications not cover the status bar (suggested by ~dinkocar in #220) 2021-03-30 19:11:09 +02:00
Maarten van Gompel
cddec4205d removed the startup tune in the xinit template 2021-03-30 19:05:18 +02:00