Skip to main content

GTK4 Layer Shell menus for Hyprland

Project description

L1p0-Menus

Wi-Fi/Bluetooth/Audio/Brightness/Battery Popup menus for Wayland/Hyprland

A fast, full event-driven desktop popup menu system designed specifically for Wayland and Hyprland environments. No polling, no CPU wasting. Built on top of a Python daemon using `gio` for native D-Bus integration.

GitHub stars GitHub forks GitHub watchers

License: MIT GTK

Preview

Features & Architecture

  • Pure Event-Driven: Zero idle CPU usage. The daemon sleeps and wakes up instantly only when D-Bus signals or external events trigger it.
  • GTK4 + Layer Shell: Leveraging gtk4-layer-shell for hardware-accelerated, responsive, and native Wayland layer management.
  • Modern & Smooth Animations: Fully animated UI elements using native GTK Revealer widgets, providing fluid, hardware-accelerated transitions for dropdowns and detail panels.
  • First-Class D-Bus Citizen: Built-in GIO/GDBus integration. It functions as a fully registered SecretAgent for both NetworkManager and BlueZ, securely handling Wi-Fi passwords and Bluetooth pairing prompts natively within the UI.
  • Highly Customizable: Complete separation of logic, configuration, and styling via standard config.json and a powerful custom style.css file. Uses your GTK4 icon theme.
  • Modern Packaging: Clean, robust deployment built entirely with Hatchling following the PEP 517 standards.

Available Popups / Modules

The package currently includes the following fully-featured popup menus:

  • Weather & Calendar: A beautiful calendar dropdown equipped with an 3 hourly/daily weather forecast breakdown powered by OpenWeatherMap.
  • Battery Status: Displays active discharging/charging rates with a collapsible detailed view showing hardware info (Vendor, Model, Charge Cycles, Energy Full, and Design Capacity).
  • Network Manager: Full Wi-Fi control. Scan available networks, view connection details (IP, Gateway, DNS, MAC, Speed), and connect securely via the integrated SecretAgent. Manage your saved networks from the ui: Turn off/on autoconnect or forget the network.
  • Bluetooth Control: Easily toggle Bluetooth, switch discoverability, scan for devices, pair/disconnect, and view battery levels for connected peripherals.
  • Brightness & Night Light: Smooth brightness slider with an integrated Night Light toggle and custom temperature preset adjustment. Using Hyprsunset as the backend socket.
  • Audio: Master volume and microphone sliders with quick-access audio output/input source switching (e.g., internal audio to Bluetooth headset).

Installation

Arch Linux (AUR)

l1p0-menus is available in the AUR. You can install it using your favorite AUR helper:

# Using paru
paru -S l1p0-menus-git

# Using yay
yay -S l1p0-menus-git

From Source (Using pipx)

pipx install l1p0-menus

For Updates

pipx upgrade l1p0-menus

Usage

To use l1p0-menus, you need to start the background daemon first, then interact with it using various flags.

1. Start the Daemon (Required)

Before doing anything else, you must start the core background process. It is highly recommended to add this to your compositor's autostart configuration (e.g., in your Hyprland config).

l1p0-menus --daemon

For Hyprland, you can add this to your hyprland.lua:

hl.on("hyprland.start", function()
    hl.exec_cmd("l1p0-menus --daemon")
end)

2. Waybar Integration

You can easily toggle the visibility of specific popup menus by binding the --toggle commands to Waybar modules using the on-click action.

Here is an example of how to add it to your Waybar config:

{
    "backlight": {
        "format": "{icon}  {percent}%",
        "format-icons": ["", "", "", "", "", "", "", "", ""],
        "on-click": "l1p0-menus --toggle brightness",
    },
    "battery": {
        "format": " {icon}",
        "format-charging": "󱐋{icon}",
        "format-plugged": "<small>Full</small> {icon}",
        "format-full": "<small>Full</small> {icon}",
        "tooltip-format": "{capacity}%\n{power} W \n{timeTo}",
        "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
        "interval": 10,
        "on-click": "l1p0-menus --toggle battery",
    }
}

3. Reloading Settings on the Fly

