All Projects → lf- → aiopanel

lf- / aiopanel

Licence: MIT license
An asyncio text-based panel

Programming Languages

python
139335 projects - #7 most used programming language
Nix
1067 projects

Projects that are alternatives of or similar to aiopanel

Imscp
i-MSCP Main Repository
Stars: ✭ 184 (+820%)
Mutual labels:  panel
Jspanel4
A JavaScript library to create highly configurable floating panels, modals, tooltips, hints/notifiers/alerts or contextmenus for use in backend solutions and other web applications.
Stars: ✭ 217 (+985%)
Mutual labels:  panel
electron-panel
Manipulate panels in window for Electron.
Stars: ✭ 14 (-30%)
Mutual labels:  panel
Library Management System
📚 An automated library management system developed in Laravel 4.2 PHP MVC Framework
Stars: ✭ 189 (+845%)
Mutual labels:  panel
Nwg Launchers
GTK-based launchers: application grid, button bar, dmenu for sway and other window managers
Stars: ✭ 211 (+955%)
Mutual labels:  panel
Panel
A Snapchat inspired ScrollView Controller Written in Swift
Stars: ✭ 22 (+10%)
Mutual labels:  panel
Desktopfolder
Bring your Desktop Back to Life
Stars: ✭ 171 (+755%)
Mutual labels:  panel
SpicyTaco.AutoGrid
A magical replacement for the built in WPF Grid and StackPanel
Stars: ✭ 67 (+235%)
Mutual labels:  panel
Elasticsearch Comrade
Elasticsearch admin panel built for ops and monitoring
Stars: ✭ 214 (+970%)
Mutual labels:  panel
grafana-dynamictext-panel
A dynamic, data-driven text for @grafana.
Stars: ✭ 42 (+110%)
Mutual labels:  panel
Dynamic Panel Transparency
Adds Transparency To The Gnome Shell Panel
Stars: ✭ 189 (+845%)
Mutual labels:  panel
Panel
Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
Stars: ✭ 2,988 (+14840%)
Mutual labels:  panel
electron-dockable
dockable panel for electron (work in progress...)
Stars: ✭ 50 (+150%)
Mutual labels:  panel
Nebula
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.
Stars: ✭ 190 (+850%)
Mutual labels:  panel
UnityGUI
UGUI Panel Systems for navigation, animation and more
Stars: ✭ 80 (+300%)
Mutual labels:  panel
Kinto Admin
Kinto Web Administration Console
Stars: ✭ 175 (+775%)
Mutual labels:  panel
Side Menu.ios
Animated side menu with customizable UI
Stars: ✭ 2,702 (+13410%)
Mutual labels:  panel
twitch-extension-starter
Kickstarts your Twitch Extension using React
Stars: ✭ 38 (+90%)
Mutual labels:  panel
linux-mdss-dsi-panel-driver-generator
Generate Linux DRM panel kernel driver based on QCOM MDSS DSI device tree
Stars: ✭ 41 (+105%)
Mutual labels:  panel
SharpPanel
C# Admin Control Panel Finder For Windows
Stars: ✭ 34 (+70%)
Mutual labels:  panel

aiopanel

An asyncio text-based panel system.

Features

  • WM and bar agnostic. By default, lemonbar-like bars that take lines on stdin and display them are supported, though there is a generic API that can be used to hook the output to anything that takes a string.
  • Uses very little CPU time when running
  • Rich customization through a Python based configuration file
  • Concurrent/asynchronous programming model ensures all widgets are as responsive as possible

Requirements

  • Python 3.6+ (f-strings and asyncio changes)
  • jinja2 (all templating)
  • gbulb + GLib (event loop, will be used for DBus widget subscriptions)
  • aiobspwm (optional, for bspwm widget)

How to use

Config file is at ~/.config/aiopanel/config.py
Log file is at ~/.cache/aiopanel/aiopanel.log

Example config for a bspwm/lemonbar setup:

import aiopanel

# An instance of a PanelAdapter subclass that defines where the panel
# renders to
out_adapter = aiopanel.SubprocessAdapter([
    'lemonbar',
    '-fSource Sans Pro:size=11',
    '-fFontAwesome:size=11',
    '-gx20'
])

# A jinja2 format template string for the whole panel. Gets the rendered
# output of whatever is in `widgets` as input
out_fmt = '{{ bspwm }}%{r}{{ date }}'

# A string or integer log level for the standard library logging module
# Optional.
log_level = 'DEBUG'

# these are just put here for convenience; they aren't config settings
bspwm_ctx = {
    'active_colour': '#ff4c5399',
    'inactive_colour': '#ff303030'
}

# same here
bspwm_template = """
{%- for m in wm.monitors.values() -%}
    %{B{{ ctx.active_colour if wm.focused_monitor == m else ctx.inactive_colour }}}
    {{- ' ' }}{{ m.name }}{{ ' ' }}%{B-}
    {%- for d in m.desktops.values() -%}
        %{B{{ ctx.active_colour if m.focused_desktop == d else ctx.inactive_colour }}}
        {{- ' ' }}{{ d.name }}{{ ' ' }}%{B-}
    {%- endfor -%}
{%- endfor -%}
"""

# position: List[Widget] dictionary of widgets.
# Rendered, concatenated (within the lists) output is the context for out_fmt
widgets = {
    'bspwm': [aiopanel.BspwmWidget(bspwm_template, ctx=bspwm_ctx)],
    'date': [aiopanel.DateTimeWidget('%b %-d %H:%M', update=2)]
}

Writing a widget

A widget is expected to have two async methods on it:

update(), returning a str representing the desired output of the widget. This is called whenever watch() asks for an update.

watch(request_update), returning nothing. This runs in an infinite loop awaiting a given update condition, then calling request_update().

Note:

It generally makes more sense to call request_update() before waiting, so that the initial loading of the widget happens immediately.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].