I got a nice discount on an MK345 (decent keyboard, junk mouse - and no unifying support) keyboard. Improvement on my old K270 as the letters had worn off (and I need them for Thai input…).
The issue I’m having is that instead of dedicated keys, the ‘function’ keys are all on the Fkeys with a Fn shortcut. No dedicated media keys…
So I figured out I can install Solaar-git, open it up, and use the Swap Fx Function. This works well with my K400 for when I’m listening to music etc… but not with a main keyboard where I sometimes need to push F buttons - and the Fn key is too far to do it with one hand.
So I want to switch them…
The keyboard lists (command ‘solaar show’) as device 1.
If I type ‘solaar config 1 | grep fn-swap’ I get some errors and an output:
Summary
(solaar:1857191): Gtk-WARNING **: 14:18:03.647: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn’t be used anymore. It will be removed in a future version
(solaar:1857191): Gtk-WARNING **: 14:18:03.647: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn’t be used anymore. It will be removed in a future version
(solaar:1857191): Gtk-WARNING **: 14:18:03.647: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn’t be used anymore. It will be removed in a future version
Gtk-Message: 14:18:03.665: Failed to load module “appmenu-gtk-module”
fn-swap = False
fn-swap is false.
Next we can do 'solaar config 1 fn-swap= “True”
also we can do 'solaar config 1 fn-swap=“False”
But what I want to do is to have a little script.
- check fn-swap
- if false, then set true
- if true, then set false
This I can then launch with a simple shortcut/mouse gesture.
How can I do this?
I have script ‘fn-swap.sh’
#!/bin/bash
if solaar config 1 | grep fn-swap “True”
then solaar config 1 fn-swap= “False”
else solaar config 1 fn-swap= “True”
fi
But I get this:
Summary
solaar: error: Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/solaar/cli/init.py”, line 199, in run
m.run(c, args, _find_receiver, _find_device)
File “/usr/lib/python3.8/site-packages/solaar/cli/config.py”, line 74, in run
raise Exception(“no setting ‘%s’ for %s” % (args.setting, dev.name))
Exception: no setting ‘fn-swap=’ for Wireless Keyboard MK270
Hmmmmm…