Oops, found a small bug where it didn't update statusbar if you clicked
on the message. So this one should be good to go.
In re this:
377744c95b
There were two problems with that patch:
1. The check for SXMO_NO_LED never worked so every device was getting
it.
2. The change to notificationwrite broke notificationwrite so no popups
were happening.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
On some devices (ie. poco f1), we do not have LED support. On devices
without LED support, lets show the number of notifications in the status
bar. Otherwise, it's easy for the user to miss a notification.
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
The issue was crazy :
- The phone is in crust
- Your modem wake the device cause of an incomming call
- Our modem monitor script detect this incoming call
-> We launch the pickup menu
-> it start the proximity locker
-> if no proximity, it unlock the device
=> power on the screen, enable touch
-> We write a notification
-> if in "screenoff" mode, we "lock"
=> power on the screen, disable touch
Those two => occurs at the exact same time so we fall into an
inconsistent state.
To fix the issue, we move the "screen on the device on sms to see the
notification" behavior in the "sms" hook.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
Some devices need more flexible states. Wart is working on the
Pinenote and in this device, a locked and off mode looks useless and
wrong. We have to be able to offer more diversity with our states.
We was determining the current state based on some input device state.
Are they enabled/disabled ? This brings lot of constraints :
- We cannot have abstract states. That would be usefull to have
dedicated keybinds at some points. We could have very dedicated
workflows.
- We have to maintain complex code to checks tons of different input
devices. Pinenote brings a touchscreen but also a stylus. We have to
make crazy assomptions to determine we are in a "locked" state.
With recent patches from wart, lot of code already has been moved to
hooks. The hooks "unlock", "lock", "screenoff" got everything to enable
and disable input and output devices. The user then can adapt it to
their need.
We will keep our 3 different state with those hooks. We will also keep
some of the code remaining from sxmo_screenlock.sh to sxmo_suspend.sh.
Calling sxmo_suspend.sh place the device in suspension. This is not a
state, this is a time travel.
We now store the current state in a file SXMO_STATE. Checking the
current state is way faster and it really is perceptible while using the
phone.
OK! This is the one! LOL sorry for spam.
The reason we never noticed this is that make install won't remove 'old'
files like sxmo_setled.sh.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
- Move sxmo icons in sxmo_icons.sh
This script should be loaded when icons are needed
- Move init env variable setups in a /etc/profile.d/sxmo_init.sh
This script is loaded by tinydm and for ssh/tty logins.
The logged in user can re-trigger check_sxmo_wm if they toggle wm.
- sxmo_commons.sh now only load aliases. It can be loaded by scripts to
ensure busybox compatibility
- moved some parts of ~/.config/sxmo/xinit to ~/.config/sxmo/profile
This file also is loaded just before starting sway. It goal is to setup
env variables dedicated to sxmo
~/.config/sxmo/xinit only goal is now to trigger some dwm dedicated
things (as ~/.config/sxmo/sway can start exec commands to)
To recap, loads orders are :
tinydm:
/etc/profile.d/* # do not set SXMO_WM
~/.profile
sxmo_winit.sh:
~/.config/sxmo/profile
sxmo_xinit.sh:
~/.config/sxmo/profile
~/.config/sxmo/xinit # to start sxmo_hooks.sh
ssh/tty:
/etc/profile.d/* # will set SXMO_WM
~/.profile
- unify sxmo_winit.sh and sxmo_init.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Add a sxmo_daemons to manage all sxmo daemons
$ sxmo_daemons.sh start mmsd mmsdtng
$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
$ sxmo_daemons.sh start sleepy sleep 2
$ sxmo_daemons.sh start network_monitor sxmo_networkmonitor.sh
-> This will stop the old daemon and start a new one
$ sxmo_daemons.sh running network_monitor
network_monitor is still running
$ echo $?
0
$ sxmo_daemons.sh running unknown
unknown is not running
$ echo $?
1
$ sxmo_daemons.sh running sleepy
sleepy is not running anymore
$ echo $?
2
$ sxmo_daemons.sh running network_monitor -q && echo "tada !"
tada !
$ sxmo_daemons.sh stop network_monitor
$ sxmo_daemons.sh stop all # to stop every managed daemons
We can now start, stop and check daemons status with ease. When
dwm/sway shutdown, we stop all daemons. Restarting or toggleing window
manager cannot leave any dangling daemons anymore.
As you can see, all daemons now start from the start hook. We gave the
full power on the user to disable or add daemons.
This patch is painfull cause I had to make sure every daemons behave
correctly and shutdown gracefully when killed (which was definitely not
the case !).
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This replace :
63af8077 notification: fix stuck 'green' led
For some reason, the notifywait triggered by selfs rm trigger after the
file really is removed. This tend to happen if multiple notify watch
target the same file (duplicated notifications by example).
To solve this, we enforce a syncled after removing the file.
Any sane linux system will have a posix compliant shell at /bin/sh
This change will allow us to better detect running scripts using pgrep.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Problem: If you clicked Clear Notifications the inotifywait filename
would linger. This should fix that There likely are more clever ways
to accomplish this than what I propose in this patch, but it works for
me (tm).
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
I'm not quite sure why the 2>/dev/null is needed, but otherwise
sway.log would include things like:
tr: write error: Broken pipe
tr: write error
Maybe there is a more elegant solution?
Signed-off-by: Stacy Harper <contact@stacyharper.net>
I move the syncled after handling the notification cause it can be
instandly dropped. Plus I simplify this method to not enforce green 0
but only if no notification is present.
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>
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>
For some reason, some notifications get doubled (probably cause of
a modemmonitor issue). Those doubled notifications cant be used with the
current notificationsmenu cause the two entry matches the picked text.
This make the first one to be picked.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Breaking change. Make sure you send an email to the mailing list
telling users to move their
$XDG_CONFIG_HOME/{modem,notifications} files/folders to
$XDG_DATA_HOME
Signed-off-by: Anjandev Momi <anjan@momi.ca>
If a notification body include a double whitespace, the PICKEDNOTIFFILE
computation fail to match cause we striped them when building the dmenu
choices.
To give an example, try to write this notification as
$ sxmo_notificationwrite.sh "random" \
"st -e tail -n9999 -f \"$HOME/.config/sxmo/xinit\"" \
"$HOME/.config/sxmo/xinit" \
"this body is broken"
This patch fix this bug.
(Maintainer note: I changed the awk invocation to use tr, as suggested
by anjan)
Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>