Commit Graph

108 Commits

Author SHA1 Message Date
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
66e20f57af fix editorconfig: remove trailing space and use tabs 2023-05-14 00:19:17 -07:00
Stacy Harper
088feda2c8 Cleanup sxmo_timer.sh 2022-12-17 11:25:30 +01:00
hazardchem
faba6af2eb sxmo_timer.sh: added stopwatch function
Added selection for stopwatch in timer

Signed-off-by: hazardchem <pthom44@live.com.au>
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-12-17 11:25:24 +01:00
Stacy Harper
08fe32d492 Shellcheck fixes 2022-12-17 10:34:45 +01:00
Tzafrir Cohen
d79b985804 bashism fixes
Several places where dash behaves differently than bash:
* read in dash has to have a variable.
* use command -v as type is not POSIX

Signed-off-by: Tzafrir Cohen <tzafrir@debian.org>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-12-05 11:46:43 -08:00
Eolien55
fb2f25c13e appscripts/timer: improved sed call and fixed parsing
Sed is called only once

now it interprets `5m37s` as `5m + 37s` -> `5*60s + 37s` -> `5*60 + 37`
before, it was `5m37s` -> `5*60s37s` -> `5*60*137*1`. the problem is
that the script does not insert a `+` between each non-number characters
and numbers. it does now, and will understand combinations of seconds,
minutes and hours.

Note, the script will interpret `5m37s` and `37s5m` exactly the same way

This may not be necessary if the user uses by themselves`+` to separate
diffent units, though I think the current behavior is very misleading.

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-10-05 23:02:56 -04:00
Eolien55
12d378ea92 Respect sfeed configuration in rss script
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-10-02 08:32:27 -05:00
Zach DeCook
96c0846e3e Screenshot: Fix custom directory
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-07-06 13:26:32 -05:00
wentam
88600bedf1 Use XDG_DATA_DIRS rather than hardcode /usr/share
This is more flexible and makes packaging much easier - especially
on distros using non-standard paths like NixOS

This version of the patch has xdg_data_path default to 1 instance,
making usage simpler. The function is also documented a bit more
clearly.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-07-01 10:28:02 +02:00
Zach DeCook
4c5c7eb314 MPV: don't force specific audio output device
This fixes playback of voicemails when using pulse

Signed-off-by: Anjandev Momi <anjan@momi.ca>
2022-06-11 01:11:40 -04:00
Anjandev Momi
1123c0f072 Change license to AGPL-3.0-only 2022-03-15 08:00:00 -04:00
Anjandev Momi
d96297f562 youtube: get ao from mpv.conf
This fixes playback on devices when pulse is set as ao in mpv.conf

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-03-14 13:25:20 +01:00
ArenM
dda8a25e65 Appscript cleanup
* handle exiting menus with escape

* replace if statements with case, where reasonable

* using shell string operations instead of forking

* use sxmo_dmenu_with_kb instead of opening and closing the keyboard

* remove extra options to sxmo_terminal and sxmo_bemenu (some of them
  were causing problems)

Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-27 16:24:27 -06:00
ArenM
455c2283ff More appscript cleanup
This was supposed to be part of the appscript cleanup patch, but I
forgot to rebase it.

