Commit Graph

1868 Commits

Author SHA1 Message Date
Colin 0b3ce90e74 sxmo_rotate: don't restart lisgd on sway
AFAICT we restart lisgd because it learns the orientation via its
`-o <orientation>` CLI argument. but we only pass that flag on dwm/x11,
not sway. restarting it on sway is wasteful, and potentially racy (i'm
able to get multiple lisgd's running just by enabling autorotate and
flipping the phone rapidly), so don't do that.
2023-07-16 12:45:54 +00:00
Colin bf00570117 sxmo_wmmenu: respect SXMO_WORKSPACE_WRAPPING
sxmo_wm.sh uses the `SXMO_WORKSPACE_WRAPPING` variable to control
relative movements. for example, set this to "5" and then the "Next
Workspace" option in the switch menu will cycle WS 1 -> 2 ... -> 5 -> 1.
same for one- and two-finger left/right swipe to switch/move workspaces.

however, absolute movements (via the move menu) only allowed moving to
WS 1-4. a user with non-default `SXMO_WORKSPACE_WRAPPING` could move a
window from WS 5 to WS 4 with this menu, but not from WS 4 back to WS 5.
this patch brings consistency by using `SXMO_WORKSPACE_WRAPPING`
anywhere we would otherwise assume the number of possible workspaces.
2023-07-15 21:36:58 +00:00
Colin 0cffdeafab sxmo_hook_rotate.sh: update docs for CLI args
see `swayrotinvert()` in sxmo_rotate.sh, which calls this hook with "invert"
2023-07-12 00:30:26 +00:00
Colin e2d0cedd21 sxmo_hook_apps: add a few 2023-07-09 22:13:14 +00:00
Colin 021462a4a5 sxmo_autorotate: allow all four orientations 2023-07-09 07:25:31 +00:00
Colin 6027263770 sxmo_swayinitconf: fix xkb paths
the xkb files were moved in 6a529751 but not all references were updated
2023-07-09 07:25:31 +00:00
Colin 2e8504c5e0 NOT FOR UPSTREAM: sxmo_hook_start: don't start audio daemons
these are managed by the OS
2023-07-09 07:25:31 +00:00
Colin c2cf64e7ca NOT FOR UPSTREAM: remove explicit busybox calls 2023-07-09 07:25:31 +00:00
Willow Barraco 2c0c56dfca Fix incoming sms encoding issue
Some french char, and also emojies was rendered as "\324\2343" chars.

This has been introduced with d27f7e1, when the printf %b became %s,
while moving it to the new sxmo_hook_smslog.sh.

Reverting this fix the problem.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-07-06 20:07:42 -07:00
Colin 835cece3da
sxmo_hook_block_suspend: don't assume there's only one MPRIS player
sxmo incorrectly suspends when:
- the user has two MPRIS applications active (e.g. vlc + mpd), and
- one of these is stopped while the other is still playing

this is because `playerctl` by default operates on "the first available
player" (quoted from its manpage). from the perspective of sxmo though,
that "first player" is arbitrary: we should query the status of *all*
players and block suspend if any of them are active.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-07-06 12:20:00 +02:00
Colin f86ec92ac5
sxmo_hook_lock: allow configuration of auto-screenoff timeout
this naming mirrors SXMO_UNLOCK_IDLE_TIME introduced in 70be22c9.
it's nice to let this be tunable, both as a matter of user preference
and to leverage when debugging pathological resume behavior.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-07-06 12:19:17 +02:00
Colin d1787481a2 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.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-07-01 21:54:30 -07:00
Colin 1a15c8dd11 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.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-07-01 21:54:29 -07:00
Willow Barraco 8b10c99a09 sxmo_wm.sh: fix dpms switch when outputs are partially turned off
In a situation of one output was already turned off manualy by the user,
the script was not turning off other outputs.

Reversing this check produce a more consistent behavior.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-07-01 21:23:15 -07:00
Martin 8f16045a20 added deviceprofile for fairphone 4
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-06-18 19:23:05 -07:00
hazardchem bb0c5578b1
sxmo_terminal.sh: Add alacritty as option
Signed-off-by: hazardchem <pthom44@live.com.au>
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-06-05 13:41:00 +02:00
Raymond Hackley dcde1d9d04
Add device profile for Samsung devices
Add device profile for the following Samsung devices:
- Samsung Galaxy E7 (samsung,e7)
- Samsung Galaxy Grand Max (samsung,grandmax)
- Samsung Galaxy J5 2015 and 2016 (samsung,j5(x))