You can apply changes to your configuration or styling instantly without restarting the daemon:

  • Reload CSS rules:
l1p0-menus --reload-css
  • Reload Config (config.json):
l1p0-menus --reload-config

Style

To style the menus to match your specific theme, l1p0-menus gives you the option to place a style.css file in the ~/.config/l1p0-menu/ directory and write your own CSS. :)

As a starting point, I recommend checking out the internal (default) CSS file here.


Config

You can place a config.json file in ~/.config/l1p0-menu/ to configure the menus.

  • Valid anchors: top-right, top-left, top (or top-center), bottom-left, bottom-right, bottom (or bottom-center), left (or left-center), right (or right-center)
  • Margins configuration: Configured as a string: "top, right, bottom, left". ⚠️ Note: Missing values default to 0. For example, "10, 10" applies 10px to top and right, and 0px to bottom and left.

Example config.json:

{
  "weather-clock": {
        "api_key": "YOUR_OPENWEATHERMAP_API_KEY",
        "language": "YOUR LANGUAGE (defaults to 'en')",
        "city": "YOUR CITY",
        "show_sunset": true,
        "show_feels_like": true,
        "margin": "10",
        "anchor": "top-center",
        "date_format": "%Y-%m-%d"
   },
   "network": {
        "margin": "10, 10",
        "anchor": "top-right",
        "notification": true
   },
   "battery": {
        "margin": "10, 10",
        "anchor": "top-right"
   },
   "audio": {
        "margin": "10, 10",
        "anchor": "top-right"
   },
   "brightness": {
        "margin": "10, 10",
        "anchor": "top-right",
        "night_preset": "2500"
   }
}

Popup animation and Blur

Every popup has its own namespace to make it easy to have different animations on each one. Add this to your hyprland.lua to enable blur and popup animations:

hl.layer_rule({
    match = { namespace = "audio-layer" },
    blur = true,
    blur_popups = true,
    ignore_alpha = 0,
    animation = "slide top"
})

hl.layer_rule({
    match = { namespace = "brightness-layer" },
    blur = true,
    blur_popups = true,
    ignore_alpha = 0,
    animation = "slide top"
})

hl.layer_rule({
    match = { namespace = "calendar-layer" },
    blur = true,
    blur_popups = true,
    ignore_alpha = 0,
    animation = "slide top"
})

hl.layer_rule({
    match = { namespace = "battery-layer" },
    blur = true,
    blur_popups = true,
    ignore_alpha = 0,
    animation = "slide top"
})

hl.layer_rule({
    match = { namespace = "network-layer" },
    blur = true,
    blur_popups = true,
    ignore_alpha = 0,
    animation = "slide top"
})

License

This project is licensed under the MIT License. You can read it here.

AI Usage

No AI was used during the development of this project, only good old documentation, 10-year-old StackOverflow questions, and a massive amount of coffee. :D

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

l1p0_menus-1.1.5.tar.gz (55.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l1p0_menus-1.1.5-py3-none-any.whl (63.7 kB view details)

Uploaded Python 3

File details

Details for the file l1p0_menus-1.1.5.tar.gz.

File metadata

  • Download URL: l1p0_menus-1.1.5.tar.gz
  • Upload date:
  • Size: 55.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for l1p0_menus-1.1.5.tar.gz
Algorithm Hash digest
SHA256 6d79d6ea7f90a368506ea60bd5faa6700f1eec0db2b0aafcacb86e7964df1df1
MD5 580fa2ca200c31750063fbbcd73a2bda
BLAKE2b-256 070cb200328277945fbda3e07b09405452dd01be40eb587406367f08a0b0746f

See more details on using hashes here.

File details

Details for the file l1p0_menus-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: l1p0_menus-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 63.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for l1p0_menus-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ee7604f58e55c026d5dd83d6e410d2bb0e28d30cc39dd96aca2bc6342c54281a
MD5 363e0f9cd9ba1e5ee4af0b4db534bb57
BLAKE2b-256 4dfa13585a967d18bbdfb3e029c80cb81e117aabff32ce96a2d392cea46ee3e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page