NOTE: the first patch might not apply without this one
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2022-02-27 16:24:27 -06:00
Zach DeCook
87485d344b sxmo_rss: Fix icon script sourcing
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-16 21:59:13 +01:00
Zach DeCook
34d0188a1e appscripts: Create list automatically
This will allow other packages to add system-wide appscripts

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-16 21:18:57 +01:00
Zach DeCook
ffcfa6f6a4 icons: Change into a hook
Fixes the icons hook to be where the migration script moved it.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-14 18:18:55 +01:00
Nihal Jere
c309751b33 rename sxmo_vibratepine to sxmo_vibrate
Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-02 20:12:45 +01:00
Peter John Hartman
13927c803b sxmo_files.sh: set SELECTONLY=0
Otherwise, line 108 would fail with [: : integer expression expected

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2022-02-02 19:10:09 +01:00
Stacy Harper
238aa38efc Refact: commons loading
- 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>
2022-01-15 11:31:00 +01:00
Zach DeCook
6274f1f222 shebangs: change to /bin/sh
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>
2021-12-20 14:29:25 +01:00
Stacy Harper
11bd42c0ae Order contact attachments by date by default
This make it easy to open the last receive mms attachment by example.
2021-12-10 17:47:52 +01:00
Stacy Harper
c446e9f23e Refactorise to simplify wm detection
We dont use guesswm and rely on a SXMO_WM env variable. We now use
guesswm for non wm action (from ssh, console, rtc wakes, etc). It will
try to setup needed variables.

This way, we avoid to run sxmo_wm.sh and to check variables everytime.

This allow the user to manage sxmo_screenlock.sh from ssh and to run a
desktop software with "sxmo_wm.sh exec foot" by example.

We remove the "ssh" wm cause it does not really make sense anyway.

The sxmo_rtcwake.sh dont try to setup variables anymore cause the user
must use "sxmo_wm.sh exec" if they want to start a destkop software
anyway.

We remove the "xorg" check everywhere cause that make no sense. We
keep the xorg prefixed methods for common xorgs cases.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-11-23 15:26:35 -05:00
Stacy Harper
afe6abef8e MMS Support
In sxmo_modemmonitor.sh checkfornewtexts() we should skip MMS and SMS WAPs,
which will be SMS messages with text of "--" or no TEXTDATA at all.   Hence,
there are a couple small checks in checkfornewtexts() to do that.

As well, there is a further dbus-monitor call in sxmo_modemmonitor.sh that
monitors org.ofono.mms.Service for 'MessageAdded' to process a new MMS messages.

Most of the action happens in sxmo_modemmonitor.sh processmms().

An MMS message might be either a message with an attachment to one recipient
OR a message with multiple recipients ('Group Chat') and no attachments (or
some attachments).

Attachments get placed in ~/.local/share/sxmo/modem/$PHONENUMBER/attachments/.
They are named $PAYLOAD.jpeg, $PAYLOAD.mp3, etc., where $PAYLOAD is the unique
id that mmsd-tng assigns the mms and stores in ~/.mms/modemanager/.  (Note that
since the PAYLOAD file remains on the filesystem, we could just re-extract the
attachments whenever we want them.  This might be an improvement down the road.)

If there are multiple recipients, we will make a "unique" new phone number out
of *all* the numbers involved (to and from) for each group chat.  For instance,
if you and Bob and Suzie are on a group chat you will have a number like
+15551234567+16661234567+17771234567 in ~/.local/share/sxmo/modem. You can
treat this like a normal number (i.e., give it a contact name, reply to it,
etc.)

Once an MMS message has arrived, one notification will be made like normal.

If there are attachments, clicking on the notification will open them all using
sxmo_open.sh.

You can also go to the message (via Texts) and click View Attachments to run
sxmo_files.sh on the attachments directory.

You can also Add an attachment when you compose a message.  There is a basic
ability to Delete attachments too.

I've also reversed the contact lists so the CONTACTNAME is on the left and PHONENUMBER on
the right, otherwise with large phonenumbers it was hard to see who the CONTACTNAME is.

=== MMSD-TNG CONFIGURATION TIPS AND TRIPS ===

sxmo's mms requires mmsd-tng that includes the mmsctl program.  Right now, this is
in the latest git head.  See https://gitlab.com/kop316/mmsd/-/merge_requests/52.
To compile with this on edit meson_options.txt and set mmsctl to true.  Then build as normal
via mmsd-tng's README.  (We can also just do: gcc -o mmsctl mmsctl.c -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1 -ljson-c)

sxmo's mms does not require any configuration on top of what is needed to get mmsd-tng to work.
However, mmsd-tng can be a bit of a tricky thing to confugre, so here are some tips:

1. mmsd-tng includes example configurations in its README. A helpful list is here:
https://gitlab.gnome.org/GNOME/mobile-broadband-provider-info

Here is an example (works with "Mint Mobile" which uses T-Mobile):

~/.mms/modemmanager/mms

[Modem Manager]
CarrierMMSC=http://wholesale.mmsmvno.com/mms/wapenc
MMS_APN=Ultra
CarrierMMSProxy=NULL
DefaultModemNumber=NULL
AutoProcessOnConnection=true
AutoProcessSMSWAP=true

[Settings]
UseDeliveryReports=false
AutoCreateSMIL=false
ForceCAres=false
TotalMaxAttachmentSize=1100000
MaxAttachments=25

2. mmsd-tng must use the *modem's* dns to resolve mms files.  Since
NetworkManager rewrites /etc/resolv.conf with both wifi and modem active, I
found it easiest to have a static /etc/resolv.conf and to set
/etc/NetworkManager/NetworkManager.conf dns=none.
2021-10-31 10:57:13 +01:00
Stacy Harper
10722874ac Typo, remove leading line 2021-10-21 11:58:32 +02:00
Stacy Harper
b22faa8300 Cleanup sxmo_screenshot 2021-10-21 11:54:46 +02:00
Zach DeCook
576550451d Screenshot: Copy path to clipboard in wayland, rework script for better error detection
also, ostensibly fix clipboard copying for x

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-10-21 11:54:45 +02:00
Anjandev Momi
23391c1e3e Add screenshot support in wayland (sway)
User must have grim and slurp installed.
We should add those programs to the swmo ui metapackage

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-10-20 17:58:00 +02:00
Stacy Harper
9bd3f31ba9 Cleanup sxmo_file.sh
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-09-19 22:28:53 +02:00
Stacy Harper
f0ca704812 sxmo file only should open the selected file
Opening all following files only is meaningfull for pictures or videos
but crazy when openning pdfs with zathura by example.

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-09-19 22:28:48 +02:00
Maarten van Gompel
a9ac024fe9 use --index instead of -idx for compatibility with bemenu, requires similar patch for dmenu 2021-08-24 23:11:58 +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
Miles Alan
f63852a801 scripts/appscripts/sxmo_youtube.sh: Switch back to using codemadness-frontends
We originally switched off codemadness-frontends / idiotbox because it was
no longer functional. Nowadays it works again and is substantially faster
then ytdl.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-13 21:06:37 +02:00
noneofyourbusiness
823ad95477 add scrot script & add scrot to appmenu
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-06 22:23:15 +02:00
Maarten van Gompel
198462764f small patch to reconcile the last two commits 2021-06-04 21:54:35 +02:00
noneofyourbusiness
1121e29b3e replace "st -e" with sxmo_terminal.sh and edit it to use st -e instead of st
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-04 21:50:59 +02:00
Anjandev Momi
358d79894e sxmo_files: add "open in st" for current directory
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-06-04 21:50:37 +02:00
Stacy Harper
18892aa181 Fix default dir to HOME
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2021-05-23 20:05:10 +00:00
Stacy Harper
457aa3e1b0 Open the selected file then the nexts preserving the order
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-05-15 23:54:39 +02:00
Stacy Harper
f37de20a0d Make sxmo_file killeable with gesture
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-05-15 23:54:39 +02:00
Maarten van Gompel
c043c50175 failed attempt to fix shellcheck broke script, reverting 2021-03-22 20:06:48 +01:00
Maarten van Gompel
5da2f78665 fixed shellcheck after latest patch 2021-03-17 22:14:23 +01:00
Stacy Harper
0221dd333d allow sxmo_files to reload file list
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-03-17 22:01:30 +01:00
Stacy Harper
776728f63c Add a sort by submenu
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
2021-03-17 21:07:21 +01:00
Maarten van Gompel
2f62b7c446 Moved checkmark to icons 2021-03-16 22:01:41 +01:00
Maarten van Gompel
4eb914265d Added sxmo_keyboard script that acts as an intermediary to opening and closing the keyboard 2021-03-15 13:51:48 +01:00
Maarten van Gompel
295af30993 various scripts were not sourcing the common include script yet (noted by mrrabbit1155) 2021-02-21 15:14:16 +01:00
Maarten van Gompel
24905884ee Removed explicit font from most dmenu calls, dmenu font is read from Xresources now and kept as uniform as possible 2021-02-01 18:32:32 +01:00
Reed Wade
08b95c6182 sxmo_files now respect user desktop configurations
We use our own implementation of xdg-open that replace the hardcoded
script used in sxmo_files.

We add and will maintain some desktop entries to offer a suckless
experience by default.

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
2020-11-28 02:39:25 -05:00