Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 29,476
» Latest member: alain
» Forum threads: 16,197
» Forum posts: 116,882
Full Statistics
|
|
|
Hooks and userscripts: POST 'EM! |
Posted by: MungFuSensei - 01-27-2021, 09:38 PM - Forum: Sxmo on PinePhone
- No Replies
|
 |
Hook-seller! I need your STRONGEST hooks and userscripts!
I'll start.
Surf gesture so that back and enter go back and forward in history.
Code: #!/bin/sh
# $HOME/.config/sxmo/hooks/gesture
case $1 in
"surf")
if [ $2 = "back" ]; then
xdotool key ctrl+h & exit 0
elif [ $2 = "enter" ]; then
xdotool key ctrl+l & exit 0
else
exit 1
fi
;;
*) exit 1
esac
Ring hook that checks if the number is a contact. If so, it will ring, if not, it won't! This cuts down on being annoyed by robo-callers. It also checks if the file $HOME/.config/sxmo/silent exists. If so, it won't ring. I stole the main bits of the ring/pickup scripts from someone here (if it's you, sound off and thanks!) but added the contact/silent checking.
Code: #!/usr/bin/env sh
# $HOME/.config/sxmo/hooks/ring
NUMBER="$1"
CONTACT=$(sxmo_contacts.sh --all |
grep "$NUMBER"
)
SILENT=$HOME/.config/sxmo/silent
incallmonitor() {
CALLRINGING=$(mmcli -m "$(modem_n)" --voice-list-calls)
echo $CALLRINGING
if [[ "$CALLRINGING" == "No calls were found" ]]; then
exit 1
fi
}
modem_n() {
MODEMS="$(mmcli -L)"
echo "$MODEMS" | grep -qoE 'Modem\/([0-9]+)' || finish "Couldn't find modem - is your modem enabled?"
echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}
if [ -n "$CONTACT" ]; then
sxmo_audioout.sh Speaker
amixer sset 'Line Out' 100%
if [ ! -f $SILENT ]; then
mpv --no-resume-playback /home/mo/Music/char.opus
fi
while true; do
sxmo_vibratepine 1000
notify-send $1
incallmonitor "$1"
done
else
while true; do
notify-send $1
incallmonitor "$1"
done
fi
Code: #!/bin/sh
# $HOME/.config/sxmo/hooks/pickup
ID=$(ps -ef|grep ring|grep -v grep|perl -ne '$_=~ m/^ *(.*) mo.*/;print $1')
kill -9 $ID
pkill mpv
sxmo_audioout.sh
Code: #!/usr/bin/env sh
# $HOME/.config/sxmo/userscripts/silent
SILENT=$HOME/.config/sxmo/silent
if [ -e $SILENT ]; then
rm $SILENT && notify-send "Not Silent"
else
touch $SILENT && notify-send "Silent"
fi
I'm not the greatest shell scripter, but with just a little bit here and there, sxmo gets comfier and comfier. It is now "legs go numb on the toilet while looking at memes on the pinephone" worthy. I'm also looking for some apps hook examples if you got 'em! I can't seem to make mine work without breaking something.
|
|
|
My solution: convenient and reliable alarms |
Posted by: derbaertigefrytz - 01-27-2021, 04:19 PM - Forum: Mobian on PinePhone
- Replies (4)
|
 |
Hello everybody.
Let me know, what you tink about this.
Alarms that are set in the Clocks App of (at least) Mobian are, as far as I can see, actually not reliable.
They do not go off, if the phone is in stand by mode for some time.
Sometimes they go off, when I wake up the phone, sometimes, when I unlock it, and sometimes they do not at all.
My first approach was to use a cronjob, that wakes the phone up, 1 minute before it is time for the alarm. Any (!) command executed by cron did the job. I used "ls".
This worked well and I used this solution for several days, until I decided, that the standard alarm tone is crap. And even worse, it will last precious seconds to find my glasses, unlock the phone, open the header and stop it.
No, I wake up with my favorit music, the phone is already unlocked and I am able to quit (if I wish) without using my glasses.
Here is, how it works.
You need to install cron and mplayer.
You create a cronjob that (1) unlocks your device and (2) starts mplayer in a kingscross session. mplayer will play every music you like.
cron will wake up your phone reliable, even after a long night. Your display remains dark.
To end this "alarm", you have to press the power button once, then either hit q, or p on the keyboard. This will quit, or pause mplayer.
As an alternative you can end kingscross. This is what I do, because I can do it without my glasses.
I hit the arrow icon to switch to task view, swipe to close and hit the fat red button on the right (indicating, mplayer is running in the terminal)
Yes, that are two to four key presses. More than in standard spy phones but less than necessary whith the standard alarm.
Here is, what has to be done before (you need basic knowlege of command line editors, cron, mplayer).
In Kingscross, or from a SSH session do:
sudo apt install cron
sudo apt install mplayer
crontab -e
## In the file, that opens, enter the following line
30 7 * * * loginctl unlock-session 1; DISPLAY=:0 /usr/bin/kgx -e "mplayer http://wdr-wdr5-live.icecast.wdr.de/wdr/...stream.mp3"
That's all.
At 7:30 on every weekday (30 7 * * * ), cron will now unlock the device in your name (loginctl unlock-session 1) and start kingscross (/usr/bin/kgx). Kingscross will execute mplayer and let it playback the german WDR5 info radio (-e "mplayer http://wdr-wdr5-live.icecast.wdr.de/wdr/...stream.mp3").
The mplayer manpages will tell you, how to set the initial volume and how to play your inividual playlist.
The cron manpages will tell you, how to configure "alarms" for working days, weekends etc.
|
|
|
Automate checking whether the Pinecil is still in stock |
Posted by: Julius_GU - 01-27-2021, 02:15 PM - Forum: General Discussion on Pinecil
- Replies (5)
|
 |
Here is a quick way to see whether the Pinecil gets back in stock.
I've been meaning to get one, but it is out of stock. To automate my stalking of pine's website, i've written this python script and thought that I could share it if someone thinks that it's neat:
Code: import requests as r
from tkinter import messagebox as m
import tkinter as tk
import os
url = "https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/?v=0446c16e2e66"
#don't show a main window
root = tk.Tk()
root.withdraw()
response = r.get(url)
source = response.text
startIndex = source.find("<title>")
endIndex = source.find("</title>")
if (startIndex == -1) or (endIndex == -1):
m.showerror(title="could not check pine64.com", message="please check your internet connection")
quit()
if("[Out of Stock]" in source[startIndex:endIndex]):
print(source[startIndex:endIndex])
m.showinfo(title="OUT OF STOCK", message="the Pinecil is stil out of stock, unfortunately")
else:
choice = m.askquestion(title="IN STOCK", message="THE PINECIL IS BACK\nGo to the store?")
if choice == 'yes':
os.system("firefox "+url)
This will show the following when executed
https://ibb.co/XzLBd1P
https://ibb.co/XCcJb9D
the only thing left then is to add a menu item with the command:
Code: python ~/checkPinecil.py
(replace "~/checkPinecil" with the path to your saved file)
Then you can easily check whether it is available 
P.s. I am aware of how useless this is, but I was bored and this is the result.
Best Regards, Julius
|
|
|
PINEPHONE CE |
Posted by: poly60 - 01-27-2021, 08:57 AM - Forum: General Discussion on PinePhone
- Replies (4)
|
 |
Hi
Is this phone in stock now? Will it work in Norway?
PINEPHONE Community Edition Mobian With Convergence Package Limited Edition Linux SmartPhone Community price: $199.99
|
|
|
Disabling screen timeout for plasma mobile |
Posted by: rp3 - 01-27-2021, 05:40 AM - Forum: Manjaro on PinePhone
- Replies (7)
|
 |
Hi everyone, I just thought I would share something I stumbled across the other day, which seems very difficult to find on the web?
How to disable the very short screen timeout for plasma on the pinephone.
-This can be an incredibly distracting issue, -maybe it needs dealing with?
I happened to long-press the desktop, and "Add Widgets" appeared
I pressed this, and tried adding the "Display Configuration" widget.
It had something called "Enable Presentation Mode", which I tried.
This seemed to work, and the screen then stayed on indefinately -Yay!
Perhaps this is helpful to someone else?
Regards.
|
|
|
Is there an encryption package missing from mobian? |
Posted by: rp3 - 01-27-2021, 05:16 AM - Forum: Mobian on PinePhone
- No Replies
|
 |
Hi everyone,
I just tried to access a luks sdcard and a luks usb stick from a pinephone loaded with the last encrypted installer image of mobian.
I ran nemo and saw the new drive on the left pane, but when I clicked on it and entered the luks password, it came up with this error:
"Unable to mount 31Gb encrypted Error unlocking /dev/-mmcblk0p3 - The function bd_crypto_luks_open_blob called but not implemented"
I did some web searching and found instructions to do the following, which I tried:
sudo apt install libblockdev-crypto2
systemctl restart udisks2.service
This seems to work, and both the sdcard and the usb stick seemed to mount sucessfully in nemo.
Has the package libblockdev-crypto2 been forgotten, or maybe been left out for a reason?
Any feedback much appreciated?
Regards!
|
|
|
DOA Pinecil? |
Posted by: foobarney - 01-26-2021, 08:30 PM - Forum: General Discussion on Pinecil
- Replies (7)
|
 |
My Pinecil arrived this morning and it doesn't seem to be working.
When I power it up, the main screen pops up and I can go through the menus, but as soon as I try to turn the heat on, it blinks off and then restarts.
I tried updating the firmware, but got an error message when I tried to flash it:
Invalid DFU suffix signature A valid DFU suffix will be required in a future dfu-util release!!! Error during special command "MASS_ERASE" get_status
DFU-Util exited with error code 74!
Flashing failed.
Any suggestions on how to get it working?
|
|
|
TEE implementations for ARM Trustzone on PinePhone |
Posted by: wanderlost_panda - 01-26-2021, 06:21 PM - Forum: General Discussion on PinePhone
- No Replies
|
 |
Hey, I'm currently looking into Trusted App development using TEE leveraging ARM TrustZone. Most open-source TEE implementations are for development boards like the Hikey or Juno boards.
I would like to know if there has been any work related to this on the PinePhone? I was quite surprised to find no notion of the ARM TrustZone on the PinePhone documents, though ARM CORTEX A53 has support for TrustZone. So any information would be of great help
Thank you
|
|
|
Restocking standoffs / spacers ? |
Posted by: DrYak - 01-26-2021, 01:55 PM - Forum: Pinebook Pro Hardware and Accessories
- No Replies
|
 |
Does somebody from Pine64 have an idea if/when the Pinebook Pro Screws set 10 pieces are going to be back in stock?
My standoffs started cracking some time ago, and by now (after the last upgrade of the NVMe duaghter board) it's slowly becoming a puzzle of small pieces that I need to put together before screwing the back cover back in.
I would gladly buy a new set, but as of writing this, the article is out of stock.
If there's no chance of restocking soon(-ish), Plan B would be to fetch the STL files from Thingiverse that was put together by @sundog and try to get it 3D printed at my uni's makerspace once the lockdown is over.
|
|
|
Important apps stopped working |
Posted by: yurievitch - 01-26-2021, 01:10 PM - Forum: PineTab Software
- Replies (2)
|
 |
About three weeks ago or more the file manager, terminal and four items from Settings either get stuck while launching or, as in the case with Settings just show blank screens. These include Privacy, Language and Battery.
I'm on version 308.
|
|
|
|