Skip to content

Load settings from a local file #1892

Answered by Shamaoke
Shamaoke asked this question in Q&A
Discussion options

You must be logged in to vote

I solved the problem by running a local web server to serve the Surfingkeys configuration file.

Here's how I've done this.

1. Place the settings.js Surfingkeys configuration file in the /home/user/.config/surfingkeys/ directory;

2. Install the Ruby programming language: pacman -S ruby;

3. Install the WEBrick server: gem install webrick;

4. Create the surfingkeys.service user systemd unit in the /home/user/.config/systemd/user/ directory with the following content;

[Unit]
Description=Run the WEBrick server to serve the Surfingkeys configuration file

[Service]
ExecStart=/usr/bin/ruby -r un -e httpd /home/user/.config/surfingkeys -b 127.0.0.1 -p 8888

[Install]
WantedBy=default.target

5. E…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xiaobing-huang
Comment options

Answer selected by Shamaoke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants