-
-
Notifications
You must be signed in to change notification settings - Fork 150
fusuma.service for local development
This document provides a guide to set up and manage a Fusuma service specifically for development purposes using systemd user services. Fusuma is installed using rbenv and local plugins are loaded via a specified Gemfile.
Create the necessary directory and fusuma.service
file, then enable the service:
$ mkdir -p ~/.config/systemd/user/
$ vim ~/.config/systemd/user/fusuma.service # Copy the provided content below
$ systemctl --user enable fusuma.service
Reload the systemd daemon and restart the service:
$ systemctl --user daemon-reload && systemctl --user restart fusuma.service
Monitor the service logs to ensure it is running correctly:
$ journalctl --user -u fusuma.service -f
To disable and remove the fusuma.service
, follow these steps:
$ systemctl --user disable fusuma.service
$ systemctl --user daemon-reload
$ rm ~/.config/systemd/user/fusuma.service
Below is the content for the fusuma.service
file:
[Unit]
Description=Fusuma for development
After=default.target
[Service]
# Use bundler (bundler is installed in ~/.rbenv/shims with rbenv)
ExecStart=%h/.rbenv/shims/bundle exec fusuma --verbose
# Directory where Gemfile is located
WorkingDirectory=%h/.ghq/github.com/iberianpig/fusuma/
# Specify BUNDLE_GEMFILE for customized Gemfile
Environment="BUNDLE_GEMFILE=Gemfile.local"
[Install]
WantedBy=default.target
Explanation of the Configuration
-
[Unit]
-
Description
: Brief description of the service. -
After
: Ensures the service starts after thedefault.target
.
-
-
[Service]
-
ExecStart
: Command to start Fusuma using bundler (bundler is managed by rbenv and located in~/.rbenv/shims
). -
WorkingDirectory
: Path to the directory where the Gemfile is located. -
Environment
: Specifies the customGemfile.local
.
-
-
[Install]
-
WantedBy
: Ensures the service is started in the default target.
-
This configuration ensures that Fusuma runs as a systemd user service, utilizing rbenv for Ruby environment management and a local Gemfile for plugin customization. This guide is specifically tailored for developers setting up Fusuma in a development environment.
Here is an example of a Gemfile.local
that can be used to load local plugins for Fusuma:
Click to expand `Gemfile.local` example
source "https://rubygems.org"
# Specify your gem's dependencies in fusuma.gemspec
gemspec
gem "bump"
gem "bundler"
gem "github_changelog_generator", "~> 1.16"
gem "debug"
gem 'rdbg'
gem "rake", "~> 13.0"
gem "rblineprof"
gem "rblineprof-report"
gem "reek"
gem "rspec", "~> 3.0"
gem "rspec-debug"
gem "rspec-parameterized"
gem "rubocop"
gem "simplecov"
gem "standard", require: false
gem "yard"
gem "attractor"
gem "attractor-ruby"
# additional
gem "solargraph"
# fusuma plugins for local development
[
"iberianpig/fusuma-plugin-sendkey",
"iberianpig/fusuma-plugin-wmctrl",
"iberianpig/fusuma-plugin-keypress",
"iberianpig/fusuma-plugin-appmatcher",
"iberianpig/fusuma-plugin-remap",
"iberianpig/fusuma-plugin-thumbsense"
].each do |repo|
name = repo.split("/").last
gem name, path: "~/.ghq/github.com/#{repo}" # Load local plugins from specified path
end