💾 Archived View for ainent.xyz › gemlog › 2022-03-28-librem-5-flexibility.gmi captured on 2023-07-10 at 13:39:27. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

🚧 View Differences

-=-=-=-=-=-=-

Librem 5 Flexibility

Some time ago, I mentioned my plans to write a review for the Librem 5. I still have that planned, but I did want to talk about one specific aspect of it now: usage flexibility.

Use Cases

I have found the following use cases for this phone:

Phone

This one is self-explanatory, it has the general form factor of your modern smart phone (aside from the thickness and weight, but I like those, makes it easier to hold onto!).

Desktop, large screen

You can also plug this device into a desktop monitor, with keyboard and mouse (Bluetooth or wired), and it turns into a desktop computer. When in this mode, I usually disable the phone screen itself, but you can keep it on if you want and then you have 2 monitors (the 'real' monitor, and the phone itself).

Laptop / Tablet

I have this under the same category because I do this via a single accessory: a Nexdock.

Desktop, mini screen

For some reason, this is the one I have found myself most excited about. Maybe because of the convenience over the others?

A friend recommended a phone stand, so I picked one up and now I can put the phone in front of me, in either landscape or portrait orientation, and then hook up a keyboard and mouse (also Bluetooth or wired), and I have a mini-desktop, without the hassle of plugging into a monitor.

I know this doesn't sound like the most exciting thing in the world, as I am pretty sure you can even do this with an iPhone, but an iPhone doesn't let you use it as a full desktop computer. The Librem 5, even when not plugged into a large monitor, still has all the same capabilities of a desktop computer.

One annoyance I ran into with this use case was the on-screen keyboard. Even after manually dismissing it, it kept coming back regularly (almost every time I would switch apps) and then I'd have to manually tap the 'hide keyboard' button. I'd had enough of this, so I spent about 10-20 minutes writing an app to disable this for me.

I say 'app' only because that's what it looks like on the home screen. Really, it just calls a small shell script.

Update: while trying to tweak this script to add a license header, I accidentally wiped the contents of the file and had to rewrite it. I had a git repo created for it, but forgot to commit or even stage it for commit. You'd think I'd know better by now than to depend on something without checking it into source control...

Script to toggle the on-screen keyboard:

# toggle-on-screen-keyboard.sh
# librem-5-utilities
#
# Created by Ainent on 03-28-22.
# Copyright © 2022 Ainent. All rights reserved.
#
# This file is part of librem-5-utilities.
#
# librem-5-utilities is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free
# Software Foundation, version 3 of the License only.
#
# librem-5-utilities is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with librem-5-utilities. If not, see <https://www.gnu.org/licenses/>.

#!/bin/zsh

IS_KEYBOARD_ENABLED=$(gsettings get org.gnome.desktop.a11y.applications screen-keyboard-enabled)

if [ $IS_KEYBOARD_ENABLED = 'true' ]; then
    echo "On-screen keyboard on, disabling..."
    gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false
else
    echo "On-screen keyboard off, enabling..."
    gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
fi

There is probably a more efficient way of doing this, but it works. Swift is my professional language; my amateur language is zsh/bash/sh.

To get this to show up on your home screen, just put this into a config file at `/usr/share/applications/osk.desktop`:

[Desktop Entry]
Name=OSK
X-GNOME-FullName=Toggle On-Screen Keyboard
GenericName=Utility script
Comment=Toggle the on-screen keyboard, useful for when using hardware keyboard when not docked
Exec=/path/to/where/you/save/this/script/toggle-on-screen-keyboard.sh
Icon=preferences-desktop-keyboard
Terminal=false
Type=Application
Categories=Utility;
X-Purism-FormFactor=Workstation;Mobile;

I'll probably throw these up on GitLab at some point, but for now, feel free to use them, under the terms of the GPL Version 3.

If you'd rather just download these files directly, here you go:

toggle-on-screen-keyboard.sh

osk.desktop