Git Product home page Git Product logo

hyprload's Introduction

Hyprload

A Hyprland plugin manager

Important

Plugin Developers: hyprload has recently been refactored to no longer provide HYPRLAND_HEADERS. As far as I know, this wasn't used anywhere, but if you encounter issues (missing headers, etc.) that's a sign for you to move to pkg-config. hyprload now always provides a known good version of headers via pkg-config by overriding it.

Warning

Users As part of the above changes, you might want to reinstall hyprload, as the place where Hyprland headers were stored has changed. You could now be keeping a useless, pretty big duplicate repository in ~/.local/share/hyprload/hyprland (moved to ~/.local/share/hyprload/include/hyprland). To reinstall, simply rm -rf ~/.local/share/hyprload and proceed to Installing

Features

  • Loading plugins
  • Reloading plugins
  • Installing and updating plugins automatically
    • A unified plugin manifest format
    • Installing from git
    • Installing from local
    • Self-hosting
  • Plugin browser

Requirements

  • Hyprland >= 0.31.0
  • jq (required for checking Hyprland version)
  • polkit (required to set up Hyprland plugin env)
    • You will need an authentication agent set up. lxsession works for me.
  • cpio (required during installation for file management)

Installing

  1. Install hyprload
    • curl -sSL https://raw.githubusercontent.com/Duckonaut/hyprload/main/install.sh | bash
  2. Add this to your config to initialize hyprload
    • exec-once=$HOME/.local/share/hyprload/hyprload.sh

Setup

  1. To have hyprload manage your plugin installation, create a hyprload.toml file (by default, next to your hyprland.conf config: ~/.config/hypr/hyprload.toml
  2. Fill it out with the plugins you want. It consists of one array, named plugins, in which you can provide the installation source in various ways. Example:
plugins = [
    # Installs the plugin from https://github.com/Duckonaut/split-monitor-workspaces
    "Duckonaut/split-monitor-workspaces",
    # A more explicit definition of the git install
    { git = "https://github.com/Duckonaut/split-monitor-workspaces", branch = "main", name = "split-monitor-workspaces" },
    # Installs the same plugin from a local folder
    { local = "/home/duckonaut/repos/split-monitor-workspaces" },
]
  1. Add keybinds to the hyprload dispatcher in your hyprland.conf for the functions you want.
    • Possible values:
      • load: Loads all the plugins
      • clear: Unloads all the plugins
      • reload: Unloads then reloads all the plugins
      • install: Installs the required plugins from hyprload.toml
      • update: Updates hyprload and the required plugins from hyprload.toml
    • Example:
bind=SUPERSHIFT,R,hyprload,reload
bind=SUPERSHIFT,U,hyprload,update

Configuration

The configuration of hyprload behavior is done in hyprland.conf, like a normal plugin

Name Type Default Description
plugin:hyprload:quiet bool false Whether to hide the notifications
plugin:hyprload:debug bool false Whether to hide extra-special debug notifications
plugin:hyprload:config string ~/.config/hypr/hyprload.toml The path to your plugin requirements file
plugin:hyprload:hyprland_headers string empty The path to the Hyprland source to force using as headers.

Plugin Development

If you maintain a plugin for Hyprland, to support automatic management via hyprload.toml, you need to create a hyprload.toml manifest in the root of your repository. hyprload cannot assume the way your plugins are built.

Format

The plugin manifest needs to specify some information about the plugins in the repo. If you're familiar with TOML, it means specifying two dictionaries per plugin - PLUGIN_NAME and PLUGIN_NAME.build. The PLUGIN_NAME dictionary has basic information about the plugin like the version, the description and the author. These are not used currently, and can be omitted if you don't want to bother for now.

The PLUGIN_NAME.build dictionary is much more important, as it holds 2 important values: output, which is the path to the built plugin .so from the repo root, and steps, which holds the commands to run to build that .so. hyprload will define HYPRLAND_HEADERS while building the plugin, and guarantees the version of the headers matches the Hyprland version you're running.

It's important to note that the hyprload.toml plugin manifest can hold multiple plugins. This allows you to define a single manifest for a monorepo.

The full specification of a PLUGIN_NAME dict:

Name Type Description
description string Short description
version string Version
author string Author
authors list Can be defined instead of author
build.output string The path of the .so output
build.steps list List of commands to build the .so

Examples

Single plugin

split-monitor-workspaces

[split-monitor-workspaces]
description = "Split monitor workspaces"
version = "1.0.0"
author = "Duckonaut"

[split-monitor-workspaces.build]
output = "split-monitor-workspaces.so"
steps = [
    "make all",
]

Multiple plugins

Here's what the manifest would look like for the official plugins.

[borders-plus-plus]
description ="A plugin to add more borders to windows."
version = "1.0"
author = "Vaxry"

[borders-plus-plus.build]
output = "borders-plus-plus/borders-plus-plus.so"
steps = [
    "make -C borders-plus-plus all",
]

[csgo-vulkan-fix]
description = "A plugin to fix incorrect mouse offsets on csgo in Vulkan"
version = "1.0"
author = "Vaxry"

[csgo-vulkan-fix.build]
output = "csgo-vulkan-fix/csgo-vulkan-fix.so"
steps = [
    "make -C csgo-vulkan-fix all",
]

[hyprbars]
description = "A plugin to add title bars to windows"
version = "1.0"
author = "Vaxry"

[hyprbars.build]
output = "hyprbars/hyprbars.so"
steps = [
    "make -C hyprbars all",
]

hyprload's People

Contributors

duckonaut avatar nekocwd avatar soispha avatar lisuke avatar noggynoggy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.