From afef2e35915faa1fe661f47421ae0d2a88fac884 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 9 Jan 2021 16:25:59 -0800 Subject: [PATCH] Initial commit --- README.md | 6 ++++++ mobian-battery | 4 ++++ sleep-ttl | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 README.md create mode 100755 mobian-battery create mode 100755 sleep-ttl diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc28730 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Mobian Scripts + +This is just a collection of useful shell scripts for +[Mobian](https://mobian-project.org/) on Pinephone. + +Clone it somewhere and add it to the end of your $PATH. diff --git a/mobian-battery b/mobian-battery new file mode 100755 index 0000000..bc75427 --- /dev/null +++ b/mobian-battery @@ -0,0 +1,4 @@ +#!/bin/bash +# Shortcut to echo the raw battery status on Mobian. + +cat /sys/devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp20x-battery-power-supply/power_supply/axp20x-battery/uevent diff --git a/sleep-ttl b/sleep-ttl new file mode 100755 index 0000000..20f2b04 --- /dev/null +++ b/sleep-ttl @@ -0,0 +1,18 @@ +#!/usr/bin/env perl + +# sleep-ttl: query or set the GNOME suspend timeout. +# usage: sleep-ttl [new value in seconds] + +use feature qw(say); +use strict; +use warnings; + +if (scalar @ARGV > 0 && $ARGV[0] =~ /^(\d+)$/) { + my $ttl = $1; + say "Set TTL to $ttl"; + exec("gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout $ttl"); +} + +my $current = `gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout`; +chomp $current; +say "Current suspend TTL is: $current";