spacefn-evdev icon indicating copy to clipboard operation
spacefn-evdev copied to clipboard

Idea/Question: Quick and easy way to launch spacefn

Open maciejmotyka opened this issue 6 years ago • 2 comments

I wanted to share my way of quickly launching spacefn and ask if it's safe to do it this way. This is all very basic Linux magic, but maybe less experienced users can learn something from it. I have 2 scripts sfn and sfn2, which enable spacefn for either my laptop keyboard or an external keyboard. I put them into /usr/local/bin. Both are the same except for my_device

#! bin/env bash
nohup spacefn /dev/input/my_device &
exit

Then I do


sudo chmod +x /usr/local/bin/sfn{1,2}
sudo chown root:root /path/to/spacefn
sudo chmod u+s /path/to/spacefn

and I'm able to launch spacefn without specifying the device, typing password, having to keep a terminal open or put the process to the background to be able to close the terminal.

Do you see any downsides? How do you launch spacefn?

maciejmotyka avatar Dec 10 '19 13:12 maciejmotyka

Worked for me, thanks. Maybe we should add this in the README instead of having it here as an issue?

ftassi avatar Mar 17 '20 08:03 ftassi

If @abrasive wants to include it, I can make a PR.

N.B. There's a possibility for this way of launching to fail in certain situation. My external keyboard usually writes to /dev/input/event17 or /dev/input/event18, so I've set up the script to launch spacefn for both of them. From time to time, however, the keyboard would be assigned to some other 'event' and this method fails. A more robust solution could be to write a script that would listen to all of the input streams and ask user to push few keys to detect the correct one, prior to launching spacefn.

maciejmotyka avatar Mar 21 '20 17:03 maciejmotyka