Skip to main content

A spacemacs menu inspired gtk module

Project description

SpaceMenu

Description

SpaceMenu is a python module inspired by the spacemacs "space menu". Designed to be used as a laucher for i3wm

Dependencies

gtk-3.0

Installation

pip install spacemenu

Usage

Window

The class Window represents the menu window itself

from spacemenu import Window
window = Window(root, options)
Parameters

root -> A dictionary with the desired display information in the following schema:

{
  "label": 'title of the window',
  "branches": [
    {
      "label": "label for the first branch",
      "branches": [],
      "leaves": []
    }
  ],
  "leaves": [
    { "label": "label for leaf 1", "command": "shell command to be executed""}
  ]
}

so, a branch can contain other branches or leaves, and each leaf executes a command.

options -> Options can either be a dictonary or an Options object

{
  "margin": 10,
  "column_spacing": 1,
  "row_spacing": 1,
  "max_columns": 5,
  "row_height": 35,
  "margin_left": 0,
  "margin_right": 0,
  "margin_bottom": 0,
  "font": "italic bold 12px Georgia, serif",
  "background_color": "#ffffff"
  "button_background_color": "#ffffff"
  "button_text_color": "#000000"
  "branch_background_color": "#ffffff",
  "branch_text_color": "#ffffff",
  "branch_text_shortcut_color": "#ff0000",
  "branch_text_separator_color": "#00ff00",
  "branch_text_label_color": "#0000ff",
  "leaf_background_color": "#ffffff",
  "leaf_text_color": "#000000",
  "leaf_text_shortcut_color": "#ff0000",
  "leaf_text_separator_color': "#00ff00",
  "leaf_text_label_color": "#0000ff"
}

note: any undefined values will be set to the Gtk theme default

Methods

draw() -> draw the window

Options

Outer Shape

  • margin_left: Sets outer left margin (in px)
  • margin_right: Sets outer right margin (in px)
  • margin_bottom: Sets outer bottom margin (in px)

Inner Shap

  • inner_margin: Inner margin for the window
  • column_spacing: Spacing between each column
  • row_spacing: Spacing between each row
  • max_columns: Maximum number of columns to display
  • row_height: The height of the buttons in each row
  • font: Font to be used by the labels

Colors

  • background_color: The color for the window background (#rrggbb)
  • button_background_color: The color for the button background (#rrggbb)
  • button_text_color: The color for the text of the buttons(#rrggbb)

TODO

  • allow externally defined shortcuts

License

GPL-3.0-or-later

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

spacemenu-0.4.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

spacemenu-0.4-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file spacemenu-0.4.tar.gz.

File metadata

  • Download URL: spacemenu-0.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for spacemenu-0.4.tar.gz
Algorithm Hash digest
SHA256 a5d19f04b7020a924f93bf941791ce2ccec08b8b1d94d9e23e7bc4b37b2d59bf
MD5 4d7dc7a9cafbadf9b026f1db9bab0360
BLAKE2b-256 02b916e2482977fa50f8a2bda30103d49f26a10c1f468e6d3f7f7a479c0a16d4

See more details on using hashes here.

File details

Details for the file spacemenu-0.4-py3-none-any.whl.

File metadata

  • Download URL: spacemenu-0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for spacemenu-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 588acad1f1c96b41ad22208548770bf2134384671894141c9217fb9d160dd1e6
MD5 cf4353f502278a79d0e2d524536d3157
BLAKE2b-256 51915b9c853f55cf5a1206de6f6cbdfaf9d174cf7b47b4b34a771d7424fef603

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