/systemdUnitFilePlugin

Primary LanguageJavaGNU General Public License v2.0GPL-2.0

Unit File Support for systemd

Introduction

This plugin adds support for systemd unit files to IntelliJ.

Features🤞

  • Syntax highlighting for unit files
  • Auto-completion for:
    • Option names in a section
    • Boolean options
    • Octal options
    • Some other common options (KillMode=, Type=, Restart=)
  • Inspections
    • Invalid values for boolean options
    • Unknown option in section (ignoring those starting with X-)
  • Annotations
    • When the section name is invalid.
    • Whitespace after a line continuation \ character.
    • When a key has been deprecated.
  • Built-in documentation for options or section name (available when hitting CTRL+Q or F1 on Mac)

Usage

To create a file simply right click on a folder and New > File, and enter a file name ending any of:

  • .automount
  • .device
  • .mount
  • .path
  • .service
  • .slice
  • .socket
  • .swap
  • .target
  • .timer

The file should then be associated with this plugin and the above features should work.

NOTE: .scope units are not configured via unit configuration files and so we don't support them.

Installation

This plugin is avaliable to install at the JetBrains Plugin Repository.

Contributors

Acknowledgements

License

  • Everything but the logo is GPLv2.
  • Logo is CC-BY-SA, as it is a derivative work from the brand repository.

Development Notes

System Requirements

On top of Java 11, you will need the m4 macro processor installed on your system and available on the path.

Manual Installation

Simply clone the repository, and run

./gradlew buildPlugin 

Then in IntelliJ navigate to

Plugins > Install Plugins From Disk > build/distributions/systemdUnitFilePlugin-X.X-SNAPSHOT.zip

Problems

Weird Fonts In Linux

When starting the development IDE if the fonts are poor add the following ENVIRONMENT VARIABLE to the run configuration

_JAVA_OPTIONS=-Dawt.useSystemAAFontSettings\=lcd -Dsun.java2d.renderer\=sun.java2d.marlin.MarlinRenderingEngine

Note: If you are using the Gradle runIde task it must be passed as an environment variable and not a VM option, because it gets executed in a different VM.

SLF4J Errors when running tests

If you see errors related to duplicate SLF4J class bindings available switch the JRE in use from the Default which references IntelliJ, to a native one.