v2: Add missing scripts/deviceprofiles/sxmo_deviceprofile_samsung,*.sh
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-06-05 13:41:00 +02:00
Anjandev Momi 979815a5ce
sxmo_modem.sh: retry if failed to delete sms
On sdm845 devices, I would get the same text multiple times. Even
though, the person sending the text only sent it once.

I ran the sxmo modemmonitor daemon manually and got the following
log:

```
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13225" (uid=10000 pid=24991 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13227" (uid=10000 pid=24994 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13226" (uid=10000 pid=24999 comm="dbus-monitor --system interface='org.freedesktop.D") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
Failed to open connection to session bus: Failed to connect to socket /tmp/dbus-QIILCAmZIu: No such file or directory
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "Rejected send message, 1 matched rules; type="method_call", sender=":1.13228" (uid=10000 pid=25007 comm="dbus-monitor --system interface='org.freedesktop.M") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.
error: couldn't delete SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't delete 1 parts from this SMS'
/home/user/.config/sxmo/hooks/sxmo_hook_sms.sh: line 20: go-sendxmpp: not found
successfully deleted SMS from modem
/home/user/.config/sxmo/hooks/sxmo_hook_sms.sh: line 20: go-sendxmpp: not found
```

The important line is:

```
error: couldn't delete SMS: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't delete 1 parts from this SMS'
```

After applying this patch, I only recieve texts once. I dont know why deleting
text command fails the first time. Moreover, this patch fixes the double
text issue on sdm845 devices.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-06-05 13:41:00 +02:00
ArenM 7ea019e402
Manual fixups for nerd fonts 3.0
* Make icon_prn a nerd-font icons. It was using a font awesome code
  point, which we don't install with sxmo.
* Fix phone locked and laptop icons that weren't automatically updated
* Fix brightness icon in legacy nerd-fonts range and move it to
  sxmo_hook_icons from sxmo_brightness
* Use standard Unicode arrows instead of nerd-fonts ones
* Use icon variables for arrows in sxmo_wmmenu.sh
* Add variable for audio icon & use in sxmo_audio.sh
* Remove no stray break space from sxmo_contactmenu
* Remove up arrow character from reddit script
* use only icon variables in modemtext
* Update icons breakpoints

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-05-29 19:58:29 +02:00
Anjandev Momi 567331ab0b sxmo_hook_apps.sh: add geary 2023-05-29 02:01:44 -04:00
René Kliment 8691177ba5 add initial support for samsung,n8010
This makes the power, volume down & volume up buttons work in SXMO
on my Samsung Galaxy Note 10.1 (samsung-p4note), the N8010 variant.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-05-21 17:47:59 -07:00
Anjandev Momi 66e20f57af fix editorconfig: remove trailing space and use tabs 2023-05-14 00:19:17 -07:00
ArenM 7f921ae30f Fix editorconfig configuration file
`ec` was previously silently ignoring these because the format of the
config file was broken.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-05-14 00:10:59 -07:00
Willow Barraco cbf794c996
BEMENU_OPTS: add background color 2023-05-12 08:42:46 +02:00
Willow Barraco e26825b803
BEMENU_OPTS: support fixed height and borders 2023-05-12 08:42:45 +02:00
Willow Barraco dac8842c97
BEMENU_OPTS: use name args, re-order, default lines 16 2023-05-12 08:42:45 +02:00
Willow Barraco 3338bec056
Increase dmenu line so that appmenu is complete 2023-05-12 08:42:44 +02:00
hazardchem ed62f3183b sxmo_hook_contextment.sh: Add menu options for Alacritty
Signed-off-by: hazardchem <pthom44@live.com.au>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
Zach DeCook 237fc4e370 docs: Document sxmo_hookmenu.sh as simpler way of editing hooks.
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
ArenM 01219deadf Fix broken printf statements in modemtext
Gnu printf interprets these to be arguments instead of a format string
which breaks sending mms.

Also ATTACHMENTS_ARG was being overwritten make_attachments_arg causing
messages to not have the description included, only the attachment.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
ArenM b2c3d97760 Don't kill tailtextlog when changing recipients
The lsof / grep call is broken and causes the script to crash when
adding or removing a recipient.

Lsof also doesn't have a stable output format, and the format is
different between the busybox and gnu versions, so we shouldn't be
trying to parse the output of it.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-05-08 04:52:56 -05:00
Willow Barraco f5dd68bc75
Reset sxmo_run_periodically.sh wait first feature 2023-04-28 11:57:53 +02:00
ArenM 2691b8cca6
Refactor presuspend checks to run infrequently
autosuspend calls the presuspend check when the kernel locks are clear,
and it hasn't been called recently. If we always call it, there's a risk
that running all checks could take too long and we'll fail to suspend
often.

Successfully exiting means that there is nothing going on, so the system is
free to suspend within a reasonable timeframe (something like < 10 seconds).

All the checks currently use the (default) delay wait mechanism, but I
would like to try to write others. For example `playerctl -F` could be
used when playerctl is blocking suspend. Unfortunately managing spawned
jobs and race conditions is harder than it seems at first glance.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-04-28 11:39:32 +02:00
ArenM ce6514d490 check SXMO_WM instead of tinydm session when logging out
This could break if someone decides not to use tinydm, or uses
tinyd-set-session instead of togglewm.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-04-23 19:29:39 -07:00
Willow Barraco 4da4bb9b1e Display multiple power status bar icons again
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-04-23 19:25:53 -07:00
Jan Wagemakers 3b771cf697 add device profile for shiftphone shift6mq (shift,axolotl)
This device profile makes the power and volume keys work on my shiftphone shift6mq.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2023-04-23 18:57:42 -07:00
Peter John Hartman 6d4565eec3 documentation 2023-04-04 12:32:37 -05:00
Peter John Hartman e8ddbc8aac major revision of sxmo(7) manpage
This revision changes things to refer to shell script for hooks not
manpages. I think manpages will just introduce problems. Instead, the
proposal is to have each hook include its own documentation in comments
at the start of it, and refer the viewer back to the section in the
sxmo(7) manpage where that hook is discussed.

This is unfinished but pushing it.

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-04-04 10:55:31 -05:00
Peter John Hartman 7965c0c2e0 Rename $OS to $SXMO_OS. 2023-04-04 10:55:18 -05:00
Peter John Hartman 2f2a4b21de
initial sxmo(7) man page
This is basically a conversion of USERGUIDE.md. Pushing this now for
comment on the structure.  The idea is to have each of our hooks as
its own man page (e.g., sxmo_hook_sms(1) and so on). And then we'd
also have "bigger" scripts have their own man pages, e.g.,
sxmo_files(1), sxmo_rtcwake(1), sxmo_notifications(1).

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-04-03 10:25:48 +02:00
Peter John Hartman cd394d3875 Previously sms messages were not guaranteed to be formatted with the
country code if the carrier didn't provide it. This forces it to use the
DEFAULT_COUNTRY variable if set.

(Thanks to Kyle Eveleth.)
2023-04-02 23:05:01 -05:00
ArenM f630b2bbdb
sxmo_status.sh add locking
Watch was spitting out no such file or directory errors, that I think
were caused by a race between updating the status bar, and removing
items.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-31 19:29:15 +02:00
Willow Barraco 75cf104db3
sxmo_run_periodically.sh avoid spaming kill errors 2023-03-30 17:40:26 +02:00
Willow Barraco ea27c8d785
Avoid crazy edge case if the first wake lock checker is delayed 2023-03-30 17:40:26 +02:00
Willow Barraco 08f7320205
Avoid wakelock expiration if the check take much time
Never happend before but it is definitely possible that the 30s duration
could expire if the following trigger take longer than 20s. By example
in case of network issue.

The goal of this default duration is to avoid stucked wake
locks, even if this could theorically not happen anyway. So let's use a
big value to avoid causing troubles.
2023-03-30 17:24:00 +02:00
Willow Barraco 75e7c33209
Fix sxmo auto suspend when mpv is playing
A mpv instance is a inhibit idle for the WM. It means that we
should not rely on sxmo_idle.sh to start and stop the periodic wake lock
checker.

Instead we should just periodically run them.
2023-03-30 17:22:44 +02:00
Willow Barraco c888c90301
sxmo_hook_tailtextlog: use common colors
Dunno why we used 033 and 245, I'd prefer to stick to basic green and orange
2023-03-29 21:04:21 +02:00
Willow Barraco 856905c7ae
Add a sxmo_brun.sh to run binaries 2023-03-29 21:04:18 +02:00
Willow Barraco 2b1dde63ae Manage and migrate user Xresources
This file was not bumped on new version. This can cause issue, by
example with our recent font change.

Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-03-29 09:24:44 -05:00
Peter John Hartman 4d9e408bae
statusbar: change state icons
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
2023-03-29 15:06:14 +02:00